> > > The "hello world" of the PIC is to blink an LED tied to a pin. I have watched > > several people implement this and have one warning: > > If you can't see the LED blinking, check with a 'scope. PICs aren't very good > > at wasting time! The LED may be blinking faster than you can see it. > > I would suggest an easy remedy to this is to use a bipolar LED (one of > the two-lead red/green types, available at Radio Shack or any mail-order > electronics house) connected as shown: > > Gnd----[220ohm]---+---[220ohm]----+5 > | > +---[LED]------- Port pin > > Although this circuit will waste 10 mils when idle [there are ways around > that] it will provide a clear indication whether the port is solid high, > solid low, tri-stated, or switching between two of those states. Note too > that this can be a useful trick for driving more than one "independently- > controlled" LED from a port pin. Hmmm, I was having a discussion about bipolar LED's driven by PIC pins in one of my classes I'm teaching this summer just this morning. The objective was to drive 6 bi-polar LEDS (2 pin) using as few PIC port pins as possible. Each LED should be able to show red,green,yellow, and off. The design I hit upon after thinking a bit revolved around multiplexing the 6 LEDs utilizing a common pin on one side. Something like: Port pin---+-[220ohm]--+---[LED]------ Port pin | +-[220ohm]--+---[LED]------- Port pin | +-[220ohm]--+---[LED]------- Port pin | +-[220ohm]--+---[LED]------- Port pin And so on. One led can be selected by tristating all but one port pin on the right side. The selected LED's color can be picked by twiddling with the left port pin and the one non-tristated port pin. The question that popped into my mind during this design discussion was the relevance of the position of the resistor. Does it matter if the resistor is on the anode or the cathode side of an LED. Is putting the resistor on the anode side simply a convention or is there some other reason that justifies its placement. Should a bi-polar have resistance on both sides (I've done this in previous designs)? THe above configuration would be ideal because the left port pin could be tied to the common terminal of a resistor pack somewhat simplifing the wiring. Thanks for any advice, BAJ