Hi,
I have an issue with DMA time to service from request which I hope someone can help me with.
I have an SPI receive transfer which I am using to trigger a DMA transfer of received data into a RAM buffer. On DMA frame transfer complete interrupt I activate a 'service routine'. By driving a DIO pin from within this service routine and using a scope to view SPI chip select and DIO pin, I can see that the service routine is activated at time t_dma = 31.2us from end of SPI chip select (see following diagram).
The issue I have is that this is an incredibly long time. I think the DMA transfer itself only takes a microsecond or two, and it is its start which is being delayed by some 30us from end of SPI transfer. Why is this?
________
| |
__| |_______________________________________________ SPI CS
.
. ____
. | |
_______________________________________________| |______ Service Routine Active
. .
.<------------- t_dma ------------->.
t_dma = 31.2us
As a comparison, I have called the service routine directly from the SPI receive complete interrupt (this interrupt was not active in the first scenario above). In this case, I can see that the service routine is activated at time t_spi = 1.2us from end of SPI chip select (see following diagram).
________
| |
__| |_______________________________________________ SPI CS
.
. ____
. | |
_______________________| |______________________________ Service Routine Active
. .
.<- t_spi ->.
t_spi = 1.2us
Regards, Tony.