-
Feb 21st, 2021 11:48 PM
#1
New Member
Shadow Register XMC1100
Hello,
I'm trying to implement a WS2812 control with a XMC1100. Therefore I want to drive it with the Dave4 PWM_CCU4 Module. When I set a new PWM value in the interrupt routine it requires a few cycles until it sets the new pwm and thus my timing is totally wrong.
Now through googling I found the shadow register in the XMCs, but I don't understand how they are set and triggered. Especially when I configure my chip using Dave apps.
-
Feb 22nd, 2021 08:10 PM
#2
Hi,
How are you updating the value in the ISR ? Are you using functions provided by Dave app ? Can you try calling XMC_CCU4_EnableShadowTransfer() just after the value update? Any call to XMC_CCU4_SLICE_SetTimerPeriodMatch(), XMC_CCU4_SLICE_SetTimerCompareMatch(),
,XMC_CCU4_SLICE_SetPrescaler(),XMC_CCU4_SLICE_Comp areInit(), XMC_CCU4_SLICE_CaptureInit() must be succeeded by XMC_CCU4_EnableShadowTransfer API. This is taken care in the dave app functions.
Best Regards,
Vasanth
The views expressed here are my personal opinions, have not been reviewed or authorized by Infineon and do not necessarily represent the views of Infineon.
-
Feb 23rd, 2021 03:09 PM
#3
New Member
I tried it like this now but it takes ~ 14 PWM period until the value is changed and a new duty cycle is output.
void CompareMatchIRQHandler(void)
{
if (upDown) {
pwm = 6400;
} else {
pwm = 3600;
}
if (pwm == 3600) {
upDown = true;
}
else if (pwm == 6400) {
upDown = false;
}
PWM_CCU4_SetDutyCycle(&PWM_CCU4_0, pwm);
XMC_CCU4_EnableShadowTransfer(&PWM_CCU4_0, XMC_CCU4_SHADOW_TRANSFER_SLICE_0);
PWM_CCU4_ClearEvent(&PWM_CCU4_0, XMC_CCU4_SLICE_IRQ_ID_COMPARE_MATCH_UP);
}
Disclaimer
All content and materials on this site are provided “as is“. Infineon makes no warranties or
representations with regard to this content and these materials of any kind, whether express or
implied, including without limitation, warranties or representations of merchantability, fitness for
a particular purpose, title and non-infringement of any third party intellectual property right. No
license, whether express or implied, is granted by Infineon. Use of the information on this site may
require a license from a third party, or a license from Infineon.
Infineon accepts no liability for the content and materials on this site being accurate, complete or up-
to-date or for the contents of external links. Infineon distances itself expressly from the contents of
the linked pages, over the structure of which Infineon has no control.
Content on this site may contain or be subject to specific guidelines or limitations on use. All postings
and use of the content on this site are subject to the Usage Terms of the site; third parties using
this content agree to abide by any limitations or guidelines and to comply with the Usage Terms of
this site. Infineon reserves the right to make corrections, deletions, modifications, enhancements,
improvements and other changes to the content and materials, its products, programs and services
at any time or to move or discontinue any content, products, programs, or services without notice.
Bookmarks