Synchronization of ETIMER and ADC and PWM with Different Rate (MPC5744P)

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

Synchronization of ETIMER and ADC and PWM with Different Rate (MPC5744P)

ソリューションへジャンプ
1,361件の閲覧回数
abhishek_kumar1
Contributor IV

Dear All

I have PWM modules being switched at 20Khz.

pastedImage_1.png

1. I want to Sample ADC at 10Khz, (synchronized with PWM) and I can achieve that by ADC and CTU. (Achieved)

2. I want to Etimer at 20Khz sysced with PWM(toggle up and down at 10 kHz) (need help)

pastedImage_7.png

pastedImage_3.png

pastedImage_2.png

My problem is that I want ETIMER at 20Khz, which has to be synced with the same PWM and seems to be impossible to have both, ADC at 10KHz and ETIMER at 20KHz. 

pastedImage_5.pngpastedImage_6.png

pastedImage_4.png

Is it possible to have ADC Sampling at 10Khz and Etimer at 20Khz synced with the same PWM (switched at 20Khz)?

Best Regards,

Abhishek

constantinrazvan.chivu‌ -> for you maybe. 

1 解決策
1,223件の閲覧回数
mariuslucianand
NXP Employee
NXP Employee

Hello abhishek.kumar@chassisbrakes.com‌,

I think the workaround you've found is fine since in this scenario (ETIMER sync with PWM and half ADC frequency conversion). You simply ignore the odd conversion. Probably another method was to enable an eTimer interrupt in which you enable or disable the Fifo interrupt request. But in this case you will still have an interrupt to handle and the conversion still has place. So keep it like in the model attached because it seems to work as expected.

Besr Regards,

Marius

元の投稿で解決策を見る

3 返答(返信)
1,223件の閲覧回数
mariuslucianand
NXP Employee
NXP Employee

Hello abhishek.kumar@chassisbrakes.com‌,

Is this question still active?

Best Regards,

Marius

0 件の賞賛
1,223件の閲覧回数
abhishek_kumar1
Contributor IV

Dear mariuslucianandrei

Sorry for delayed response. 

The question still stays. We momentarily solved using state machine where we only accept the results from ADC every alternate reading but the conversion is still happening. 

Please let me know if there is a smarter solution.

Best Regards,

Abhishek

0 件の賞賛
1,224件の閲覧回数
mariuslucianand
NXP Employee
NXP Employee

Hello abhishek.kumar@chassisbrakes.com‌,

I think the workaround you've found is fine since in this scenario (ETIMER sync with PWM and half ADC frequency conversion). You simply ignore the odd conversion. Probably another method was to enable an eTimer interrupt in which you enable or disable the Fifo interrupt request. But in this case you will still have an interrupt to handle and the conversion still has place. So keep it like in the model attached because it seems to work as expected.

Besr Regards,

Marius