Using DMA with pin interrupt trigger to copy data

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

Using DMA with pin interrupt trigger to copy data

578 Views
ky3orr
Contributor II

Hello,

I'd like to use pin interrupt to implement accurate timestamping with use of DMA.

What I'd like to reach is to copy 64bit timestamp value (updated in SysTick interrupt) to some other 64-bit variable on logic transition caused by external interrupt signal.

I could to it manually in interrupt routine while handling external IRQ request, but I want to minimize timestamp copying lag due to interrupt handling delay.

Does anybody have any suggestions?

Anybody implemented such a feature already?

Maybe my idea is a bit over engineered on KL05? :smileyhappy:

I am using KDS2.0 with PE.

Thanks in advance for any hints!

Tags (3)
0 Kudos
Reply
1 Reply

442 Views
EarlOrlando
Senior Contributor II

Dear Grzegorz,

I think that the minimum delay can be obtained by configuring the external pin as DMA trigger, this is configuring the interrupt as "DMA request" (it could be on rising edge, falling edge or either edges), this is configured in the PORTx_PCRn[IRQC] register. This causes that the DMA transaction starts exactly in the moment when the external pin changes it value. The DMA should be configured to do two 32-bit transactions. If you need to do something more you can configure an interrupt caused by the DMA channel.

I hope this helps.

Regards,

Earl.

0 Kudos
Reply