Robostix i2c test
From GumstixDocsWiki
This page describes some techniques to test the i2c link between the gumstix and the robostix.
Build i2c-test.hex
The first step is to build the i2c-test.hex file. You can find the source code and Makefile in the robostix/i2c-test directory. Here's a precompiled version of i2c-test.hex.
Program the i2c-test.hex into the robostix and use the standalone fuse settings (see pgm-fuse-standalone in the robostix directory).
Build the gumstix i2c-test program
Next build the i2c-test program that runs on the gumstix. Here's a precompiled version of i2c-test. It was built using buildroot 1093, but should work on all of the kernel versions from 2.6.15 thru the current one (which was 2.6.18 when this page was written).
Running the i2c-test program
Make sure that the power adpater is plugged into the robostix (powering through any other power adapter will not properly power the robostix).
You should first make sure that the i2c-dev, i2c-pxa, and i2c-core modules are NOT loaded. Using
modprobe -r i2c-dev modprobe -r i2c-pxa
should remove these modules. Double check using the lsmod command.
With the i2c-test.hex program loaded onto the robostix and with the programming jumpers still in place (so that ttyS2 from the gumstix is connected to UART-0 on the robostix), run the i2c-test program on the gumstix.
You should see:
gumstix: SCL: 1 SDA: 1
Pressing the spacebar will cause the gumstix and robostix to each print out what they're seeing on the i2c-bus. In a normal idle bus, you should see:
gumstix: SCL: 1 SDA: 1 robostix: SCLw: 1 SCLr: 1 SDAw: 1 SDAr: 1 DDRD: 0 PIND: 3
The SCL and SDA values on the gumstix: line are the values that the gusmtix is seeing on those two lines. The gumstix doesn't give us a way to drive those lines independantly, so we just monitor things from the gumstix side.
On the robostix line, the SCLw: Z means that the robostix has tri-stated the SCL line, and it should be pulled high by the pullup resistors. SCLw: 1 means that the robostix is driving the line high, and SCLw: 0 means that the robostix is driving the line low. The SCLr: shows what the robostix is reading on the SCL line. The SDA values are similar.
Pressing the 'c' key will cause the robostix to cycle through the written values on the SCL line. Pressing the 'd' key will cause the robostix to cycle through the values written on the SDA line.
With the i2c driver not loaded and nothing else on the i2c bus, the gumtix SCL and robostix SCLr should track the SCLw value. Similarly for the SDA values. If these don't track, then there is some type of problem with the SDA and SCL line connecting between the gumstix and robostix.

