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

Bit dazzed on how to stop SPI module in the middle of transaction

Hi,

Good Day!

Statement of Problem: We are using SPI to transfer data to custom LED matrix which uses HT1632C led driver. For strings more than 7 character length we used scroll effect to display the message (frames are moved from right to left at 180mSec). The problem is if user chooses to read the device status when a long message is being displayed on the screen, then user request is not displayed on the screen. 

Query: Is it possible to stop the SPI transaction  in the middle(especially for this long messages)? so that a new interrupt can be processed. If it possible, how it can be done? 

FI, app_timer is used in the application for scroll effect. Let me know if further information is needed

Thank you,

Aim High.

Parents
  • Hi,

    Query: Is it possible to stop the SPI transaction  in the middle(especially for this long messages)? so that a new interrupt can be processed. If it possible, how it can be done? 

    Yes, it is possible to abort a transfer. If you use the driver, you can use nrf_drv_spi_abort(). Please note that you should not have any problems handling interrupts in between anyway if you use the SPIM peripheral, since that use DMA for transferring data and only needs the CPU for setting up transfers. So the CPU will be free to do other work while the transaction is ongoing.

Reply
  • Hi,

    Query: Is it possible to stop the SPI transaction  in the middle(especially for this long messages)? so that a new interrupt can be processed. If it possible, how it can be done? 

    Yes, it is possible to abort a transfer. If you use the driver, you can use nrf_drv_spi_abort(). Please note that you should not have any problems handling interrupts in between anyway if you use the SPIM peripheral, since that use DMA for transferring data and only needs the CPU for setting up transfers. So the CPU will be free to do other work while the transaction is ongoing.

Children
No Data
Related