lpcware

LPC1227 half-bridge PWM with deadtime

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by usafape on Mon Jul 02 07:40:01 MST 2012
Hi all,

Can someone shine me a light if this can be done? If so, can you give me an example? I am trying to drive a synchronous buck converter from it and the PWM outputs are not coming out right. Here's my code:

//Setting up the output pins
LPC_IOCON->PIO2_4 |= 0x03;        // - set bit 1 to connect pin to CT32B0_MAT0
LPC_IOCON->PIO2_5 |= 0x03;        // - set bit 1 to connect pin to CT32B0_MAT1
    LPC_GPIO2->DIR     |= (1 << 4);        // - select OUTPUT
    LPC_GPIO2->DIR     |= (1 << 5);        // - select OUTPUT

    LPC_SYSCON->SYSAHBCLKCTRL |= (1 << 9); //Enable lock to TMR32B0

    LPC_CT32B0->MCR |= (1 << 10);

    LPC_CT32B0->MR0 = 1000;
    LPC_CT32B0->MR1 = 1500;
    LPC_CT32B0->MR1 = 2000;
    LPC_CT32B0->MR3 = 2500;

    LPC_CT32B0->PWMC |= (1 << 0);
    LPC_CT32B0->PWMC |= (1 << 1);

    LPC_CT32B0->TCR = 1;


Thanks for you help.

Outcomes