MCPWM register programming...
Posted: Sun Nov 17, 2024 9:04 pm
I am trying to set up the MCPWM on a esp32-3s wroom-1 module.
I want to write to the registers directly to set the PWM up, but none of the values are changing after I write to them for example:
WRITE_PERI_REG(MCPWM_CLK_REG(0) , MCPWM_CLK_EN);
WRITE_PERI_REG(MCPWM_TIMER0_CFG0_REG(0), ((0x0<<MCPWM_TIMER0_PERIOD_UPMETHOD_S) | (914<<MCPWM_TIMER0_PERIOD_S))); // See page 1344 this sets the when to update and the period
WRITE_PERI_REG(MCPWM_GEN0_TSTMP_A_REG(0), (457)); // Set the timer compare value
None of these writes make any change to the default values if I read the values back after a pause!
(I have checked writing to things like the GPIO register etc and there seems no issue!)
HELP!
I want to write to the registers directly to set the PWM up, but none of the values are changing after I write to them for example:
WRITE_PERI_REG(MCPWM_CLK_REG(0) , MCPWM_CLK_EN);
WRITE_PERI_REG(MCPWM_TIMER0_CFG0_REG(0), ((0x0<<MCPWM_TIMER0_PERIOD_UPMETHOD_S) | (914<<MCPWM_TIMER0_PERIOD_S))); // See page 1344 this sets the when to update and the period
WRITE_PERI_REG(MCPWM_GEN0_TSTMP_A_REG(0), (457)); // Set the timer compare value
None of these writes make any change to the default values if I read the values back after a pause!
(I have checked writing to things like the GPIO register etc and there seems no issue!)
HELP!