Questions about NCS hardware interrupt time and SPI

The question is as follows:

When I read the ADS1299 data through SPI in the GPIOTE interrupt, I found that there was a time limit. Within about 50us. As shown in the figure below, the DRDY channel is the interrupt pin, and the program is the detection falling edge. In fact, the SPIM does read data at the beginning of the falling edge. My program is set to read 108 bytes, but it will only read 68 bytes. When I adjust the SCK clock of the SPI, I find that the number of bytes decreases. I guess there is a time limit for GPIOTE interrupt, and I don't know how to modify it in config. Because this is a smart bracelet project, reading EMG data is a very important task, I can not put it in the work queue, I must ensure my accurate sampling rate. I beg you to help me solve this problem。

Second question, using SPIM in NCS will turn on EASYDMA by default, so will executing spim to read data in interrupt take up MCU resources?
The third question, if the execution of spim will occupy MCU resources, is it possible to enable PPI + GPIOTE + SPIM to avoid the problem of time limit in interruptions? If I can, I just have to build this way, will read the data placed with RAM, is not able to completely avoid MCU resources. That way I can add other items like LCD and data algorithms

  • Hi,

     

    Do you have any log output or similar that shows the problem?

    Any code to reproduce this issue?

    What is the state of your firmware after this 68 bytes are read?

     

    Second question, using SPIM in NCS will turn on EASYDMA by default, so will executing spim to read data in interrupt take up MCU resources?

    It will read/write according to the supplied buffers, and provide an event back when it is done. If it is setup in a synchronous way, it will go to idle and wait for the event to come back.

     

    The third question, if the execution of spim will occupy MCU resources, is it possible to enable PPI + GPIOTE + SPIM to avoid the problem of time limit in interruptions? If I can, I just have to build this way, will read the data placed with RAM, is not able to completely avoid MCU resources. That way I can add other items like LCD and data algorithms

    Yes, but this will require the use of the nrfx_spim driver directly. I would recommend that we look into the initial issue first before considering this option.

     

    Kind regards,

    Håkon

Related