--- In lpc2000@yahoogroups.com, "killtheclock" <kurt.westphal@g...> wrote: > I have an olimex lpc2106-mt pcb and try to program a PWM without > success. The Docu is not especially detailed (I think). I tried a lot > of register settings(for hours). All I get is a single 88.64 ms pulse > on PWM4 at reset that does not change with the match register or pre- > scaler value. > > This code is one example that illustrates my understanding of that > thing: > //testing PWM4 > PINSEL0 |= 0x20000; // select pin 0.08 PWM4 function > PWM_PR = 0x0000; // max prescale counter value > PWM_MCR = 0x0002; // reset when PWMMR0 matches > PWM_PCR = 0x1000; // PWM4 enable, single edge > PWM_MR0 = 0x0f00; // match register trigger value > PWM_TCR = 0x0009; // set the TC counter and enable the PWMs > > I would expect a 1.92 kHz frequency from that... > Obviously I do something completly wrong. You also need to set PWM_MR4, and then PWM_LER before the PWM_MRx values take effect. Karl Olsen
Message
Re: PWM with olimex lpc2106-mt pcb - how to?
2004-07-20 by Karl Olsen
Attachments
- No local attachments were found for this message.