Trigger ADC twice through PDB in one PWM cycle on s32k144

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

Trigger ADC twice through PDB in one PWM cycle on s32k144

ソリューションへジャンプ
1,312件の閲覧回数
zhangchun
Contributor III

Hello,

I am working on a motor control project and in order to optimize the control, I now need to trigger ADC twice within a PWM cycle for sampling. Specifically, this is the case.

 

ADC0_ Ch4 and ADC1_ CH15 is converted at the time when the PDB starts counting, and after the conversion is completed, an ADC1 interrupt is generated to read ADC data within the interrupt.

The period value [ticks] of PWM is 5000, and when the PDB count reaches 1500, ADC1_ Ch0 starts the conversion, and when the PDB count reaches 2500, ADC0_ Ch4 and ADC1_ CH15 starts the conversion, and after the conversion is completed, an ADC0 interrupt is generated to read ADC data within the interrupt. The triggering process is shown in the following figure

img_v2_d27d4b39-6d6c-4a99-b140-21635c995e1g.jpg

Currently, adding a second trigger sampling will result in both triggers failing. Please help me

 

thanks

ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
1,284件の閲覧回数
zhangchun
Contributor III
Resolved, the frequency of ADC needs to be increased. There are two incorrect variable names in the attached project.
Thanks

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
1,299件の閲覧回数
zhangchun
Contributor III
The reason why ADC0 and ADC1 interrupts are used here is because if ADC1 interrupts are all used, I am not sure how to distinguish which trigger sampling point this PWM cycle is. If it could be distinguished within the interrupt, it would be a better choice
0 件の賞賛
返信
1,285件の閲覧回数
zhangchun
Contributor III
Resolved, the frequency of ADC needs to be increased. There are two incorrect variable names in the attached project.
Thanks
0 件の賞賛
返信