I'm looking for a single edge PWM example for the LPC2129. Thanks.
I've briefly read the user manual and what it tells me is: PWMMR0 sets the cycle rate. PWMMR1.. sets the pwm width the PWMMRx registers are a match register - therefore when the counter hits that value- something happens depending on the configuration. In the case of the PWM, the output is set and the counter reset when you get a match with PWMMR0 (this sets the overall period) and the outputx is reset when the counter gets a match with PWMMRx. So PWMMR1.. value is <= PWMMR0. Also, your counter clock is the peripheral clock which is 60MHz/4 = 15Mhz normally. So for a 1KHz PWM cycle - set PWMMR0 to 15000 (15,000,000 / 15,000 = 1000) unfortunately this gives you less than 16 bits of resolution - more like just under 14 bits. If you really need 16 bits of resolution then your PWM cycle would be 15,000,000 / 65536 = 228.8Hz. This is your tradeoff - more resolution = less frequency and vice- versa. As for your pwm width -at PWMMR0 = 15000, PWMMR1 = 7500 for 50% width. Your code will need to scale the values to suit. Read carefully section 16 in the user manual on the PWM - especially the note on the reset bit in PWMTCR - load the cycle time in PWMMR0 first! I, like most others are new to these parts and I am slowly exploring the features. I've haven't tried the PWM yet so take my words carefully!
You may use the Logic Analyzer that is built into the uVision Simulator to see the PWM output. In this way you can better analyze your algorithms.
How do you use the simulator to monitor a pin output? P.S. The PWM code is working =)
We have seen the problem with the update of the PWM pins in the meantime too. It works when you single step, but not when you run the code. It will get fixed in the next revision.