lpcware

Invert levels of CT16B1_MAT0 and CT16B1_MAT1

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by lennyk87 on Wed May 23 07:06:09 MST 2012
Hi guys,

I want the levels of Pins CT16B1_MAT0 and CT16B1_MAT1 to be inverted.

I need a PWM with the following parameters:


int main (void) {

    LPC_TMR16B1->TCR = 0;

    LPC_SYSCON->SYSAHBCLKCTRL |= (1<<8);

    LPC_TMR16B1->EMR = (1<<6)|(1<<1)|(1<<4)|(1<<0);

    LPC_IOCON->PIO1_9 = 1<<0;
    LPC_IOCON->PIO1_10 = 1<<1;

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

    LPC_TMR16B1->MR3     = 48000;
    LPC_TMR16B1->MR0    = 6000;
    LPC_TMR16B1->MR1    = 4800;

    LPC_TMR16B1->MCR = 1<<10;

    LPC_TMR16B1->TCR = 1;

    LPC_SYSCON->SYSAHBCLKCTRL |= 1<<6;
   
    while (1);
}


Now Pin CT16B1_MAT1 is low for 100µs and then high for 900µs, but I need it to be just the opposite way (high for 100µs, low for 900µs). Please don't consider me to change the values of MR0, MR1, MR3, I need them exactly like this.

Hope you can help me,

Lenny.

Outcomes