We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi all, I am working on LPC 2292.I want to create an interrupt program which will make an LED to blink for 2sec and be OFF for 1 sec.I would like to know what values do I need to load into T0MR0 and T0PR registers to create an interrupt for every 1 sec.Is there any formula from which I can calculate these values? looking for your help. t.senthil
This doesn't sound all that hard. First, during the 2 seconds that the LED blinks, what is the blink rate. Looks like your planning on using timer 0. I think what would work good is using the timer to generate a single interupt that can be used to create a timer variable. To do this, you'll probably need to find the slowest interupt rate you can generate. It will probably be less than 1 second. Even still, if you can generate an interupt at 1mS intervals, you can increment a variable for every interupt and have a mili-second timer. While the timer variable is under 2000, you can blink your LED. When its between 2000 and 3000, the LED is off. After 3000, clear your timer variable and start over again. I can't help you much with the hardware because I'm not familiar, but you should be able to manage. Good Luck Andy