Serial I2C bridge for AVRcam / Autonomous Vehicle
I'm finishing up my entry for the 2012 Sparkfun Autonomous Vehicle Competition, "Data Bus" ... the competition is Saturday 6/16.
The race requires fully autonomous vehicles driving around the SFE building in Boulder. And dodging giant 55 gallon red barrels. I'd hoped I could use an AVRcam to identify the barrels. Being out of Serial ports, I settled on using a Propeller to control the camera, read tracking data, and make it available via I2C to the main microcontroller, an mbed. I etched my own board for a QFP Prop. It features an FTDI programming port, camera serial port, I2C port, and a serial diagnostic port.
I fixed a bug in the i2cslave_info.spin code from here: http://forums.parallax.com/archive/index.php/t-102839.html -- it had a bug where it was setting DIRA to 0 instead of just the I2C pin. Also using a slightly tweaked FullDuplexSerial to which I've added print() type statements for convenience.
The code is really simplistic. It sends some control strings, waits for "ACK" or "NACK" or timeout from the camera. Once it's sent the colormap and enabled tracking, it just assumes everything will work forever. Future revision would have a timeout during data capture where it'd restart the camera if connection is lost. The dual-color red/green LED indicates status.
A few more details and links to the code on my blog entry: http://www.bot-thoughts.com/2012/06/avc-test-runs-propeller-serial-to-i2c.html
The race requires fully autonomous vehicles driving around the SFE building in Boulder. And dodging giant 55 gallon red barrels. I'd hoped I could use an AVRcam to identify the barrels. Being out of Serial ports, I settled on using a Propeller to control the camera, read tracking data, and make it available via I2C to the main microcontroller, an mbed. I etched my own board for a QFP Prop. It features an FTDI programming port, camera serial port, I2C port, and a serial diagnostic port.
I fixed a bug in the i2cslave_info.spin code from here: http://forums.parallax.com/archive/index.php/t-102839.html -- it had a bug where it was setting DIRA to 0 instead of just the I2C pin. Also using a slightly tweaked FullDuplexSerial to which I've added print() type statements for convenience.
The code is really simplistic. It sends some control strings, waits for "ACK" or "NACK" or timeout from the camera. Once it's sent the colormap and enabled tracking, it just assumes everything will work forever. Future revision would have a timeout during data capture where it'd restart the camera if connection is lost. The dual-color red/green LED indicates status.
A few more details and links to the code on my blog entry: http://www.bot-thoughts.com/2012/06/avc-test-runs-propeller-serial-to-i2c.html