On Thu, Mar 04, 2004 at 09:22:54AM -0000, Michael Rigby-Jones wrote: > >-----Original Message----- > >From: Vlad [mailto:vlad@DOOM.NET] > >Is my hardware/software design flawed? What can I do to > >process user input quickly while preventing any dimming on the > >LEDs? This seems like a common thing and have follwed the > >wonderful suggestions on this list. I can provide more > >information like pictures and complete code, but I just wanted > >to feel this out and see if my problem is perhaps simply design related > > It's not inherrently flawed as such, but it's not the best way to do things. > You are apparently waiting around for 1ms each time you update the displays, > this time could be much better spent reading the input buttons etc. The > neastest way to run a multiplexed display is under a timer interrupt. The > CPU overhead is very small, and will leave you with lots of processing time > in your main loop to process users inputs etc. Hi Mike, Processing user input right now is simply reading the state of a pushbutton and incrementing a counter. (only a few clock cycles) but this is enough time for the LEDs to dim out while one of the transistors is turned off. With an interrupt routing wouldn't the same thing happen? I could be misunderstanding. I am/was under the impression that a timer interrupt gets triggered when a timer counter overflows. When this happens interrupt code is executed. But wouldn't I run in to the same problem? I'd just be idling elsewhere? Do you have some pseudo code? Maybe that would allow my head to get around this idea. Thanks -v -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.