This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

PWM LPC2129

Hi. I found initialization code on KEIL website for the PWM on LPC2129. It uses 12Mhz oscillator.

Here is part of the code:

PWMPR = 0x00000001; //Load prescaler

PWMPCR = 0x0000404; //PWM channel 2 double edge control, output enabled
PWMMCR = 0x00000003; //On match with timer reset the counter
PWMMR0 = 0x000000FF; //set cycle rate to sixteen ticks
PWMMR1 = 0x00000080; //set rising edge of PWM2 to 2 ticks
PWMMR2 = 0x00000080; //set falling edge of PWM2 to 8 ticks
PWMLER = 0x00000007; //enable shadow latch for match 0 - 2
PWMEMR = 0x00000280; //Match 1 and Match 2 outputs set high
PWMTCR = 0x00000002; //Reset counter and prescaler
PWMTCR = 0x00000009; //enable counter and PWM, release counter from reset
//------------------------end-------------------

i dont understand how 0xFF in PWMMR0 means 16 ticks ? Also in PWMMR1 and PWMMR2 ?

0