I suggest you put a resistor on the three I/Os for current limiting and connect two LED's antiparallel between each combination of two out of the three PINs. By driving one pin HI, the other LOW and switching the third to input you can switch on each of the LED's individually. If you switch the LEDs at fast speed you can make them appear to show all possible combinations / patterns. There is a little brochure from Microchip called 'Tips 'n Tricks' for 8pin devices - there quite a few clever ideas like this. Alternately you may use an 74HC595 shift register with latch to connect up to 8 LEDs. Not quite as elegant but still better than using two PICs. I just did something similar - I built a 'glittering star' for my 4yo daughter using a 12F629 driving 20 white LEDs directly (two times two out of five = 20). Tobias Ron Kneusel wrote: > Greetings- > > I've just started playing with microcontrollers and chose the 10F200 > because of its extreme simplicity. For a beginner's project, given > the approaching season, I thought it would be fun to make a simple LED > flasher Christmas ornament. I wanted a snowflake pattern with 6 LEDs > so I decided to use 2 10F200s, each controlling 3 LEDs and have them > run a very similar program which would give the illusion of one device > controlling all 6. > > The program works and everything looks great until you let it run for > awhile. Then things start getting out of sync. I am using the osccal > value for each device. While I didn't expect perfect synchronization > I had hoped it would last more than a few minutes. > > I thought that the code which set the LEDs on or off might take less > time in some cases, which would throw things off, but I don't think > this is the case. The remainder of the code running on the two > devices is identical aside from the bit pattern stored in W at various > steps. Here's the code to set the LEDs on or off. On input, W > contains the pattern in the lower 3 bits, 1=on, 0=off: > > test equ h'12' ; LED pattern > lights > movwf test ; keep pattern > bcf GPIO,2 ; clear all LEDs > bcf GPIO,1 > bcf GPIO,0 > btfsc test,2 ; LED 2 if set > bsf GPIO,2 > btfsc test,1 ; LED 1 if set > bsf GPIO,1 > btfsc test,0 ; LED 0 if set > bsf GPIO,0 > > Some might be saying: "Wait, if w already has the bit pattern, why not > replace all of that with a single movwf GPIO?" That's what I thought, > but it doesn't work. The code has seven patterns to play and with > that in place the first two seem to repeat endlessly.. odd. The same > thing happens if I add a movlw 0 and movwf GPIO ahead of loading the > desired pattern into GPIO in a single instruction. I even threw a few > nops in there between the two as a small delay. The above plays the > patterns I want but eventually the two devices get out of sync. This > happens when I power the devices with 2 AAA cells or use the benchtop > power supply at 5V. My understanding of how btfsc works is that if > the skip happens it is 2 cycles and if it doesn't it is 1 followed by > the 1 of the bsf so that regardless of the skip, those two > instructions always take 2 cycles to execute. > > Since the 10F200 doesn't allow for an external oscillator does anyone > have any ideas on: > > 1. Why these get our of sync so quickly and how I might prevent that? > 2. How to get a single device to control all 6 LEDs itself when only 3 > output lines are available? > > Any help appreciated! > > Ron > > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist