Overo + Controller Area Network
I’ve had a long interest in using Controller Area Network (CAN) to communicate between different components such as sensors or GPS modules or motor controllers. I wasn’t sure if I could do this with the Gumstix Overo board, but I got excited when I found out that Linux kernel version 2.6.33 would be including a driver for the Microchip MCP2515 CAN chip.
This required creating a custom image for the Overo, which meant setting up a build with OpenEmbedded. The Gumstix guys made it sound pretty easy in their instructions, so I set off to make it happen. I started with a virtual machine with Ubuntu 9.10 and set up bitbake and OpenEmbedded as suggested.
I’ve uploaded a tarball of my user.collection directory with overrides for the Overo machine configuration (you could probably ignore that) and for the Linux 2.6.33 recipe to include my configuration and patches to the Overo’s board initialization code for the MCP2515 chip on SPI bus 1 chip select 0.
My working environment for the org.openembedded.dev component uses change d535da0dfe20e965adb49d3acf720e7f9feb58c6. I’m sure by the time you try this there will be newer versions, but I can’t say whether my patches will work or not.
As for the hardware, the Overo uses 1.8v internally but the MCP2515 uses 5v. I used a few SparkFun logic level converter boards to translate voltages. Despite what you might read on their website, DO NOT USE the RX channels as this will send 2.5v into the 1.8v-capable pins on the Overo! Only use the TX channels (they are bidirectional and work at the correct voltage). I needed to translate five pins (SCLK, MISO, MISO, CS, and an interrupt pin) so I used three of the SparkFun boards.
I was able to use the candump program from the socket-can test tools suite to verify correct operation. Awesome!