pwm by eMIOS

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

pwm by eMIOS

1,377 Views
Ayaz
Contributor III

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 :Skærmbillede 2024-01-03 104830.png

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? 

0 Kudos
Reply
6 Replies

1,360 Views
danielmartynek
NXP TechSupport
NXP TechSupport

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.

danielmartynek_0-1704360478568.png

danielmartynek_1-1704361035900.png

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.

danielmartynek_2-1704361555768.png

 

Regards,

Daniel

 

 

 

 

0 Kudos
Reply

1,320 Views
Ayaz
Contributor III

what is the alternative prescaler used for ?

 

0 Kudos
Reply

1,315 Views
danielmartynek
NXP TechSupport
NXP TechSupport

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:

danielmartynek_0-1704460304857.png

 

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).

danielmartynek_1-1704460874509.png

Regards,

Daniel

 

 

 

 

 

 

 

0 Kudos
Reply

1,353 Views
Ayaz
Contributor III

I got the equation from one of your colleague PWM issue 

0 Kudos
Reply

1,349 Views
danielmartynek
NXP TechSupport
NXP TechSupport

This is an example of OPWMB from the Reference Manual.

danielmartynek_0-1704364192201.png

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

0 Kudos
Reply

1,346 Views
Ayaz
Contributor III

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 !! Skærmbillede 2024-01-04 114626.png

0 Kudos
Reply