You beat me to it! Well put. I would also add that the 595s allow you add more LEDs (or what ever) in units of 8 by chaining them. No real gymnastics needed, just pump the bits out via bit bang SPI (which is only slightly more complex than bsf/bcf). There is a practical limit but its pretty high. I used them on an LED light stick design - I've had as high as 128 working. The bike light project in the current Nuts and Volts could have benefitted from this approach. Another issue is board space. A 40 pin PIC takes up a lot more space than an 8 or 14 pin one. A 40 pin PIC seems like over kill to light up 32 LEDs. Phil --- Dwayne Reid wrote: > At 03:47 PM 5/26/2005, Byron A Jeff wrote: > > > > > > My favorite answer is a 12F509 + 2 74HC595s (to > drive > > > up to 16 LEDs) but I suspect thats not what is > being > > > looked for. > > > >It begs an interesting question. Why is that combo > better than > >a 28 or 40 pin PIC? > > I love questions like this . Why indeed? > > My usual responses: > > 1) I can use a smaller packaged PIC (6 or 8 pins if > the only thing is to > read a few switches and drive LEDs). > > 2) I can place the LED drivers near the LEDs and > connect with only 2 or 3 > lines plus power and ground. Handy if the PIC is > located elsewhere. > > 3) I can drive the LEDs from an un-regulated supply > and keep the PIC supply > nice and clean. (this is a trick answer: unreg > supply is about anywhere > from 3.3 to 6V if using 74hc595 or just about > anything at all if using > TPIC6595) > > 3b) Can drive reasonable sized relays instead of > LEDs if using TPIC6595. > > 4) 74hc595 are just SOooo darned inexpensive! Drive > 8 LEDs for 10 cents or so. > > 5) One of my boards has 40 status LEDs on it as well > as 3- 7 segment > displays. Also has 16 or so digital inputs (both > binary and trinary). All > driven with only 3 i/o lines from PIC. > > > No question: if this is a one-off hobbyist project > that needs only 12 LEDs, > spend the extra dollars and go for a larger PIC. > > But **I** would probably do it with a tiny PIC and > shift registers simply > because that's what I'm used to doing for larger > projects. And I just > happen to have several hundred (or more) little (1" > x 3") single-sided PCBs > that hold an 8 pin PIC, simple 5V zener PSU (with > JFET discharge circuit), > 2- trimpots wired for RC time measurements, 3- > digital inputs, 2- TPIC6595 > shift registers. The PIC section can be snipped > off, leaving the remainder > of the board with the 2- shift registers to > connected to previous boards to > make a SR chain as long as needed. They get used > for all kinds of simple > projects. > > dwayne > > -- > Dwayne Reid > Trinity Electronics Systems Ltd Edmonton, AB, > CANADA > (780) 489-3199 voice (780) 487-6397 fax > > Celebrating 21 years of Engineering Innovation (1984 > - 2005) > .-. .-. .-. .-. .-. .-. .-. .-. > .-. .- > `-' `-' `-' `-' `-' `-' `-' `-' > `-' > Do NOT send unsolicited commercial email to this > email address. > This message neither grants consent to receive > unsolicited > commercial email nor is intended to solicit > commercial email. > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist