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 !
I finally find the reason why it did not work, I initialized the GLDOKA bit too early, I just have to replace it at the end of the PMF_init and it works perfectly.
Thank you Daniel,
Thibaut
Hello dufour-thibaut@outlook.fr,
The charge pump does not power the LS drivers, these are ON out of reset if GDUF_GSUF = 1.
Do you see any GDU error flag?
Have you tried routing the PWM signals to GPIOs (in MODRR1) instead of the GDU and probe it?
Anyway, I sent some hands-on examples to your email.
I hope this can help you.
Regards,
Daniel
Hi danielmartynek,
Thank you for your answer, the only flag I have is GSUF = 1 "High-side FET pre-drivers turned off and low-side FET pre-drivers are turned on", so no error flag ON.
Yes I have try it as in other topics, but for my application I have to use the GDU and these GPIOs are enabled with other applications.
I did not receive the example, you can try at dufour-thibaut@outlook.fr
Thank you !!
Thibaut