Writing Driver for SSP

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Writing Driver for SSP

395 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Sal Ammoniac on Tue Nov 25 09:20:42 MST 2014
I'm writing a driver for the LPC4300 SSP0/1 and noticed that the transmit and receive interrupts are only triggered when the eight frame transmit and receive FIFOs are at least half full (RX) and half empty (TX), or when an RX timeout occurs (32 bits at the current SSP clock rate).

This makes it difficult to handle small (<4) frame transfers without either polling for completion or waiting for the RX timeout period to elapse. Anyone have any ideas for dealing with this? I have a few SPI peripherals that transfer small amounts of data (less than half a FIFO's worth), but I don't want to stall the CPU polling for completion or the application by waiting for an RX timeout interrupt.

It seems to me that the designer of the 43xx series SSP peripheral could have easily made the RX and TX interrupt trigger points configurable and not just hard coded to happen when the FIFOs are half full/empty. There are plenty of unused bits in the SSP interrupt mask register, and the additional logic would not have amounted to more than a few gates. This kind of thing makes writing drivers for these chips a pain in the bum.
Labels (1)
0 Kudos
Reply
2 Replies

342 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Sal Ammoniac on Mon Dec 01 12:58:54 MST 2014
DMA seems like overkill for my application, but I may need to resort to using it with the SSP peripheral due to the way the FIFO status flags are implemented.  :((
0 Kudos
Reply

342 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by wmues on Tue Nov 25 09:35:47 MST 2014
You might use the GPDMA unit and get your interrupt from the DMA controller after the requested amount of bytes is received.
0 Kudos
Reply