Jul 04, 2013
12:23 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 04, 2013
12:23 AM
The PWMSP001 and PWMSP002 provide interrupt for compare match while counting up by default. However you can make some simple modification to the code for
1. Interrupt for compare match while counting up and down
const PWMSP001_HandleType PWMSP001_Handle0 =
{
.InterruptControl = 0xDU, // Set CMDE, CMUE, PME
2. Interrupt for compare match while counting down
const PWMSP001_HandleType PWMSP001_Handle0 =
{
.InterruptControl = 0x9U, // Set CMDE, PME
Note: Before code modification, please be sure to "Enable Compare match interrupt" in DAVE3 PWMSP001/002 apps and perform a code generation.
G@@d luck and have fun.....
1. Interrupt for compare match while counting up and down
const PWMSP001_HandleType PWMSP001_Handle0 =
{
.InterruptControl = 0xDU, // Set CMDE, CMUE, PME
2. Interrupt for compare match while counting down
const PWMSP001_HandleType PWMSP001_Handle0 =
{
.InterruptControl = 0x9U, // Set CMDE, PME
Note: Before code modification, please be sure to "Enable Compare match interrupt" in DAVE3 PWMSP001/002 apps and perform a code generation.
G@@d luck and have fun.....
1 Reply
Jul 04, 2013
12:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 04, 2013
12:46 AM
Beside the above mention, Interrupt for "One match while counting down" can be also done the similar way.
Example:
Interrupt for "One match while counting down"
const PWMSP001_HandleType PWMSP001_Handle0 =
{
.InterruptControl = 0x2U // set OME
Note: Before code modification, please be sure to "Enable Period match interrupt" in DAVE3 PWMSP001/002 apps and perform a code generation.
Example:
Interrupt for "One match while counting down"
const PWMSP001_HandleType PWMSP001_Handle0 =
{
.InterruptControl = 0x2U // set OME
Note: Before code modification, please be sure to "Enable Period match interrupt" in DAVE3 PWMSP001/002 apps and perform a code generation.