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

920件の閲覧回数
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 返答(返信)

910件の閲覧回数
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 件の賞賛

904件の閲覧回数
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 件の賞賛

894件の閲覧回数
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 件の賞賛

887件の閲覧回数
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 件の賞賛