+ Reply to Thread
Results 1 to 3 of 3

Thread: Shadow Register XMC1100

  1. #1
    New Member New Member Wolpertinger is on a distinguished road
    Join Date
    Feb 2021
    Posts
    2
    Points
    35

    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.

  2. #2
    Advanced Advanced
    Infineon Employee
    Infineon Employee
    Vasanth is on a distinguished road
    Join Date
    Nov 2020
    Posts
    38
    Points
    800
    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.

  3. #3
    New Member New Member Wolpertinger is on a distinguished road
    Join Date
    Feb 2021
    Posts
    2
    Points
    35
    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);
    }

+ Reply to Thread
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.