In the Ga Tech course (picbook.com) Peatman uses a 10 ms loop that is restarted with an interrupt. Each subprocess gets an opportunity in turn each loop tend to its function. The subprocesses are written in a fashion to tend to its function and return to the main loop. The simplest program on that site that illustrates the strategy is P3.asm. It may be there in C as well, I am not that deep yet. John Ferrell 6241 Phillippi Rd Julian NC 27283 Phone: (336)685-9606 johnferrell@earthlink.net Dixie Competition Products NSRCA 479 AMA 4190 W8CCW "My Competition is Not My Enemy" ----- Original Message ----- From: "Matt Redmond" To: Sent: Friday, September 26, 2003 1:32 PM Subject: [PIC:] General Program Strategy / Architecture > Hi All, > > I'm just getting started PIC programming. I'm pretty > comfortable with programming but my hardware experience is > very limited. I'm reading as much as I can but thought > I'd solicit some advice from the list, so here goes: > > My application will incorporate input from the user in the > form of button presses or IrDA communication. It (the > PIC) will also be talking to a realtime clock, RAM and one > or more serial peripherals. It will provide output to the > user in the form of flashes of one or more LEDs. > > During all of this, the program needs to remain responsive > to both the user's button presses and to anything coming > in from the various peripherals. > > I don't want my program locked up in tight delay loops > during things like flashing an LED - if that will affect > its responsiveness to input. > > How do most of you deal with issues like this? > > Should I incorporate a cheap 2nd PIC and use a few IO pins > to tell it what to present to the user? For example, 000 > = do nothing, 001 = single red flash, 010 = two red > flashes, etc... This would give me eight different output > options and my "primary" PIC could treat it as a 'one > shot' kind of deal - set the bits and forget about it. > > Am I on a decent track here - or are there better (or > cheaper) options? > > Also - do any of you know of an IC that will do both of > the following: (1) Multiplex serial devices so I can use > the PICs single UART to communicate with multiple devices, > and (2) Buffer incoming data so I can check it at my > liesure? > > Thanks for your time! > > Matt Redmond > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. > -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.