Can somebody please explain what the ISR of a DMA-enabled SSPx peripheral needs to do? I've read the user manual of the LPC24xx but I still don't fully understand how the ISR of the DMA (indicating end of transfer) relates to the ISR of SSPx - without DMA the incoming data is collected, but with DMA enabled the data should be handled by the DMA...?
When running without DMA, you collect received data from the incomming FIFO and fills the outgoing FIFO with new data.
With DMA, you "reload" the DMA by chaining in new buffers. Each DMA transfer can only span a limited amount of RAM, so you must regularly switch which RAM buffer to send data fram or to place received data in.
Thanks. So if I get it right, assuming my SSPx peripheral indicates the reception of 8 bytes (that number is fixed) by generating the proper interrupt, I collect these bytes into a small buffer in internal RAM, followed by a DMA transfer inside the SSP ISR to external RAM (where all the data of the peripheral is stored)? I though the peripheral takes control of the DMA independently...? So it boils down to memory to memory transfers - what's the point in peripheral to memory transfers then. I'm sorry, I'm a little confused...
Or maybe you mean that once the SSP interrupt is in, I need to trigger a DMA transfers from the peripheral RAM to my external RAM buffer...? That sounds more likely!
You configure the DMA engine to know about what memory buffers to use for data. You configure the DMA engine to connect to the SSP interface.
So when the SSP device is ready to send more data, the DMA engine can feed another word from memory buffers to keep the SSP constantly running. You either gives the DMA info about all the data to send and it sends it all and generates an interrupt when done. Or you keep updating the DMA engine with new buffers as the transfer progresses.
Same thing with incomming data. The DMA engine automatically moves bytes from the SSP to the specified buffer space in the speed the SSP is receiving them.
So there is no memory-to-memroy copy involved. Just memory to SSP or SSP to memory depending on the direction the DMA is confiured to operate. The DMA engine supports scatter or gather, by using linked lists. So when sending, it can walk a linked list to find memory regions (buffers) to use for transmission. When receiving, it can walk a linked list to find memory regions (buffers) to fill with received data.
Thank you - it is perfectly clear. I'm going to work on it - if I have more questions I will post them! Thanks again.
View all questions in Keil forum