Hello,
I'd like to use the GDU and PMF on a S12ZVMC64 to control a BLDC motor, firest I just try to get PWM signal on a TP, but I have nothing.
As seen below, I configure GDU and PMF, on the Gate of the Low-side transistor I have 10V, so the charge pump works but nothing else.
void GDU_init(void)
{
GDUE_GFDE = 1;
GDUCLK2_GCPCD = 2;
GDUE_GCPE = 1;
GDUDSLVL = 0x77; // desaturation level set at 1.4V for low-side and high-side drivers
GDUCTR = 0x13;
GDUE_GWP = 1; //Set at the end of the initialization
}
void PWM_init(void)
{
PMFCFG0_EDGEA = 1;
PMFCFG0_EDGEB = 1;
PMFCFG0_EDGEC = 1;
PMFCFG0_INDEPA = 0x0; // Complementary mode
PMFCFG0_INDEPB = 0x0; // Complementary mode
PMFCFG0_INDEPC = 0x0; // Complementary mode
PMFMODA = 1250;
PMFVAL0 = 750;
PMFDTMA = 13;
PMFCFG2_REV = 1;
PMFENCA = 0x04;
PMFCFG3_VLMODE = 1;
PMFENCA_LDOKA = 1;
PMFCFG1_ENCE = 1; // Enable commutation event
PMFOUTB = 0x2A; // Set return path pattern, high-side off, low-side on
PMFOUTC = 0x1C;
PMFENCA_GLDOKA = 1;
PMFENCA_PWMENA = 1;
PMFCFG0_WP = 1;
}
void main(void) /* PRQA S 1532 */
{
PWM_init();
GDU_init();
for(;;)
{
WatchDog_Clear(); /* feeds the dog */
PMFOUTC = 0x34;
PMFOUTC = 0x1C;
}
}
Thank you for your help !