Not applicable
Jul 19, 2017
08:20 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 19, 2017
08:20 AM
Hi everyone,
I want to update the compare value of the CCU80 Slice 0 channel 1 via software directly.
I am using the XMCLib functions in the following sequence:
-I configure the Shadow transfer as follows:
XMC_CCU8_EnableShadowTransfer(MODULE_PTR, \
(uint32_t)(XMC_CCU8_SHADOW_TRANSFER_SLICE_0| \
XMC_CCU8_SHADOW_TRANSFER_PRESCALER_SLICE_0));
XMC_CCU8_SLICE_EnableAutomaticShadowTransferRequest(SLICE0_PTR, XMC_CCU8_SLICE_AUTOMAIC_SHADOW_TRANSFER_WRITE_INTO_COMPARE1_SHADOW);
-For changing the compare value I use the following function:
XMC_CCU8_SLICE_SetTimerCompareMatch(SLICE0_PTR,XMC_CCU8_SLICE_COMPARE_CHANNEL_1,(uint16_t) y);
However, it seems that the Duty Cycle is not changing. I suspect that I am not changing well the compare value.
Any help would be highly appreciated
I want to update the compare value of the CCU80 Slice 0 channel 1 via software directly.
I am using the XMCLib functions in the following sequence:
-I configure the Shadow transfer as follows:
XMC_CCU8_EnableShadowTransfer(MODULE_PTR, \
(uint32_t)(XMC_CCU8_SHADOW_TRANSFER_SLICE_0| \
XMC_CCU8_SHADOW_TRANSFER_PRESCALER_SLICE_0));
XMC_CCU8_SLICE_EnableAutomaticShadowTransferRequest(SLICE0_PTR, XMC_CCU8_SLICE_AUTOMAIC_SHADOW_TRANSFER_WRITE_INTO_COMPARE1_SHADOW);
-For changing the compare value I use the following function:
XMC_CCU8_SLICE_SetTimerCompareMatch(SLICE0_PTR,XMC_CCU8_SLICE_COMPARE_CHANNEL_1,(uint16_t) y);
However, it seems that the Duty Cycle is not changing. I suspect that I am not changing well the compare value.
Any help would be highly appreciated
- Tags:
- IFX
2 Replies
Not applicable
Jul 19, 2017
12:21 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 19, 2017
12:21 PM
Set the shadow register first, then enable the transfer:
This code should work for the CCU8.
CCU42_CC40->CRS = ((FLY_BACK_PRS - s24V_ParSupplyCtrlLoop.ui16FlyBackPWM) << CCU4_CC4_CRS_CRS_Pos); // Configure the Compare register
CCU42->GCSS |= (1 << CCU4_GCSS_S0SE_Pos); // Shadow transfer for slice 3, for CCU40 Kernel
This code should work for the CCU8.
Attachments are accessible only for community members.
Jul 19, 2017
11:56 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 19, 2017
11:56 PM
Hi,
There is an errata on the automatic shadow transfer request feature of the XMC1400. CCU_AI.007 Automatic shadow transfer feature does not work when system PCLK is faster than MCLK.
If the PCLK is kept the same as the MCLK then the feature is working.
See attached example.
Regards,
Jesus
There is an errata on the automatic shadow transfer request feature of the XMC1400. CCU_AI.007 Automatic shadow transfer feature does not work when system PCLK is faster than MCLK.
If the PCLK is kept the same as the MCLK then the feature is working.
See attached example.
XMC_CCU8_SLICE_WriteImmediateAfterShadowTransfer(CCU81_CC81, XMC_CCU8_SLICE_WRITE_INTO_COMPARE1_CONFIGURATION);
XMC_CCU8_SLICE_EnableAutomaticShadowTransferRequest(CCU81_CC81, XMC_CCU8_SLICE_AUTOMAIC_SHADOW_TRANSFER_WRITE_INTO_COMPARE1_SHADOW);
/* Transfer value from shadow registers to actual timer registers */
XMC_CCU8_EnableShadowTransfer(CCU81, XMC_CCU8_SHADOW_TRANSFER_SLICE_1 |
XMC_CCU8_SHADOW_TRANSFER_DITHER_SLICE_1 |
XMC_CCU8_SHADOW_TRANSFER_PRESCALER_SLICE_1);
Regards,
Jesus