This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to read a register using TWI (nrf_drv_twi_rx)

Dear sir/madame

 In our project we want to implement MAX17260 battery fuel gauge to monitor the battery status in the handheld device.

The interface towards MAX17260 is I2C (TWI). I am trying to use nrf_drv_twi_tx and nrf_drv_twi_rx to set and read registers in MAX17260.

According to the MAX1726X SOFTWARE IMPLEMENTATION GUIDE’ I need to config the MAX17260 at start-up (Power On) and the one of the first steps is to read the status register.

So to my question: how do I point to the register I want to read using ‘nrf_drv_twi_rx’ ?

 

Kind regards

Svein

Parents
  • Different TWI slaves have different reading specs. For some of them, you can start reading when the TWI slave device internal reading pointer is pointing to some address (normally 0 at startup) and in some slaves, you need to explicitly set  the internal reading pointer register by writing to that register so that the next reads are read from a specific address. I have not read the MAX17260 spec but a lot of users here have used the MAXIM related sensors and accessed it using TWI. One of them you can find here

Reply
  • Different TWI slaves have different reading specs. For some of them, you can start reading when the TWI slave device internal reading pointer is pointing to some address (normally 0 at startup) and in some slaves, you need to explicitly set  the internal reading pointer register by writing to that register so that the next reads are read from a specific address. I have not read the MAX17260 spec but a lot of users here have used the MAXIM related sensors and accessed it using TWI. One of them you can find here

Children
No Data
Related