Reading from specific I2C address and register

Hi All,

I’m new to using Arduino and XOD. What I need to be able to do is read specific registers from a number of I2C device addresses connected to my Arduino module, so read by Address > Register. So for example, at address 0x51, read register 0x11. I can’t for the life of me work out how to do this, which I assume is quite straight forward.

Any help would be much appreciated.

Kind regards,

If it helps, then the devices I’m trying to read/write to addresses and registers on are 2 x Purifi 1ET400a modules on the one I2C bus, each with its own address:

Thinking through this some more, I’m wondering - seeing as XOD seems only to allow input of whole bytes - if it is a matter of inputting into the ‘begin-transmission’ block the target address hex value for the complete byte consisting of address and the r/w bit. The chain would go like this:
‘begin-transmission’ with address byte compiled using target address and write bit >
‘write-byte’ consisting of register >
‘write byte’ with address byte compiled using target address and read bit >
‘read byte’
‘end-transmission’ block

First of all, is this likely to work or is XOD automatically adding the r/w bit? Secondly, is XOD including the code the ack and nack bits automatically? All of this seems a little opaque.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.