Content originally posted in LPCWare by mathseng on Wed Jan 15 17:33:38 MST 2014
Hi,
I am using LPCXpresso LPC1347. I tried all the examples in this thread, and found that I could not get PWM out until I had the duty cycle in MR0 and the period value in some other MR. The examples showed the addresses, but no mention of the need to match MRx with MATx, and of course, they used different PIOs.
I also found that I could reliably change the duty cycle at any time, without stopping the timer, nor needing to rely on interrupt code. I have not checked the waveform for the actual cycle when MR(dutycycle) is updated with the new duty cycle value. I would expect that there is a possibility of one period where the output is fixed for the full period - this is not an issue with my application.
FWIW - attached is my code, which runs happily with either a new LPCXpresso 1347 project, or with FreeRTOS.
mathseng
drat - you always find out more answers, just after you say something.