i2c Address Mappings for MOD-IO and other UEXT Boards?

Started by pcor, December 08, 2012, 03:02:27 PM

Previous topic - Next topic

pcor

Does anyone have a table mapping i2c addresses to the various I/O on the MOD-IO board? Even better, if someone has a BASIC file with all these defined it would be totally awesome!
I know I can probably find all this out from the C source code, but that just seems too painful at the moment ...

pcor

Here is a short search routine I built to check for the i2c address of an attached module.
Basically it iterates through the possible addresses and writes out any addresses that generate a correct ACK ... incidently, the default address on my MOD-IO board is $54 and NOT $58 as stated in the readme & docs ...

15 PRINT "pre-loop initialization completed ..."
16 DO
17 i2caddr = i2caddr + 1
20 I2CSEND i2caddr,0,2,&h10,&h05
25 IF MM.I2C=0 THEN PRINT "found address:", HEX$(i2caddr)
30 PAUSE 10
40 I2CSEND i2caddr,0,2,&h10,&h0a
42 IF MM.I2C=0 THEN PRINT "confirmed address (hex):", HEX$(i2caddr)
44 ' PRINT "next try", "i2caddr"
50 LOOP UNTIL i2caddr > 118
60 PRINT "test completed ..."
70 I2CDIS
72 PRINT MM.I2C
80 END

LubOlimex

Hello pcor,

I believe there should be some reasonable explanation for the address being 5 4. I just double checked the source code and it is defined as 5 8. We have also been using the MOD-IO for examples lately and it responded to 5 8. Anyway, glad you managed to find the correct algorithm for identifying the I2C address and get the things going.

Best regards,
Lub/OLIMEX
Technical support and documentation manager at Olimex