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
  • Hi, 

    I recommend reading the TWIM chapter and the TWIS chapter in the product specification for nRF52832.

    The master device (TWIM) is in your case the nRF58832, while sensor and EEPROM are slaves. 

    If your nRF52832 will work as a slave (TWIS), then you need another microcontroller functioning as a master.

    You will find a suitable example to communicate with two devices in the TWI Transaction Manager Example which I linked to yesterday.

    Kind regards,
    Øyvind

  • I recommend reading the TWIM chapter and the TWIS chapter in the product specification for nRF52832

    +1

    But could you clarify the distinction between those and the "TWI — I2C compatible two-wire interface" - also in the product specification for nRF52832?

    I find it unclear whether it is a separate module, or if TWIM and/or TWIS are just "operating modes" of the TWI module?

    Or TWI is an "operating mode" of the TWIM module?

    Or what??

    The block diagram is not helpful as it shows no "TWI" module.

    EDIT

    and are there two TWIS modules plus two TWIM modules - or is it just a total of two modules, each of which can be either TWIM or TWIS ?

    EDIT 2

    The block diagram clearly suggests that there two TWIS modules plus two TWIM modules:

    but the 'Key Features' at the start of the Product Specification says:

    • Up to 2x I2C compatible 2-wire master/slave

    So it looks like the block diagram is misleading?

  • Hi,

    can i use

    #define TWI0_ENABLED 1
    #define TWI1_ENABLED 1

    i.e
    two TWI Instance. one for EEPROM and another for SENSOR.
    it means is it TWIM or TWIS ?

    is it advisable to go with two twi instance at a time
  • My mouse pointer is all over the place today, did mean to suggest this as the answer for this case. 

    awneil said:
    I find it unclear whether it is a separate module, or if TWIM and/or TWIS are just "operating modes" of the TWI module?

    @awneil, I agree. This is very confusing, even for me. But the easy explanation is:

    • TWI is legacy driver for nRF51
    • TWIM and TWIS are new for nRF52 which also uses EasyDMA

    There is no connection between TWI and TWIM/TWIS.

    awneil said:
    and are there two TWIS modules plus two TWIM modules - or is it just a total of two modules, each of which can be either TWIM or TWIS ?

     Have a look at the memory Instantiation, as long as they do not collide. I.e. Address 0x40003000 is shared between SPIM, SPIS, SPI, TWIM, TWIS and TWI. Only one can be instance can be used at one memory location. Address 0x40003000 has the same. So you can have an instance of TWIM in each, but then you have filled max instances.

    I hope this helps to clarify Slight smile

Reply
  • My mouse pointer is all over the place today, did mean to suggest this as the answer for this case. 

    awneil said:
    I find it unclear whether it is a separate module, or if TWIM and/or TWIS are just "operating modes" of the TWI module?

    @awneil, I agree. This is very confusing, even for me. But the easy explanation is:

    • TWI is legacy driver for nRF51
    • TWIM and TWIS are new for nRF52 which also uses EasyDMA

    There is no connection between TWI and TWIM/TWIS.

    awneil said:
    and are there two TWIS modules plus two TWIM modules - or is it just a total of two modules, each of which can be either TWIM or TWIS ?

     Have a look at the memory Instantiation, as long as they do not collide. I.e. Address 0x40003000 is shared between SPIM, SPIS, SPI, TWIM, TWIS and TWI. Only one can be instance can be used at one memory location. Address 0x40003000 has the same. So you can have an instance of TWIM in each, but then you have filled max instances.

    I hope this helps to clarify Slight smile

Children
Related