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

Not able to understand the TWI and SPI Instance problem.

Hi Everyone

I am trying to use BME which is an i2c/twi sensor and EPaper which is an SPI based module. In my code i am using TWI INSTANCE ID 0 AND SPI INSTANCE ID 0.

I came across a question which says that spi and twi can not share the same instances reason being that they share the same resources.

I have a custom PCB , which uses nrf52840. 

Whenever i run BME ,the epaper stops working. This might be because of the scenario in above discussion.

Can it be solved by changing either of instance of TWI OR SPI Instance? 

If yes ,then how?

And do i need to change the pin configuration also if i change the Instance ID of either of the module.

Thanks 

Rajat!

Parents
  • Just change TWI0 to TWI1 or SPI0 to SPI1 and you should be fine.

    Pin configuration doesn't need to be changed, but you of course need to configure the new instance instead of the old. If you're using Nordic libraries I believe this is handled by the libraries.

    The relevant section in the product specification is called "Peripheral interface". That describes what instances share resources.

  • Thanks mrono!

    I tried that out and it worked. I disabled other SPI Instances and also TWI Instances and changed the TWI Instance from 0 to 1 and kept the SPI Instance as 0.

    If someone else faces this  issue. Go to SDK_CONFIG.h file and disable all other instances except which you are using and SPI instance and TWI Instance should not be same.

    Thanks

    Rajat!

Reply
  • Thanks mrono!

    I tried that out and it worked. I disabled other SPI Instances and also TWI Instances and changed the TWI Instance from 0 to 1 and kept the SPI Instance as 0.

    If someone else faces this  issue. Go to SDK_CONFIG.h file and disable all other instances except which you are using and SPI instance and TWI Instance should not be same.

    Thanks

    Rajat!

Children
No Data
Related