Unable to modify PWM duty cycle

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

Unable to modify PWM duty cycle

ソリューションへジャンプ
1,249件の閲覧回数
tbiberdorf
Contributor IV

I have a working TWR_K60D freeRTOS project.

I am confused as to why the FTM_UpdatePwmDutycycle() API call does not update the required FTM0-C2V registers unless I single step with the debugger.  When I allow the code to run without stepping, it will not update the registers.

The code can be cloned from the following GitHub repository: GitHub - tsbiberdorf/freeRTOS_TwrK60D: freeRTOS project to run on TWR_K60D hardware with FTM0 PWM op... 

The README file provides the h/w connections to the Tower Expansion board.

When I run the code and place a breakpoint on line 141 and 144 of FTM0Operation.c

at the same time I am monitoring the FTM0 registers.

When I hit the breakpoint on 141 the FTM0 registers provide this:

pastedImage_2.png

when I allow the code to continue to 144 the registers have not been updated:

pastedImage_3.png

Now if I reset the code and allow to run to breakpoint on 141, but single step through the FTM_UpdatePwmDutycycle() API, I find that the registers are updated.

pastedImage_4.png

Why does this not work when running?  why does it only work when single step is happening?  Is there a locking sequence that I'm missing?

Thanks

0 件の賞賛
返信
1 解決策
1,189件の閲覧回数
tbiberdorf
Contributor IV

I added the API call FTM_SetDeadTimeEnable() and now the code is working as expected.  Not sure why, but happy that its working.

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
1,190件の閲覧回数
tbiberdorf
Contributor IV

I added the API call FTM_SetDeadTimeEnable() and now the code is working as expected.  Not sure why, but happy that its working.

0 件の賞賛
返信