psoc 6 pwm invert output

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
chro_1316281
Level 3
Level 3
10 replies posted 5 replies posted 5 questions asked

I see the option on psoc 6 pwm to invert pwm output at design time.

Anyone know if it can be set during runtime also? I would like to have the option to change without rebuilding the project and uploading firmware.

I looked around the pwm datasheet as well as pwm header files and no api/register jumped out at me.

 

Any info would be appreciated.

 

Thanks,

Chris

0 Likes
1 Solution
chro_1316281
Level 3
Level 3
10 replies posted 5 replies posted 5 questions asked

Thank you! I had seen that but was not sure if that impacted in PWM mode.

 

Thanks,

Chris

View solution in original post

0 Likes
3 Replies
Aashita_R
Moderator
Moderator
Moderator
50 likes received 100 solutions authored 250 replies posted

Hi @chro_1316281 ,

Please refer to the section 28.2.6 that is, PWM Outputs in the PSoC 63 BLE architecture TRM here : https://www.cypress.com/documentation/technical-reference-manuals/psoc-6-mcu-psoc-63-ble-architectur... .

Also, you can read about the register TCPWMCN_CNT0_TR_CTRL2 in detail in the device Register TRM here: https://www.cypress.com/documentation/technical-reference-manuals/psoc-6-mcu-cy8c63x6-cy8c63x7-cy8c6... . 

You can configure the TCPWM  output  in Count compare, overflow and underflow conditions using TCPWM_CNT0_TR_CTRL2 register, where setting the register's value to 0x2 results in Invert PWM event. Please try as mentioned above, in your project and let us know if this works for you.

Best Regards,

Aashita

 

 

0 Likes
chro_1316281
Level 3
Level 3
10 replies posted 5 replies posted 5 questions asked

Thank you! I had seen that but was not sure if that impacted in PWM mode.

 

Thanks,

Chris

0 Likes

Probably would  be better to use PDL instead of writing the register directly

Alan