S32k144 DMA Pulse Counting Interrupt

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

S32k144 DMA Pulse Counting Interrupt

ソリューションへジャンプ
1,794件の閲覧回数
Adhi_11
Contributor I

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.

0 件の賞賛
返信
1 解決策
1,755件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

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).

Measured FTM PWM Frequency.png

元の投稿で解決策を見る

0 件の賞賛
返信
6 返答(返信)
1,680件の閲覧回数
Adhi_11
Contributor I

Hi Robin,

i needed to adopt this example for my S32k144 64pin self made board. How do i select the trigger source. Example uses PTA8, PTB8, PTC8, PTD8.. etc for channel source 49,50,51,52 what should be channel number if i want to use PTA12, PTE3, PTD2, PTC7. Where do i find this information

0 件の賞賛
返信
1,780件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

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?

INTMAJOR.png


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.
-------------------------------------------------------------------------------

0 件の賞賛
返信
1,772件の閲覧回数
Adhi_11
Contributor I

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 

0 件の賞賛
返信
1,766件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

Connect PTD0(10kHz PWM) to PTC8 or PTD8 will trigger DMA2_IRQHandler and DMA3_IRQHandler.

DMAMUX_CHCFG_SOURCE.png

0 件の賞賛
返信
1,763件の閲覧回数
Adhi_11
Contributor I
Yes, the interrupt triggered like you said. But the pulse counting did not occur, the output is still 0
0 件の賞賛
返信
1,756件の閲覧回数
Robin_Shen
NXP TechSupport
NXP TechSupport

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).

Measured FTM PWM Frequency.png

0 件の賞賛
返信