I am using eMIOS to generate PWM signals using the OPWMb Mode. In this mode, just the external counter buses are used. However, is it required to configure the internal prescaler?
Second, what is the prescaler in the image?
I am using the formular below :
PWM frequency = CORE_CLK / global prescaler / internal prescaler / (B1+1).
what is the case for B1 is +1?
can i find the formular in RM or DS?
what is the higest frequency we can go for by using eMIOS?
Hi @Ayaz,
I'm not sure where you got the equation. The OPWMB mode is very flexible PWM mode because it allows independent setting of both PWM signal edges (by channels register A and B). Please refer to the RM, Section 64.5.3.18 Output PWM Buffered (OPWMB) mode.
Each EMIOS instance has its own global prescaler.
And each channel has it own local prescaler.
For example, the Master Bus Prescaler is the local prescaler for CH23 which generates Global Counter Bus A.
Global Counter Bus A can be used by channels configured in the OPWMB mode.
Regards,
Daniel
what is the alternative prescaler used for ?
Hi @Ayaz,
In the eMIOS mode configuration you posted here, the period is given by the MCB_UP_COUNTER period, not by the OPWMB channel.
The equation is then:
CORE_CLK / Global_EMIOs_prescaler / MCB_Prescaler / MCB_A_register
Master Bus Alternative Prescaler of the MCB can be set using this API:
Emios_Mcl_Ip_SetClockMode()
Clock prescaler Alternate is applicable in these two modes only:
Regarding the max. eMIOS freq.
The eMIOS is clocked by the CORE_CLK.
If you are asking about the max. PWM frequency that the eMIOS can generate, then the limitations are given by the IO slew rate rather than the eMIOS .
All the eMIOS clock dividers can be bypassed, and if the period is set to just a few eMIOS counter ticks, we can get PWM freq. in tens of MHz.
DS, Table 25. GPIO DC electrical specifications, 5.0V (4.5V - 5.5V).
Regards,
Daniel
I got the equation from one of your colleague PWM issue
This is an example of OPWMB from the Reference Manual.
Output pin is driven LOW on A match and HIGH on B match.
The period is given by the selected counter bus period.
Regards,
Daniel
i need to be sure about the formula and the max reliable frequency that Emios can provider by refere to the RM or datasheet?
i am using the trailling Edge !!