Sunday, July 22, 2012

The Raspberry Pi - Finally

On February 29th 2012, I was awake and anxiously waiting for the clock to hit the 6:00AM GMT time mark. After a long wait the day to be able to place an order for the famous and over hyped Raspberry Pi was arriving, I had already created my account on the RaspberryPi.com store and was happy to soon become the owner of one (or two) of the 10,000 boards that were being manufactured as the first production run for developers.


It is 6:00AM !! Big Surprise, instead of launching the sale directly, the folks from the Raspberry Pi Foundation (RPF) put together a deal with two major electronics distributors based in the UK, Farnell and RS Electronics. And that's not all, the boards are not available yet, they are still in production in China. But I was not a lonely geek trying to find how to place my order, there were a couple of thousand souls trying to do the same, so we DOSsed the distrubutor's websites that were not ready to take the orders, some of their affiliated sites overseas (like Newark) didn't have a part number for it, and there was a lot of confusion about price and shipping costs. This was just the start of a growing list of mishaps by RPF that I'll not cover here.


Finally after several hours trying and thanks to a fellow engineer that tweeted the right part number I was able to place an order for two units with Newark. Given that this was sort of a short run production there was a limitation of one unit, so I expected to have at least one in the next few days or weeks.


Time goes by, boards don't get shipped, alas !!!, the assembly house in China screwed up and populated the boards with the wrong RJ45 connector for the Ethernet interface !! more delays ... Ohhh, do the boards have CE and FCC certification and have been tested for hazardous materials asked the distributors ... huh?, more delays, and mixed with misinformation, confusing messages from RPF, frustrated people being kicked and banned from their Blog and forum (me included), and goes on. But after all the first board arrived by the end of May.


So what is the Raspberry Pi ?


The Raspberry Pi or Rpi, it is a small circuit board, about the size of a credit card with a Graphics Processor Unit with RAM memory on top (called PoP - Package on Package), an Ethernet controller with an integrated two port USB hub and various support components like voltage regulators, etc, to make the board work.


After many of us asking for them RPF made public the full schematics for it.


The GPU is a Broadcom BCM2835 System On Chip (SoC) that contains an ARM11 core running at 700MHz, and a Videocore 4 graphics processing unit,  and there is a 256MB SDRAM from Samsung or Hynix.


For mass storage there is a socket on the bottom side of the board that fits a SD Memory Card, composite and HDMI video outputs, a rudimentary PCM stero audio ouput, and for the model B two USB ports and one Ethernet port implemented with SMSC LAN9512 single-chip Ethernet controller and USB 2.0 hub.


The following diagram made by Paul Beech shows what is on the board.

Additional details about the hardware can be found on the eLinux Wiki Rpi Hardware page.


What about  software ?


From the get go the Rpi was intended to run a customized version of embedded Linux, or eLinux, there are several distros under work like Debian, Arch Linux ARM, Fedora Remix, QtonPI, and Raspbian the optimized version of Debian for the Rpi.


Disk images for the SD memory card (minimum recommended size is 4GB)  of some of these distros are available at the RPF download page.


Take in account that this is still a work in progress, so some of the distros like Raspbian are based on betas like "wheezy" for Debian.


Here is a screen picture of X-windows running on the Rpi with 1920x1080 resolution. One of the windows shows the Scratch programming interface that has been created by MIT as a programming and learning language for young kids.






Where it came from ?


The Rpi is the brain child of a group of scientists from the UK, that were interested to revive some of the spirit of the old personal microcomputers like the BBC Micro, Commodore 64, Sinclair ZX, and many others like that from the 70's & 80's, that provide a very economic and simple computing platform for kids to explore computer science and learn the basics of programming.


One of the alpha prototypes and proof of concept was developed by Broadcom and later modified by Norcott Technologies to reduce the size and number of components to minimize costs. Unfortunately in the process some design decisions were made without the open participation of the community, like using a micro USB connector to feed power from cellphone chargers, what was perceived a cheap solution but is being one of the major problems with the current version.


After RPF made the deal with the electronics distributors, they took over production of the boards that are being assembled at some unknown factory in  China at apparently at a rate of 4,000 a day.


How much it costs ? Is it worth to have ?



The RPF keeps promoting it with their site motto "An ARM GNU/Linux box for $25", but this statement is quite misleading. 


First is not a box, it does not run Linux but a reduced version of it for embedded systems, if you factor in that you will need a power supply, a SD card, a keyboard, a mouse, and eventually a monitor with the HDMI interface and cable, it is much more than just $25, which by the way is the price for the model A that is not available yet.


If you are geek enough, have time and money to spent on it, even with some of the technical issues that are surfacing, it is still a cool and cheap gadget to experiment with embedded Linux. My interest is to see if it could be used as eLinux based small controller for other systems like home automation, alarm systems, energy management, etc.


If you are looking for a video streamer or game box, like many of the early enthusiasts that showed up on the RPi forum, I'll recommend you better get something like a Roku 2 box that is based on the same GPU and will provide you instant satisfaction.

Also be aware that you may have to wait 5-6 weeks to get yours.


I'll be posting more articles with a more detailed technical reviews, and share some of the projects I'll be working on with the Rpi.


For more information you can visit




Happy Hacking
Jorge


Sunday, July 8, 2012

What is what you do ?


Once in a while I find myself in the situation of having to answer the classic question: "What is what you do?".


Is not rocket science, but not really easy for me to answer with a few words given that they won't convey the deep complexity, knowledge and dedication for what I do.

The simple and short answer would be "Electronic Systems Design", or when people may know what I'm talking about "Embedded Systems Design", and expanded answer would be "Research and Development of Embedded Microcontroller Applications with Networking and Intelligent Graphical Human Interfaces.

WOW, that sounds pretty kewl and geeky, IT IS !!, well at least for me :-)

To give you a more mundane and simple example, there is a lot of people talking about "smart" things like the nest thermostat, well, I design the guts of that kind of stuff.

Let me share with you how the process is, and as the saying goes, one image is worth a thousand words, but I'll add a brief explanation of each step.



The images above are for one of the products I developed and sell through my website, it is a small board slightly smaller than a credit card and that has a network interface chip, a simple microcontroller as the main processor and some non volatile memory.


The microcontroller is programmed with the "firmware" that implements the TCP/IP protocols used to communicate over the Internet, and it has sort of a small web server, that once the board is connected to the Net and powered, will let you access it from anywhere around the world to turn things off/on, check sensor readings like temperature, etc.

Like many ideas, a product like this may start as some gibberish block diagram on a napkin, the back of a store receipt, etc., but it then a more formal process begins using the right tools for the job.

The first step is to identify what components will be used and research how they have to be interconnected and what stuff is needed to make them work.

Then using a specific CAD program (Computer Aided Design), in this case Eagle CAD, I capture a representation of the component (called a symbol) and its package layout for later use in the design of a circuit board, and the schematics (shown as 1 in the picture), that show all the components, its values and how they need to get connected.

Not always necessary but a second step would be to put a rough prototype of the design to test its functionality, in some cases this could be done with a simulator on a computer, but there is no better test than the real hardware. In this case (shown as 2) I put together a wire wrapped prototype (components are interconnected on the bottom by thin wires that get "wrapped" on the pins of the sockets or the leads of the components.)

If everything goes well with the prototype, the next step is to design the printed circuit board layout (shown as 3), again with the CAD program this consists in placing the components and drawing the traces in one, two or more layers of conductive material that will interconnect them.

The CAD program will generate a set of special files that will be used for Computer Aided Manufacturing (CAM), this includes the files to produce the circuit board, place and solder the components on it. Picture 4, shows another tool I frequently use to inspect the CAM files.

Again, not always but often, just a few printed circuit board prototypes get done for testing and verification, to save costs (shown as 5) this particular prototype has no solder mask (a green protective and non-conductive thin layer) or legends.

If everything goes well then, real production begins (6 and 7), and the boards get programmed and tested, put into antistatic bags and get ready for shipment around the world.

Being this simple board, or a more complex design like the nest thermostat, it may require lots of research to learn the specifics of each components, some of them like more advanced microcontrollers have hundreds or thousands of pages of documentation that I need to read and digest, and experimentation using development kits, others prototype boards, etc. 


The picture on top of this article shows a peek to my collection of development boards, evaluation kits and my own products and prototypes.


Besides what I do as an independent consultant and developing and selling my own stuff, I'm also Principal Engineer with Serious Integraged, Inc., in Chandler, AZ, where we are developing very cool graphic displays modules that let OEM equipment manufacturers add rich Graphic User Interfaces or Home Machine Interfaces to their products.


And soon we'll add a lot of connectivity features for the "Internet of Things."



So now that I was able to write this article, I'll get a URL shortener and print it on my business cards, so next time I get the question ... voilĂ 




Cheers
Jorge