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

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

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

Jump to solution
1,787 Views
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 Solution
1,649 Views
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

View solution in original post

3 Replies
1,649 Views
mariuslucianand
NXP Employee
NXP Employee

Hello abhishek.kumar@chassisbrakes.com‌,

Is this question still active?

Best Regards,

Marius

0 Kudos
Reply
1,649 Views
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 Kudos
Reply
1,650 Views
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