Wednesday, November 28, 2012

3-3. Basic Programming of the Android Controller/Camera Part II

I haven't made great progress the last few weeks (quite a lot of activity and work and preparing for a Thanksgiving trip), but I'm on vacation now visiting Cleveland and Pittsburgh and thought I'd take some time to catch up the blog on my Android activities.  After settling on the Freescale i.MX53 as my first prototype's brain, I've been working on setting it up with Android and getting some raw image data from a camera attached to it. 

The i.MX53 comes with a Linux OS on a micro SD card (there is no hard drive on the board), but I had determined to try out Android, so I downloaded a port of Android made for the i.MX53 by Adeneo.  I initially tried to repurpose the Linux OS that came with the i.MX53 to store the Android prebuilt image provided by Adeneo, but I had some difficulty getting the card to be recognized properly.  The script for setting up the Android on a microSD is a Linux script, so I had to setup up a Linux VM on my Win7 laptop in order to get it to run.  After a bit of fun mounting the SD reader on my laptop, I was able to finally load the image onto a new micro SD card.

The i.MX53 has a lot of interfaces for various devices, so its a bit of a learning curve to figure out which plug is used for what.  In order to get android displayed on a VGA monitor, you need to first connect to it's DB9 port using a serial-USB cable and a serial connection program like Putty (choose serial connection with the following parameter: 115200bps, 8n1, no flow control). After figuring this out, I was able to bring up the U-boot command prompt for Android, and update the display to VGA.
U-Boot> setenv set_display run vga
U-Boot> save
I restarted and was able to now connect a regular monitor to the VGA port of the board and get Android displayed on my monitor.  

The first thing I tried was to connect a mouse and keyboard to the i.MX53.  I quickly discovered that without additional handshaking/configuration, the top USB port is the only one that consistently works.  I got a spare USB hub I had in storage and was able to successfully connect multiple USB devices (mouse, keyboard, camera). Immediately, I tried connecting a custom one-off micro USB camera I had got from an security imaging company on the west coast.  Basically, this camera adds a USB interface to the OV3640 camera by Omnivision.



 It was expensive and for production I think I'll be forced to use a PCB, but I still wanted to see how small of a footprint the camera/brains combo could be. Unfortunately, I had some fun getting the camera working out of the box, so I was forced to use a Microsoft LifeCam instead. I started the default camera application and was able it working.  Next up: Loading a custom camera app for getting raw camera data.