Working with iMX233-OLinuXino and MOD-IO2
To may they all work together without collisions I2C protocol is used to address them.
The protocol is like this:
Set-relay command is 0×40, Set-new-address command is 0xB0, read AIN0 is 0×10 read AIN7 is 0×17 and so on.
if we use I2CTOOL we can talk easily to MOD-IO2 connected to iMX233-OLinuXino, for instance to switch both relays ON we can do:
$ ./i2c-tool -w 0 0×48 4 0×02 0xA0 0×40 0×03
where -w means I2C write, 0 – this is I2C channel we write to channel 0, 0×48 is OLIMEX I2C address, 4 is number of bytes to follow, 0×02 is MOD-IO2 ID, 0xA0 is default MOD-IO2 address, 0×40 is set-relay command, 0×03 is set both relays
Comments