HI, I've been using the PWM module to generate a timing signal for my project using the LPC 2129 the problem is that while the simualtion for the same circuit is flawless it refuses to work in the hardware. Example codes on the other hand work fine but my timing code refuses to work. I've put up the code as well pls help
#include <LPC21XX.H> //void delay(void); //int del; int main(void) { //unsigned int delay; PINSEL0 = 0x000A8002; //Enable pins PWM2 PWMPR = 0x00000000; //Load prescaler PWMPCR = 0x00005650; //PWM channel 4&6 double edge control, 1,2 single, output enabled PWMMCR = 0x00010000; //On match with timer 5 reset the counter PWMMR0 = 0x0000004B; PWMMR1 = 0x000000E1; PWMMR2 = 0x00000195; PWMMR3 = 0x000000C3; PWMMR4 = 0x000000E1; PWMMR5 = 0X000003FF; PWMMR6 = 0x0000004C; PWMEMR = 0x00000280;//copied this from the example removing it doesnt make a difference PWMLER = 0x0000007F; PWMTCR = 0x00000002; PWMTCR = 0x00000009;// enable timer n pwm while(1) // main loop { ; } }
Thanks in advance