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

serial interface

Hi,

I just started working with Nordic nRF52840 serial interfaces,can you please tell me which one is best for serial communication among SPI and I2c and why?And can you please tell me the regarding hardware connections.

Thanks&Regards,

Lakshmi

Vadict Innovations.

  • Hi Lakshmi,

    which one is best for serial communication among SPI and I2c

    Often the interface is dictated by what the other components support. However, if you can choose, SPI is usually preferable. This is mainly because SPI has a much higher speed, meaning that the transactions take a shorter time, allowing the nRF to go back to sleep more quickly, thereby saving power.

    And can you please tell me the regarding hardware connections.

    Any GPIO on the nRF can have any digital functionality (though you should avoid pins close to the radio, as described under Pin assignments). There is no difference between which pins can be used for SPI and TWI (I2C).

    Einar

  • Can you please suggest me.  According to my knowledge SPI can not verify the bits whether it is properly sending or not(like ack),speed wise is SPI ok,And in nordic nRF52840 have 4xmasters and 3xslaves =12 we can connect.in i2c i read total 127 slaves we can connect.then i2c is best may be...please correct me if i assumes wrong.

  • Hi,

    lakshmi123 said:
    According to my knowledge SPI can not verify the bits whether it is properly sending or not(like ack),speed wise is SPI ok,

    You are right that SPI does not implement acknowledgment.

    lakshmi123 said:
    And in nordic nRF52840 have 4xmasters and 3xslaves =12 we can connect.

    I don't follow your logic. SPI has a concept of chip select, where only the selected slave is active, others are high impedance. So you can use more than one slaves on one bus if needed.

    lakshmi123 said:
    in i2c i read total 127 slaves we can connect.then i2c is best may be...please correct me if i assumes wrong.

    You are right that you theoretically can have 127 slaves on a TWI bus, but that does not seem like a very realistic number for most products. 

    If you need to connect a very high number of slave devices with no additional HW, then I2C may be more sensible. But that would be an unusual use case. In any case, you should choose whatever works for your product, just be aware of the differences.

Related