How to configure MPC5748G controller for eMIOS OPWFMB mode?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How to configure MPC5748G controller for eMIOS OPWFMB mode?

跳至解决方案
594 次查看
Charith
Contributor I

Hi,

I am using MPC5748G controller, I want to configure a PIN  for PWM OPWFMB mode for controlling the LED. I am configuring the pin PI2 as mentioned below but I am not able to get the PWM output. Please suggest if any corrections required.

 

eMIOS_UC_0.UC[30].C.R = 0x0; /* Disable channel pre-scaler (reset default) */
eMIOS_UC_0.UC[30].A.R = 20; /* OPWFMB mode: duty cycle count */ //19
eMIOS_UC_0.UC[30].B.R = 200; /* OPWFMB mode: period will be 200 counts */
eMIOS_UC_0.UC[30].CNT.R = 1; /* OPWFMB start counter between 1 & B register value*/
eMIOS_UC_0.UC[30].C.B.EDPOL = 1; /* Output polarity on A match */
eMIOS_UC_0.UC[30].C.B.MODE = 0x58;/* Output Pulse Width & Frequency Modulation*/
eMIOS_UC_0.UC[30].C.B.UCPRE = 0; /* Pre-scale channel clock by 0+1=1 */
eMIOS_UC_0.UC[30].C.B.UCPREN= 1; /* Enable pre-scaler */

SIUL2.MSCR[PI2].B.SSS = 1; /* Pad PE6: Source signal is E0UC_23_X */
SIUL2.MSCR[PI2].B.OBE = 1; /* Pad PF6: OBE=1. */
SIUL2.MSCR[PI2].B.src=3; /* Pad PF6: Full strength slew rate */

 

Thanks,

Charith

0 项奖励
回复
1 解答
576 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

eMIOS_0 ch30 is the Y type channel which does not have internal counter and so do not support OPWFMB mode. Refer to chapter 35.1.1 Channel types of the RM.
You can use OPWMB mode on that channel, but global or local counter bus running in MCB mode must be selected using BSL bits.

BR, Petr

在原帖中查看解决方案

0 项奖励
回复
1 回复
577 次查看
PetrS
NXP TechSupport
NXP TechSupport

Hi,

eMIOS_0 ch30 is the Y type channel which does not have internal counter and so do not support OPWFMB mode. Refer to chapter 35.1.1 Channel types of the RM.
You can use OPWMB mode on that channel, but global or local counter bus running in MCB mode must be selected using BSL bits.

BR, Petr

0 项奖励
回复