Shop OBEX P1 Docs P2 Docs Learn Events
Serial I2C bridge for AVRcam / Autonomous Vehicle — Parallax Forums

Serial I2C bridge for AVRcam / Autonomous Vehicle

shimniokshimniok Posts: 177
edited 2012-06-14 07:53 in Robotics
I'm finishing up my entry for the 2012 Sparkfun Autonomous Vehicle Competition, "Data Bus" ... the competition is Saturday 6/16.

Photo+Jun+09%252C+1+09+40+PM.jpg

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.

Photo+Jun+13%252C+10+28+51+AM.jpgPhoto+Jun+13%252C+10+28+40+AM.jpg

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
Sign In or Register to comment.