This sample program is run on CY8CKIT-149 (PSoC 4100S Plus). This is a sample that dynamically modifies the duty cycle of TCPWM. According to Arch TRM, it's recommended that you don't modify the compare register directly, swap it for the value via compare buffer register. The actual timing of swapping is when TC event occurs while swap is enabled. In this sample, TC event is generated by software trigger. The compare value of TCPWM for LED output changes at 1 second intervals.
Please refer to
- PSoC4100S/4100S Plus Arch TRM (Doc No. 002-10621) : 188.8.131.52 How It Works
- PSoC4 TCPWM Component Datasheet (Doc No. 002-10078)
Thanks for sharing the code example for the community. appreciate your efforts.