Delay between starting of the PWM and trigger trigger to start ADC conversion - S32K344

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

Delay between starting of the PWM and trigger trigger to start ADC conversion - S32K344

983 次查看
MVR
Contributor III

I have tried to configure a trigger generator at the beginning of PWM period. I was able to setup with this way:

- PWM Master BUS: MCB_UP_DOWN_COUNTER.

- EMIOS CHANNEL: COUNTER BUS A.

- Some channels configured as OPWMCB to generate PWM with center aligned.

- One channel configured as OPWMB to generate trigger in BCTU.

- BCTU triggering the ADC conversion.

So I had this result:

MVR_1-1661785598861.png

MVR_0-1661785588160.png

We can see in this last print, the delay P0 - time from start of PWM period until start of ADC conversion - around 1.466us.

Why is 1.466us? I couldn't remove this delay. Do I need to use other mode of PWM to generate this trigger?

Note: "ADC Conversion" channel shows the start of trigger (rising edge) and the end of conversion (falling edge).

Thanks.

标签 (1)
0 项奖励
回复
4 回复数

973 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

how is a "ADC Conversion" signal generated? Is it GPIO toggling in some place of code? OPWMB flag represents BCTU trigger so can you move ADC conversion over PWM period?

BR, Petr

0 项奖励
回复

967 次查看
MVR
Contributor III

Hello @PetrS ,

I have tested it with these two notifications:

MVR_0-1661873341541.png

Configured as:

MVR_1-1661873449037.png

And:

MVR_2-1661873490831.png

And yes, I can move the ADC conversion over PWM period, if I change, the trigger change as well.

Follow my code for your review, maybe there is something wrong...

Thanks.

0 项奖励
回复

957 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

most probably it will be due to SW overhead. You are toggling pin within callbacks, so there could be significant delay, depends on driver. You can try to place toggling on first instruction of BCTU interrupt, then you should get closer to PWM edge. Moreover measure delay from the edge, where flag (trigger) is generated.

BR, Petr

0 项奖励
回复

950 次查看
MVR
Contributor III

Hello @PetrS ,

Yes, it make sense for me... So probably the trigger is over PWM period, but we are facing SW overhead... 

Thanks for help!

0 项奖励
回复