AnsweredAssumed Answered

How to configure P0.10 as Match-Output?

Question asked by Lee JungWoo on Jul 25, 2020
Latest reply on Jul 26, 2020 by xiangjun.rong

Hello. I am using LPC1114FBD48. I want to use pin 29 (P0.10) as a PWM output. However, it is not output by PWM but always outputs "HIGH" status. I need help with what is the problem.

Let me briefly list the code I tried.

 

For reference, if I program another PWM output pin in the same order as the code below, it works fine.

 

enum { 
   PWM0_PORT = 0, 
   PWM0_PIN = 10, 
   PWM0_MASK = 0b1 << 10, 
   PWM0_IOCON = IOCON_PIO0_10, 
   PWM0_MODE = 0x3|(0x1 << 3) 
}

 

// configuration code

Chip_TIMER_Init(LPC_TIMER16_0);

iocon_set_mux(PWM0_IOCON, PWM0_MODE);

Chip_TIMER_PrescaleSet(LPC_TIMER16_0, 47);

LPC_TIMER16_0->PWMC = 1<<0 | 1<<2;                   // M0,M2 to PWM

LPC_TIMER16_0->MR[3] = 1999;

LPC_TIMER16_0->MCR = 0b010000000000;             // M3 is used to set PWM Cycle

Chip_TIMER_Enable(LPC_TIMER16_0);

 

 

// code to output pwm pulse.

LPC_TIMER16_0->MR[2] = 1000;

Outcomes