MPC5777C eTPU and eQADC

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

MPC5777C eTPU and eQADC

跳至解决方案
1,872 次查看
darq
Contributor III

Hello,

Some of eTPU channels in our system generate high frequency PWM signals. Each analog input related to specific eTPU signal would have to be measured after each PWM signal edge to measure output voltage in On and Off states. Is it possible to implement it with eQADC for multiple eTPU channels? I saw some examples using SDADC but the number of inputs for this module is too limited for our needs. What would be the best way to do it? If possible i would like to avoid interrupts but is there a way to synchronize conversions with DMA? Are there some documents related to this topic? 

Best regards

0 项奖励
回复
1 解答
1,844 次查看
johndiener
Contributor IV

Only certain eTPU channels can trigger DMAs or directly trigger eQADC conversions. In order to keep the host processor out of the loop, these eTPU channels would need to be used to generate your PWMs. For example, on the MPC5777C, only the following eTPU_A channels can trigger a DMA directly: 0, 1, 2, 12, 13, 14, 15, 28, 29. Or, the following MPC5777C eTPU_A channels can trigger an eQADC conversion:
eQADC (A or B), CFIFO0 : 28, 29, 30 31
eQADC (A or B), CFIFO1 : 7, 28, 29, 30 31
eQADC (A or B), CFIFO2 : 14, 28, 29, 30 31
eQADC (A or B), CFIFO3 : 22, 28, 29, 30 31
eQADC (A or B), CFIFO4 : 27, 28, 29, 30 31
eQADC (A or B), CFIFO5 : 26, 28, 29, 30 31

Assuming you are using the standard PWM eTPU function, it only generates a data transfer (DMA) interrupt on the frame edge (the edge that occurs every period, not the duty cycle edge that floats around). Thus to measure on every signal edge as you note, you would need to use the signal to trigger the eQADC, so a pretty limited set of channels can be utilized.

In order to use the data transfer interrupt capability (or channel interrupt, which would force the host processor to be in the loop) and still be able to measure on every PWM edge, would require a small change the PWM eTPU code (issue interrupts on the duty cycle edge).

John Diener

在原帖中查看解决方案

1 回复
1,845 次查看
johndiener
Contributor IV

Only certain eTPU channels can trigger DMAs or directly trigger eQADC conversions. In order to keep the host processor out of the loop, these eTPU channels would need to be used to generate your PWMs. For example, on the MPC5777C, only the following eTPU_A channels can trigger a DMA directly: 0, 1, 2, 12, 13, 14, 15, 28, 29. Or, the following MPC5777C eTPU_A channels can trigger an eQADC conversion:
eQADC (A or B), CFIFO0 : 28, 29, 30 31
eQADC (A or B), CFIFO1 : 7, 28, 29, 30 31
eQADC (A or B), CFIFO2 : 14, 28, 29, 30 31
eQADC (A or B), CFIFO3 : 22, 28, 29, 30 31
eQADC (A or B), CFIFO4 : 27, 28, 29, 30 31
eQADC (A or B), CFIFO5 : 26, 28, 29, 30 31

Assuming you are using the standard PWM eTPU function, it only generates a data transfer (DMA) interrupt on the frame edge (the edge that occurs every period, not the duty cycle edge that floats around). Thus to measure on every signal edge as you note, you would need to use the signal to trigger the eQADC, so a pretty limited set of channels can be utilized.

In order to use the data transfer interrupt capability (or channel interrupt, which would force the host processor to be in the loop) and still be able to measure on every PWM edge, would require a small change the PWM eTPU code (issue interrupts on the duty cycle edge).

John Diener