Hi @fengba_360
EMIOS module setting in ConfigTools are named as Clock_Divider Value, Master_Bus Prescaler, and Master BusAlternate Prescaler. How to know their relationship and their usage? When Emios is used as PWM (OPWMB, OPWFMB, ...), it divides the CORE_CLK clock by the Clock Divider Value (global prescaler (MCR[GPRE] + 1)) and routes the resulting prescaled clock output to the Master Bus Prescaler (channel internal prescaler (Cn[UCPRE] + 1)). Thus channel internal counter counts (CORE_CLK/global prescaler/internal prescaler) clock.
For example: assuming the channel running in for example OPWFMB mode, its PWM frequency is calculated as:
PWM frequency = CORE_CLK / global prescaler / internal prescaler / (B1+1)
Where B1 is the period ticks.
With this information, if we want a PWM of 1KHz and the clock frequency of our eMIOS is 48Mhz and we define the global prescaler and the internal prescaler equal to 1, with this we would only need one parameter to obtain our 1KHz signal, which is the period (ticks) which we can obtain by solving the formula given above:
Period = CORE_CLK/1KHz, giving 48000.
BR, VaneB