- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You have to check off the swap capability and enter the swap values.
Note you can do the switch in HW by enabling the switch input and feeding
it with a switch signal.
Regards, Dana
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I want to use the API and by software modify the parameters.
CyGlobalIntEnable; /* Uncomment this line to enable global interrupts. */
for(;;)
{
if(counter ==5)
{
PWM_SetPeriodSwap(1u);
PWM_SetCompareSwap(1u);
}
}
Why is this simple code does not work?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Two questions -
1) Did you check the properties to allow the swap capability ?
2) Can you set a breakpoint and hit it on the swap instruction ?
Eg. are you getting into the if statement test on counter ?
3) Where do you reset counter variable after doing swap, otherwise
you will keep repeating the swap commands ?
You also have to have the compare checked.
Regards, Dana.