AnsweredAssumed Answered

MPC5748G PWM

Question asked by Sohyun Jang on Aug 12, 2019
Latest reply on Aug 12, 2019 by Petr Stancik

Hi, I use MPC5748G PWM.

 

I have referred to the Cookbook below.
And I changed the PWM channel.
PG[2] ->PE[13]

void emios1_ch23_MCB(void) {    /* Config emios 1 chan 23: MCB, 1K count */

  eMIOS_UC_1.UC[23].C.R = 0x0; /* Disable channel prescaler (reset default) */
  eMIOS_UC_1.UC[23].A.R = 1000; /* MCB mode: period will be 1K clocks */
  eMIOS_UC_1.UC[23].C.B.MODE = 0x50; /* Modulus Counter Buffered (Up ctr) */
  eMIOS_UC_1.UC[23].C.B.UCPRE = 0; /* Prescale channel clock by 0+1=1 */
  eMIOS_UC_1.UC[23].C.B.UCPREN= 1; /* Enable prescaler */
}

void emios1_ch11_OPWMB(void) {      /* Config emios 1 chan 1: OPWMB */

  eMIOS_UC_1.UC[20].C.R = 0x0; /* Disable channel prescaler (reset default) */
  eMIOS_UC_1.UC[20].A.R = 250; /* PWM leading edge count value */
  eMIOS_UC_1.UC[20].B.R = 500; /* PWM trailing edge count value */
  eMIOS_UC_1.UC[20].C.B.BSL = 0; /* Timebase: counter bus A (chan 23) */
  eMIOS_UC_1.UC[20].C.B.EDPOL = 1; /* Output polarity on A match */
  eMIOS_UC_1.UC[20].C.B.MODE = 0x60; /* Output Pulse Width Modulation Buf'd*/
  SIUL2.MSCR[77].B.SSS = 1; /* Pad PG2: Source signal is E1UC_11_H */
  SIUL2.MSCR[77].B.OBE = 1; /* Pad PG2: OBE=1 (LED1 on Freescale EVB) */
}

 

There is no PWM output from PE13.
I changed it to PE12 and confirmed the PWM output was normal.

Is that a problem?

Outcomes