On Friday 26 Sep 2003 9:32 pm, you wrote: > 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? > I would not recommend using an extra PIC, I think you can achieve what you need with just one. Your basic requirements are: 1. User input on e.g switches. A timer interrupt could be used to read/debounce/decode these on a regular basis. 2. Interfaces to RTC, RAM and a couple? If serial I2C?? peripherals. Assuming these are initiated by the PIC then this should be relatively straightforward. 3. Ouput by flashing LEDS. Depending on the intervals required either the same timer used in 1. above could be used or a separate one. The big unkons eem to me to be what you need to do between user input and user output plus the comnplexities of interfacing to the various peripherals. One obvious question is how much RAM do you need and what for? Ian -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.