Welcome, Guest

Author Topic: i2c Address Mappings for MOD-IO and other UEXT Boards?  (Read 3272 times)

pcor

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
i2c Address Mappings for MOD-IO and other UEXT Boards?
« on: December 08, 2012, 03:02:27 PM »
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

  • Newbie
  • *
  • Posts: 7
  • Karma: +0/-0
Basic i2c address search ... was Re: i2c Address Mappings for MOD-IO?
« Reply #1 on: December 09, 2012, 12:08:16 PM »
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

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1752
  • Karma: +46/-2
Re: i2c Address Mappings for MOD-IO and other UEXT Boards?
« Reply #2 on: December 11, 2012, 03:49:52 PM »
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