i want to generate a PWM from 0 Hz to 500KHz.
how can i calculate it?
e.g for a PWM with a frequency of 20Hertz i need set Period time to 50000000.
I cannot set
etpwmSetTimebasePeriod(etpwmREG1, 50000000);
because of the second parameter is a uint16 value
isnt it?
sample code:
etpwmSetClkDiv(etpwmREG1, ClkDiv_by_1, HspClkDiv_by_1);/* Set the TBCLK frequency = VCLK3 frequency = 75MHz */
etpwmSetTimebasePeriod(etpwmREG1, 74);/* Set the time period as 1000 ns (Divider value = (1000ns * 75MHz) - 1 = 74)*/