Hello i am a student and for my project i needed a 4-CH pulse counter which i used DMA based pulse counting. My code was working without interrupt, now i enabled the interrupt after one major loop and theres no response. KINDLY check what is wrong. I also observed that the MCU has problems in handling multiple interrupt. What should i do in this situation.
已解决! 转到解答。
Why you read the frequency_chx in DMA interrupt handler? The NOTE said: You can read the eDMA channel counter at any time in your application before the major iteration count is exhausted (when CITER reaches 0).
Hi Adhi_11,
Seems that you are refer to the S32K_Pulse_Count_via_eDMA example in AN5258SW.
Please set the INTMAJOR bit in the TCDn_CSR register by refer:
DMA->TCD[0].CSR |= DMA_TCD_CSR_INTMAJOR_MASK;
From which pin are you counting the external pulse?(PTA8 or PTB8 or PTC8 or PTD8?)
Is the number of pulses input through this pin enough for CITER to reach 0?
Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi Robin,
Yes, i referred the same documentation. i modified my code like you commented. I used now a 10khz PWM signal generated using PTD0 and used it in PTC8 and then PTD8. But the result is still 0. Im not sure if the number of pulses are enough for CITER to be 0. What needs to be done here to fix this issue. I needed 4xPWM counters implemented to count 4xexternal pulses
Why you read the frequency_chx in DMA interrupt handler? The NOTE said: You can read the eDMA channel counter at any time in your application before the major iteration count is exhausted (when CITER reaches 0).