Em 9/9/2011 16:40, Kerry Wentworth escreveu: > Bob Blick wrote: >> I have done it in the past with only three PORTB pins and the CCP >> output. Instead of eight AND gates you use a 3 line to 8 line decoder >> like the 74HC138. Unfortunately the output is inverted so you need a >> stack of inverters. >> >> Instead of using AND gates you can use a resistor and diode per pin, but >> it's uncool unless you are desperate, and it loads the CCP output really >> hard. >> >> Cheerful regards, >> >> Bob > Or use a 74HC238, which is the same as a 74HC138 except the outputs are=20 > non-inverted. > > Kerry Or use a Johnson counter like the 4017 to make a ring counter with just one output at '1'. You would need just one I/O pin for the clock of the counter (perhaps one more to reset it in the case of a loss of synchronization, or better one input to monitor the "rest" output to know when the "1" is at it). Leave one output of the counter unused to be the "rest" place for the bit "1". Isaac --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .