bug in example code STM32G0xx PWM output Example
the following line 56000000 is wrong.
#define PRESCALER_VALUE (uint32_t)((SystemCoreClock / 56000000) - 1)
it should be 5600000 Right ?
SystemCoreclock is 16MHZ. but divided by 56MHZ ?
the following line 56000000 is wrong.
#define PRESCALER_VALUE (uint32_t)((SystemCoreClock / 56000000) - 1)
it should be 5600000 Right ?
SystemCoreclock is 16MHZ. but divided by 56MHZ ?
SystemCoreClock is 56000000.
Which makes PRESCALER_VALUE = 0.
Which makes the timer tick at 56 MHz.
Since period is 2295, the frequence is 24 kHz.
Which is exactly what the example says it does. No bug.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.