- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I want to write PWM when we get Interrupt, which is connected to ZCD.
Please provide any method for doing this.
Thanks in Advance.
Solved! Go to Solution.
- Labels:
-
PSoC 4 Architecture
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Upon interrupt, set a flag.
Check the flag in main, and when it gets set, clear it, then turn on the PWM with PWM_Start().
If you want to change the PWM settings, then you will want to call PWM_Init() with the settings when you want to change them.
The API will change based on which PWM implementation you used, but something similar to the following should work:
At startup:
TCPWM_Init();
In ISR:
PWM_Start_Flag = true;
In Main:
if(PWM_Start_Flag) {
PWM_Start_Flag = false;
if(TCPWM_ReadStatus() != STATUS_RUNNING) {
TCPWM_Start();
}
}