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

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Travis
Employee
Employee
First solution authored Welcome! 500 replies posted
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.....
0 Likes
1 Reply
Travis
Employee
Employee
First solution authored Welcome! 500 replies posted
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.
0 Likes