On Fri, 26 Sep 2003 16:32:29 -0400, 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 >=3D do nothing, 001 =3D single red flash, 010 =3D 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! The answer to most of your questions is to use interrupts.=20 Stuff like LED flashing, buffering of input data, multiple serial ports, = key scanning can all happen in the background, so your main code can deal with it when it's ready, = while time-sensitive things are attended to promptly by the interrupt code. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.