This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

AT24C512 + BMI160 + NRF52

Hi,

I am using nRF52832 soc to develop my project. with nRF5_SDK_15.3 . SES file

I need to connect both BMI160 accelerometer sensor and AT24C512 EEPROM ic in TWI.

how to use TWI with this. guide me to use both at a time.

BMI160 separately i can read the data.

but i can't read while connect to AT24C512

Parents Reply Children
  • The application communicates over the two-wire interface (TWI) with two devices: the MMA7660 triple axis accelerometer and the LM75B temperature sensor.

    The example uses the RTC peripheral to generate regular tick events (32 per second). The interrupt handler, executed in reaction to each tick event, schedules data transfers to read the current values from the devices. The obtained values are averaged and printed every 500 milliseconds or when the tilting status reported by the accelerometer changes. Additionally, the user can generate asynchronous data transfer requests (reading all registers available in the devices) by pressing Button 1 or Button 4. Such additional transfer requests show that the TWI transaction manager library can schedule transfer requests from different contexts and realize them in the order they were scheduled.

  • the TWI transaction manager library can schedule transfer requests from different contexts and realize them in the order they were scheduled

    obviously, that adds a layer of complexity.

    The alternative is that you have to manage the bus accesses yourself in your own code so that the 2 sensors do not interfere with each other.

    If you have a simple use case, with only the 2 sensors, it may not be (too) difficult to manage this "manually"...

    But only you know the details of your application - so only you can decide what's appropriate to it.

Related