AnsweredAssumed Answered

PMF problem

Question asked by 歌 苏 on Sep 23, 2017
Latest reply on Sep 25, 2017 by 歌 苏

Hello community,

I'm working on a project using a s12zvm,My code is as following ,but it can not generate PWM in i/o port,I don't know why ,Can anyone give my some suggestion?

void initPMF(void){

PMFCFG0_EDGEA = 1;
PMFCFG0_EDGEB = 1;
PMFCFG0_EDGEC = 1; //01 23 45 complementary pwm pair and edge-aligned pwm

 

PMFCFG0_INDEPA = 1; //independent mode
PMFCFG0_INDEPB = 1;
PMFCFG0_INDEPC = 1;

PMFCFG2_REV0 = 1; // 01 PWM generator A generates reload event.
PMFCFG2_REV1 = 0;

PMFOUTB = 0x2A; // Low MOSFETs ON while SW control (Unipolar PWM) 01 23 45 complementary pwm pair

PMFCFG3_VLMODE = 0x01; // Writing to value register zero also writes to value registers one to five

//PMFFEN = 0 // Fault disabled
// .... (other fault registers)

PMFFQCA = 0; // Reload every PWM, Half-cycle disabled, f core / 1(25Mhz)

PMFMODA = 1250;
PMFDTMA = 13; //dead time

PMFCFG2 |= 0x3f; // mask all PWM outputs
PMFOUTC_OUTCTL = 0x3f; // all outputs in Software mode

 


PMFENCA_LDOKA = 1; // apply PMF Modulo value

PMFENCA_RSTRTA = 1; // 1 = PWM restart at commutation event

PMFENCA_PWMENA = 1;

//PMFENCA_PWMRIEA = 1; // Reload Interrupt - Used only for debugging

PMFCFG1_ENCE = 0; // buffered PMFOUTC, PMFOUTB, SWAPx and MSKx (change on commutation event)

PMFENCA_GLDOKA = 1; // 0 = Local LDOKA controls buffered registers / 1 = external Load OK controls buffered registers

 

MODRR1_PWMPRR =0x01; //PWM router
MODRR1_PWM54RR = 1;
MODRR1_PWM32RR = 1;
MODRR1_PWM10RR = 1;
}

 

Can you give me same advise?

Outcomes