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

Problem in sequential execution of SAADC and SPI.

Hello All,

I am trying to interface an analog sensor with nrf52832, whose analog values have to be converted using SAADC and has to be sent over SPI to another chip. But, Nordic is not allowing me to access the SAADC functionality before SPI rather the SPI takes priority and runs before SAADC. I tried to change the sequence by changing the priority in configuration file nothing seems to work. I also referred the following Link, but was not helpful. Kindly suggest as with some alternatives.

Thanks in advance!

Parents Reply Children
  • "But, Nordic is not allowing me to access the SAADC functionality before SPI rather the SPI takes priority and runs before SAADC."

    -We need specifics because we have no idea what you're doing or what you want to do.

    "I tried to change the sequence by changing the priority in configuration file nothing seems to work."

    -Modifying the interrupt priority is probably not what you need to do to achieve your goal. 

    The only difference that you need to do to the application in this Link is to add the write FIFO opcode of 0x0E to the SPIM buffer.
    Since this opcode is static after you've configured the device you can just declare a buffer with the opcode (0x0E) as the first element and have the SAADC buffer point to the second element of the SPIM buffer. 

Related