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

Can we change the SPI.bitOrder and SPI.dataMode while using nRF8001 BLE

Hi

I have a BLE module of nRF8001 chip and everything is working fine with it.In your Arduino compatible libraries for nRF 8001 you have a function hal_aci_tl_init() in which you set SPI for the chip. There you set SPI.setBitOrder(LSBFIRST) , SPI.setDataMode(SPI_MODE0) and clock speed.Now my question is can i change the bitOrder to MSBFIRST and DataMode to SPI_MODE1?

Actually i tried to do this this but BLE is not advertising then. How can i do this ,is there any way to use nRF8001 in MSBFIRST and SPI_MODE1?? I really need to do this because i am connecting a wifi shield also to my Arduino which again uses SPI pins for data transfer and that wifi shied works only on MSBFIRST and SPI_MODE1. How can i make nRF 8001 work on above specifications?

Thanks

Parents
  • nRF8001 will not operate on MSBIT first or at SPI mode 1, hower You should be able to share the SPI lines. in your case, you will need to set the SPI parameters for the WiFi when you want talk the to the WiFi SPI, when you want to talk to nRF8001 set the SPI parameters for nRF8001.

    You will have to use separate chip select lines and separate interrupt lines for the WiFi and the nRF8001. Only the MISO MOSI and SCK can be shared.

    As soon as you get a RDYN line low, set the nRF8001 SPI parameters for LSBIT and SPI MODE0 before you start the SPI. As soon as the nRF8001 SPI is finished you can set it back to the WiFi SPI settings of MSBIT and SPI MODE1

  • You may need to put an SPI.begin at the start of the SPI transaction and SPI.end in the end of the SPI transaction both for the nRF8001 and for the WiFi, you may also need to work with the WiFi library and documentation. We have verified that the nRF8001 can share the SPI with other devices but not with a WiFi device.

    The key point is that the WiFi should release the SPI lines when the chip select for the WiFi SPI is released. You need to verify this in a logic analyzaer.

Reply
  • You may need to put an SPI.begin at the start of the SPI transaction and SPI.end in the end of the SPI transaction both for the nRF8001 and for the WiFi, you may also need to work with the WiFi library and documentation. We have verified that the nRF8001 can share the SPI with other devices but not with a WiFi device.

    The key point is that the WiFi should release the SPI lines when the chip select for the WiFi SPI is released. You need to verify this in a logic analyzaer.

Children
No Data
Related