Hi,
Iam generating MCPWM with deadtime in LPC1768.but iam not able to generate dead time I read datasheet but it is not generating can anyone please help.below is my code
main()
{
SystemInit(); //Clock and PLL configuration
LPC_SC->PCONP |= (1<<17); /* Power ON Timer0,1 */
LPC_SC->PCLKSEL1 |=(1<<30)|(1<<31);
LPC_PINCON->PINSEL3 |= (1<<12)|(1<<6);
LPC_PINCON->PINMODE3 |= (1<<6)|(1<<7)|(1<<12)|(1<<13);
LPC_GPIO1->FIODIR |= (1<<19)|(1<<22);
LPC_MCPWM->MCCCP = (1<<0)|(1<<1)|(1<<2)|(1<<3);
LPC_MCPWM->MCCON_SET |=(1<<3)|(1<<31)|(1<<29);//|(1<<1)|(1<<9) ;
LPC_MCPWM->MCTIM0 = 0;
LPC_MCPWM->MCPER0 = 1000;
LPC_MCPWM->MCPW0 = 600;
LPC_MCPWM->MCDEADTIME = 0x100 ;
for(i=0;i<10000;i++)
for(j=0;j<1000;j++);
LPC_MCPWM->MCCON_SET |= (1<<0);
while(1)
{
}
}
Thanks
Hi gavi,
Is it working correctly without the dead time insertion?
I have reviewed the code snippet above and it seems to be correctly configured. You could also try using the LPC175x_6x CMSIS-Compliant Standard Peripheral Firmware Driver as reference for your application, it comes with a MCPWM driver:
Hope it helps!
Best Regards,
Carlos Mendoza
Technical Support Engineer