How to configure eMIOS DAOC function for MPC5748G

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

How to configure eMIOS DAOC function for MPC5748G

541 Views
ognyanyanchev
Contributor I

I try to realize the output compare function DAOC for MPC5748G micro controller, but probably my configuration is wrong and the result is bad.

My configuration is:

//init_emios_global_prescalers
eMIOS_0.MCR.B.GPREN = 0; /* Disable global prescaler (reset default) */
eMIOS_0.MCR.B.GPRE = 15; /* Divide 80 MHz clock to module by 16 */
eMIOS_0.MCR.B.FRZ = 0; /* No Freeze ch regs in debug mode if ch FREN=0 */

//init_emios DAOC

eMIOS_UC_0.UC[6].C.R = 0x0; /* Disable channel prescaler (reset default) */

eMIOS_UC_0.UC[6].A.R = 0x000064; /* DAOC mode: register A */
eMIOS_UC_0.UC[6].B.R = 0x000100; /* DAOC mode: register B */
eMIOS_UC_0.UC[6].C.B.EDPOL = 0; /* Output polarity on A match */
eMIOS_UC_0.UC[6].C.B.EDSEL = 1; /* For SAOC mode The output flip-flop is toggled */
eMIOS_UC_0.UC[6].C.B.BSL = 0;
eMIOS_UC_0.UC[6].C.B.FEN = 1; /* Enable interrupt */
eMIOS_UC_0.UC[6].C.B.MODE = 0x7;/* DAOC mode*/
eMIOS_UC_0.UC[6].C.B.UCPRE = 0; /* Prescaler channel clock by 0+1=1 */
eMIOS_UC_0.UC[6].C.B.UCPREN= 1; /* Enable prescaler */

SIUL2.MSCR[6].B.SSS = 1; /* Pad PA6: Source signal is E0UC_6_G */
SIUL2.MSCR[6].B.OBE = 1; /* Output Buffer Enable on */
SIUL2.MSCR[6].B.SRC = 3; /* Pad PA6: Full strength slew rate */

eMIOS_0.MCR.B.GPREN = 1; /* Enable global prescaled clocks */
eMIOS_0.MCR.B.GTBE = 1; /* Enable global time base */

Is the configuration correct? 

1 Reply

391 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

with this code the pulse does not appear as comparators are disabled. You need to write to CADR/CBDR after DAOC mode is selected.

BR, Petr