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

Problem when integrated SAADC and SPI

Hi all, 

I am trying to interface HI-3585 with nrf52832 through SPI which works fine. Now i have merged the code with saadc program so as to transmit adc values through HI-3585 (SPI) .here is the data sheet Hi-3585 data sheet. I am trying this in debug mode, the problem here is when i try to perform a read/write operation, it is not happening on one go rather takes multiple executions. I am using SDK_11 , keil v5 and nrf52832 DK.

Please do help me on the same.

Here is my project file   SAADC_SPI

Thank in advance..

Parents
  • First you need to use a newer SDK, either 14.2 or 15.2. They include workarounds for Erratas and other issues, as well as being way more mature. 

    Second, " the problem here is when i try to perform a read/write operation, it is not happening on one go rather takes multiple executions.", we need more information. What exactly are you trying to do, what do expect to happen, and what actually happens? 


  • Thanks for suggesting higher SDK version, and it worked out as expected.

    Now the issue here is SPI codes runs first and then comes the SAADC. Here we need it to work the other way where SAADC has to happen first and then SPI. I also tried changing the interrupt priority levels, but was not useful.

    Alternately i tried switching the sequence of function call in the main, but nothing worked. Is there any work around to address this issue?

    Thanks in advance,

Reply
  • Thanks for suggesting higher SDK version, and it worked out as expected.

    Now the issue here is SPI codes runs first and then comes the SAADC. Here we need it to work the other way where SAADC has to happen first and then SPI. I also tried changing the interrupt priority levels, but was not useful.

    Alternately i tried switching the sequence of function call in the main, but nothing worked. Is there any work around to address this issue?

    Thanks in advance,

Children
Related