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

NRF52832 use

Dear

i want to nrf52832 to collect accelaration sensor data(SPI communication 8MHZ). The sensor output datas per 250us,nrf52832 will lost the sensor interupt when 52832 connected with phone and connecting interval is per 20ms ? Or Lost connect?

  • Yes, you can have problems with concurrency of any peripheral such as SPI and BLE functionality! The only solution is to use EasyDMA enabled peripheral (and driver) and also making sure that your DMA transfer is longer then time which BLE stack needs to serve radio events. With 8MHz and only 255B buffers on DMA served SPIx peripheral on nRF52832 you will still have problems to achieve that and your hope might be only to utilize "array list" feature. Read about it in nRF52832 specification on Infocenter, search for SPI and array list Questions on this forum and look for examples in nRF5 SDK.

    But if your sensor only works in 250us "bursts" and cannot work with continuous SPI transfer (using array list on nRF52 side to have it longer then 255B and achieving some reasonable times for MCU to handle BLE stack operations) then you are pretty much doomed.

  • Hi

    How many bytes do you need to read from the sensor on every 250us interrupt?

    Best regards

  • thanks for response!how long deal with radio event per onnected event?

  • Hi

    If you are in a BLE stack interrupt while the sensor interrupt occurs, the sensor interrupt will be delayed. The BLE stack will not be affected, as the highest interrupt priority is dedicated to the BLE stack only, and can not be used by the application.

    If the sensor interrupt is signaled by an external pin you can connect this to the GPIOTE module in the nRF52832, and have the GPIOTE module trigger an SPI transaction through the PPI. This means that the SPI can be activated immediately, without having to wait for the interrupt handler to run.
    If you use the array_list feature you can even have multiple SPI transactions started without having to run any code in the interrupt, but the BLE interrupts should typically be shorter than 250us so I don't think this will be necessary.

    Best regards
    Torbjørn

Related