I am using MPC5777C micro controller for my project development. I configure GPIO[189] as eMios output in the mode of OPWFMB on the platform EB25.1.1.I am refering the problem How to use eMIOS OPWFMB mode? - NXP Community.
Here's my code:
eMIOS_0.MCR.B.GPREN = 0; /* Disable global prescaler (reset default) */
eMIOS_0.MCR.B.GPRE = 79; /* Divide 80 MHz clock to module by 80 */
eMIOS_0.MCR.B.FRZ = 0; /* No Freeze ch regs in debug mode if ch FREN=0 */
eMIOS_1.MCR.B.GPREN = 0; /* Disable global prescaler (reset default) */
eMIOS_1.MCR.B.GPRE = 79; /* Divide 80 MHz clock to module by 80 */
eMIOS_1.MCR.B.FRZ = 0; /* No Freeze ch regs in debug mode if ch FREN=0 */
eMIOS_0_UC.UC[18].C.R = 0x0; /* Disable channel prescaler (reset default) */
eMIOS_0_UC.UC[18].A.R = 20; /* OPWFMB mode: duty cycle count */
eMIOS_0_UC.UC[18].B.R = 200; /* OPWFMB mode: period will be 200 counts */
eMIOS_0_UC.UC[18].CNT.R = 1; /* OPWFMB start ctr betw 1 & B reg value*/
eMIOS_0_UC.UC[18].C.B.EDPOL = 1; /* Output polarity on A match */
eMIOS_0_UC.UC[18].C.B.MODE = 0x58; /* Output Pulse Width & Freq. Modulation*/
eMIOS_0_UC.UC[18].C.B.UCPRE = 0; /* Prescale channel clock by 0+1=1 */
eMIOS_0_UC.UC[18].C.B.UCPREN= 1; /* Enable prescaler */
eMIOS_0.MCR.B.GPREN = 1; /* Enable global prescaled clocks */
eMIOS_0.MCR.B.GTBE = 1; /* Enable global time base */
eMIOS_1.MCR.B.GPREN = 1; /* Enable global prescaled clocks */
eMIOS_1.MCR.B.GTBE = 1; /* Enable global time base */
Port_Init(&Port_Config);
Here's some registers related to the function:
Thanks for asking!
已解决! 转到解答。
Hi,
eMIOS channel mapping is following
So eMIOS18 is mapped with eMIOS_0 ch18 and available on pin GPIO197
EMIOS10 is mapped to eMIOS_1 ch2 and available on the pin you configured; GPIO189
For I/O Signal Table refer to excel file attached to the MPC5777C reference manual.
BR, Petr
Hi,
eMIOS channel mapping is following
So eMIOS18 is mapped with eMIOS_0 ch18 and available on pin GPIO197
EMIOS10 is mapped to eMIOS_1 ch2 and available on the pin you configured; GPIO189
For I/O Signal Table refer to excel file attached to the MPC5777C reference manual.
BR, Petr