Data output problems
JWoolston
Posts: 4
I have a board with a number of I2C devices on two seperate busses. To test the communication, I have LEDs that can blink code the data out, one that signals data valid, the other that signals the data bit. I am testing it on the demo board with the boot eeprom using a stripped down version of i2cdemoApp from the object exchange. To compare, I am using its serial output through the terminal in the basic stamp environment. The problem is the binary numbers blinked out by the leds dont match the binary numbers on the terminal, and I cant understand why? I have included the code for the eeprom demo method, the only one i modified. I did make sure that the led output pins are set as outputs. Could someone shed some light?
·Thanks,
Jared
·
PRI EEPROM_Demo | eepromData, eepromLocation, ackbit, i ' demo the i2c Serial EEPROM (Microchip's 24LC512 (64kb)) debug.strln(string("EEPROM DEMO")) ' ***** EEPROM read/Write example ***** eepromLocation := EEPROM_Base eepromData := 0 repeat 10 '' write long 'eepromData += 100 'i2cObject.WriteLong(i2cSCL, EEPROMAddr, eepromLocation, eepromData) ' read long eepromData :=0 eepromData := i2cObject.ReadLong(i2cSCL, EEPROMAddr, eepromLocation) ' debug debug.str(string("Read Location=")) debug.decx(eepromLocation,5) debug.str(string(", data=")) debug.bin(eepromData,32) debug.putc(13) repeat i from 0 to 31 outa[noparse][[/noparse]22] := 1 outa[noparse][[/noparse]16] := eepromData[noparse][[/noparse]31-i] waitcnt(clkfreq + cnt) outa[noparse][[/noparse]22] := 0 outa[noparse][[/noparse]16] := 0 waitcnt(clkfreq/2 + cnt) ' next eepromLocation +=4 ' slowit waitcnt(clkfreq + cnt) ' done debug.strln(string("EEPROM demo done."))
·Thanks,
Jared
·
Comments
Jared