PDA

View Full Version : Tip of the day XMC4500: Enable Interrupt compare match while counting down



Travis
Jul 4th, 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.....

Travis
Jul 4th, 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.