Skip to end of banner
Go to start of banner

How to use SPI and Interrupts on a serial DPM (sDPM)

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

SPI does not offer generic interrupt support. This is usually done via a separate interrupt inputs and must be synchronized with the handled in the SPI controller.
The cifx/netX Toolkit does not know the SPI controller and the interrupt handling in the used operating system.

On the other hand, there is a need to lock send and receive functions calls, from the toolkit to the SPI controller, against each other to make them undisruptable.
Because SPI transfers and the netX sDPM (serial DPM) protocoll does not allow nested transfer calls.

Locking of SPI read / write functions (located in the in SerialDPMInterface.c module) is handled by the OS_SpiLock() function (implemented in OS_SPICustom.c).

For the netX interrupt state handling, the cifX/netX Toolkit offers a interrupt service handler function cifXTKitISRHandler() (located in cifXInterrupt.c).
But this function also needs to use the SPI read and write functions to access the sDPM, which ends up in a deadlock situation.
A running SPI transfer should not be disrupted and a physical ISR function should never block inside the ISR.

This deadlock situation can be solved by moving the toolkit ISR/DSR functions into an application thread which is trigegred by interrupt event generated from the physical interrupt service of the
the operating system.


(warning) SPI and interrupt handling are also described in the cifX/netX Toolkit manual Version 12 / Chapter 3





  • No labels