Hrpwm,eru

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

cross mob
User22489
Level 1
Level 1
First like given Welcome!
/* CSG slice initialization */
XMC_HRPWM_CSG_Init(PWM_CSG_D, &csg2_init_config);
XMC_HRPWM_CSG_StartSlopeGenConfig(PWM_CSG_D, &sg2_input_config);
XMC_HRPWM_EnableComparatorShadowTransfer(HRPWM0, XMC_HRPWM_SHADOW_TX_DAC2);
/* Start HRPWM CSG, DAC and Comparator*/
XMC_HRPWM_StartDac(HRPWM0, XMC_HRPWM_CSG_RUN_BIT_DAC2);
XMC_HRPWM_StartComparator(HRPWM0, XMC_HRPWM_CSG_RUN_BIT_CMP2);
XMC_HRPWM_StartSlopeGeneration(HRPWM0,(XMC_HRPWM_CSG_SLOPE_START_DAC2 | XMC_HRPWM_CSG_PRESCALER_START_CSG2));

/* Connect inputs of ERUs from comparators and from PWM signals */
/* Reset D ERU from comparator 2 and status of PWM A. Status of PWMA is associated with the CR2 value, this way the shift is adjusted. */
XMC_ERU_ETL_SetInput(XMC_ERU1, 3, (uint32_t)XMC_ERU_ETL_INPUT_A0, (uint32_t)XMC_ERU_ETL_INPUT_B3);
/* Reset C ERU from comparator 0 and pin 1.3 (B output) */
XMC_ERU_ETL_SetInput(XMC_ERU1, 2, (uint32_t)XMC_ERU_ETL_INPUT_A2, (uint32_t)XMC_ERU_ETL_INPUT_B3);


For the code, I really didn’t find relevant learning materials, especially the settings of Slope generator and Comparator. I really hope that the big guys can contribute a related routine instead of just a long talk.
0 Likes
1 Solution
Alakananda_BG
Moderator
Moderator
Moderator
50 likes received 250 sign-ins 250 replies posted
Hi,

I have attached the HRPWM code example in the link you can also find may code examples which will help you understand the functionalities.
http://dave.infineon.com/Libraries/X...AAEgL-VvD_BwEI

Regards
Alakananda
Alakananda

View solution in original post

0 Likes
1 Reply
Alakananda_BG
Moderator
Moderator
Moderator
50 likes received 250 sign-ins 250 replies posted
Hi,

I have attached the HRPWM code example in the link you can also find may code examples which will help you understand the functionalities.
http://dave.infineon.com/Libraries/X...AAEgL-VvD_BwEI

Regards
Alakananda
Alakananda
0 Likes