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

cross mob
Not applicable
Hello,

I want to drive/trigger HRPWM hrc0 channel with the 'capture compare unit timer 1' (CCU8081).


I've tried it with the following code below. Just copied the HRPWM initialisation code (without the part of the CCU8081 and the port pin P0_5 and P0_2)


XMC_HRPWM_HRC_CONFIG_t hrc0_config =
{
.hr_out0_inv_enable = 0,
.hr_out1_inv_enable = 1,
.hrc_shadow_xfer_linktoCCU8 = (uint32_t)(XMC_HRPWM_FUNC_STATUS_ENABLE),
.dt_shadow_xfer_linktoCCU8 = (uint32_t)(XMC_HRPWM_FUNC_STATUS_ENABLE),
.dt_enable = (uint32_t)(XMC_HRPWM_FUNC_STATUS_ENABLE),
.dt_trigger_sel = 0,
.hr_out0_passive_level_out = 0,
.hr_out1_passive_level_out = 0

};
const XMC_HRPWM_HRC_SRC_CONFIG_t hrc0_source =
{
.high_res_mode = XMC_HRPWM_HRC_HR_EDGE_SEL_BOTH,
.set_config = XMC_HRPWM_HRC_SRC_INPUT_CCU,
.clear_config = XMC_HRPWM_HRC_SRC_INPUT_CCU,
.cmp_set = XMC_HRPWM_HRC_CMP_SEL_CSG0,
.cmp_clear = XMC_HRPWM_HRC_CMP_SEL_CSG0,
.timer_sel = XMC_HRPWM_HRC_TIMER_SEL_CCU_CC1,
.set_edge_config = XMC_HRPWM_HRC_SRC_EDGE_SEL_RISING,
.clear_edge_config = XMC_HRPWM_HRC_SRC_EDGE_SEL_FALLING,
.src_trap_enable = XMC_HRPWM_FUNC_STATUS_DISABLE,
};
XMC_HRPWM_Init(HRPWM0);
XMC_HRPWM_HRC_Init(HRPWM0_HRC0, &hrc0_config);
XMC_HRPWM_EnableHighResolutionPath(HRPWM0, XMC_HRPWM_HR_PATH_HRC0);
XMC_HRPWM_DisableLowResolutionPath(HRPWM0, XMC_HRPWM_LR_PATH_HRC0);
XMC_HRPWM_HRC_Set_HR_Source(HRPWM0_HRC0, XMC_HRPWM_HRC_SOURCE_1);
XMC_HRPWM_HRC_ConfigSourceSelect1(HRPWM0_HRC0, &hrc0_source);
XMC_HRPWM_EnableHighResolutionShadowTransfer(HRPWM0, XMC_HRPWM_HRC_SHADOW_TX_HRC0_VALUE);



The result is that HRPWM channls are triggert by timer 0 (CCU8080) and not by timer 1 (CCU8081) even
the struct was initialisied with the constant '.timer_sel = XMC_HRPWM_HRC_TIMER_SEL_CCU_CC1,'.
Is it possible to trigger hrc0 with CCU8081 and how?
0 Likes
0 Replies