Can someone show me how to get PWM output on LPC1115F/303 PIO2_5

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can someone show me how to get PWM output on LPC1115F/303 PIO2_5

479 Views
stevecole
Contributor I

My first try at PWM with an NXP chip  but I am having trouble getting output on the pins as shown below.

Can somebody show me what I am doing wrong. The code is messy with different number formats, I have spent hours fiddling with it.

LPC1115F/303

#ifdef __USE_CMSIS
#include "LPC11xx.h"
#endif

//#include <cr_section_macros.h>


int main(void)
{
/*32B0MAT0*/
// LPC_IOCON->PIO1_6 |= 1<<1;    //This works
LPC_IOCON->PIO2_5 |= 1<<0;       //This doesn't work. No output on pin

/*32B0MAT1*/
// LPC_IOCON->PIO1_7 |= 1<<1;    //This works
LPC_IOCON->PIO2_6 |= 1<<1;       //This doesn't work

LPC_SYSCON->SYSAHBCLKCTRL |= 1<<9;
LPC_TMR32B0->PR = 0x0;
LPC_TMR32B0->MCR = 1<<10;
LPC_TMR32B0->EMR |= (1<<5 | 1<<7);
LPC_TMR32B0->CCR = 0x0;
LPC_TMR32B0->PWMC = 0x03;
LPC_TMR32B0->MR3 = 8191;
LPC_TMR32B0->MR0 = 4095;
LPC_TMR32B0->MR1 = 6000;
LPC_TMR32B0->TCR |= 0x03;
LPC_TMR32B0->TCR &= ~(0x02);

while(1)
{

}
return 0 ;

Labels (1)
0 Kudos
1 Reply

288 Views
soledad
NXP Employee
NXP Employee

Thank you for your input!!

Have a nice day

Soledad

0 Kudos