Hello @Jana_muralidharan ,
Thanks for your post.
When FTMEN = 1 (which you have already set), the main registers of the FTM (including CnV, MOD, CNTIN, etc.) are write-buffered; the actual registers are only updated when a synchronization/load event is triggered. Otherwise, the new values will remain in the buffer, and the channel will continue using the old initialized values. Please see the description in RM:
Celeste_Liu_0-1766053059160.png
Celeste_Liu_1-1766053104360.png
Celeste_Liu_2-1766053261449.png
Please modify the code below to set LDOK=1 to enable the load:
/* ARM reload for next PWM cycle */
*(volatile __UINT32_TYPE__ *)0x4003A098 = 0x0201;//0x0200=LDOK, 0x0001=CH0SEL
Celeste_Liu_3-1766053941711.png
Hope it helps.
BR
Celeste
------------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the "ACCEPT AS SOLUTION" button. Thank you!
------------------------------------------------------------------------------------------------------------------------