On Thu, 29 Jan 1998 19:04:27 -0600 John Payson writes: >> >> At 17:02 1998-01-29 -0600, you wrote: >> >Assuming the displays are common-anode, you'd use NPN transistors. >To drive >> >a digit, you set its common wire HIGH, set the appropriate segment >wires LOW, >> >and let the other lines FLOAT. If you want decimal points, then >you can get >> >9 digits with 9 I/O pins. >> > >> Nice and Smart! >> We got to have different segment maps for each digit, but thats just >> porgramming This is a very good idea. The major problem is that most multi-digit LED arrays are internally wired with all the segments connected together for standard multiplexing. They could not be used with this method. If you use seperate LED digit units, then they could be wired as needed. This would also work well for a moderate number of discrete LEDs connected to a small number of port pins. > >It's not even that bad. Assuming you have the data for each digit >stored I think a general purpose routine could be used to adjust the data from one table to display properly on all digits. The 8 digits are: 0gfedcba - digit 7 g0fedcba - digit 6 ... gfedcba0 - digit 0 This data should be applied to the TRIS register (a 0 turns the segment on, 1 turns it off by setting the pin to input mode). The port register would have data of the form 10000000, 01000000, etc. The 1 bit turns on the digit. The 0 bits turn on segments as directed by the TRIS register. I'll assume the single-one selection byte is already available. The problem is then to generate the TRIS register byte from a byte of the form 0gfedcba. This is actually easy to do. Decrement the single-1 byte to form a mask: 01111111 - digit 7 .... 00000000 - digit 0 Make a copy of the data shifted one to the left. For mask bits which are 0, use the shifted data, for ones that are 1 use the original data. Finally, force the digit drive bit (the 1 in the selector byte) to 0. For example, consider digit 6. Selector: 01000000 Mask: 00111111 Data: 0gfedcba Data sh. gfedcba0 Result g0fedcba I'll leave the writing of PIC code to do this for someone else. _____________________________________________________________________ You don't need to buy Internet access to use free Internet e-mail. Get completely free e-mail from Juno at http://www.juno.com Or call Juno at (800) 654-JUNO [654-5866]