------=_Part_9192_32515167.1213908160531 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Tomas If you still want to try a hardware circuit - try this. You may want to change the resistor values as these are pretty dim but I needed to minimise current draw. By changing the ratio of the two 47k resistors the relative brightness between the 2 leds can be varied. Note that the PIC pin supplies the drive current to the LEDs so don't reduce the 1k resistor too much. Unfortunately not suitable for leds with a common anode or cathode (which I think is what you are after). Richard 2008/6/20 Olin Lathrop : > Tom=E1s =D3 h=C9ilidhe wrote: >> I've already got a 40-pin chip and I'm out of pins. > > There are plenty of 64 and 80 pin PICs. > >> Please elaborate on "external hardware". > > I don't want to get into this too much since I'm not convinced this whole > idea makes sense. However, imagine a resistor divider from a PIC output = to > the base of a transistor to ground (for NPN) or to Vdd (for PNP). You ca= n > arrange the divider so that the transistor is off when 2.5V is applied bu= t > on when 5V (NPN case) or 0V (PNP case) is applied. Put both the NPN and = PNP > circuits driven from the same PIC pin, and you've got three states. One > transistor is on, the other on, or neither. How to turn that into LED dr= ive > is left as a exercise to the reader (hint: it's not as trivial as you > probably think). > > There are other possibilities, like a both a NPN and PNP emitter follower= to > a 1/2 Vdd voltage divider. > > You could use a I/O expander. > > > ******************************************************************** > Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products > (978) 742-9014. Gold level PIC consultants since 2000. > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > ------=_Part_9192_32515167.1213908160531 Content-Type: image/gif; name=LEDDriver2.gif Content-Transfer-Encoding: base64 X-Attachment-Id: f_fhntfinx0 Content-Disposition: attachment; filename=LEDDriver2.gif R0lGODdhGQKkAfcAAAAAAIAAAACAAICAAAAAgIAAgACAgMDAwMDcwKbK8EAgAGAgAIAgAKAgAMAg AOAgAABAACBAAEBAAGBAAIBAAKBAAMBAAOBAAABgACBgAEBgAGBgAIBgAKBgAMBgAOBgAACAACCA AECAAGCAAICAAKCAAMCAAOCAAACgACCgAECgAGCgAICgAKCgAMCgAOCgAADAACDAAEDAAGDAAIDA AKDAAMDAAODAAADgACDgAEDgAGDgAIDgAKDgAMDgAODgAAAAQCAAQEAAQGAAQIAAQKAAQMAAQOAA QAAgQCAgQEAgQGAgQIAgQKAgQMAgQOAgQABAQCBAQEBAQGBAQIBAQKBAQMBAQOBAQABgQCBgQEBg QGBgQIBgQKBgQMBgQOBgQACAQCCAQECAQGCAQICAQKCAQMCAQOCAQACgQCCgQECgQGCgQICgQKCg QMCgQOCgQADAQCDAQEDAQGDAQIDAQKDAQMDAQODAQADgQCDgQEDgQGDgQIDgQKDgQMDgQODgQAAA gCAAgEAAgGAAgIAAgKAAgMAAgOAAgAAggCAggEAggGAggIAggKAggMAggOAggABAgCBAgEBAgGBA gIBAgKBAgMBAgOBAgABggCBggEBggGBggIBggKBggMBggOBggACAgCCAgECAgGCAgICAgKCAgMCA gOCAgACggCCggECggGCggICggKCggMCggOCggADAgCDAgEDAgGDAgIDAgKDAgMDAgODAgADggCDg gEDggGDggIDggKDggMDggODggAAAwCAAwEAAwGAAwIAAwKAAwMAAwOAAwAAgwCAgwEAgwGAgwIAg wKAgwMAgwOAgwABAwCBAwEBAwGBAwIBAwKBAwMBAwOBAwABgwCBgwEBgwGBgwIBgwKBgwMBgwOBg wACAwCCAwECAwGCAwICAwKCAwMCAwOCAwACgwCCgwECgwGCgwICgwKCgwMCgwOCgwADAwCDAwEDA wGDAwIDAwKDAwP/78KCgpICAgP8AAAD/AP//AAAA//8A/wD//////yH5BAAAAAAALAAAAAAZAqQB AAitAP8JHEiwoMGDCBMqXMiwocOHECNKnEixosWLGDNq3Mixo8ePIEOKHEmypMmTKFOqXMmypcuX MGPKnEmzps2bOHPq3Mmzp8+fQIMKHUq0qNGjSJMqXcq0qdOnUKNKnUq1qtWrWLNq3cq1q9evYMOK HUu2rNmzaNOqXcu2rdu3cOPKnUu3rt27ePPq3cu3r9+/gAMLHky4sOHDiBMrXsy4sePHkCNLnky5 suXLmDNHa97M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DgWojiKYVGKpuhtqcgaqLiK9uaK5AWL GCaLqdGKtHgVtniLVZGLujgVvNiLa0d+wIgZcDiMl/FVxqgZ3mMySMloGTnYh82YL3cIjdFoGHv1 i9VIYZiXjY8Bc9wYGd74jd24jeK4GOFYjo1Bgui4juzYju74jvAYj/I4j/RYj/Z4j/iYj/q4jyr8 2I/++I8AGZACOZAEWZAGeZAImZAKuZAM2ZAO+ZAQGZESOZEUWZEWeZEoGJmRGrmRHNmRHvmRIBmS IjmSJFmSJnmSKJmSKrmSLNmSLvmSMBmTMgc5kzR5HgEBADs= ------=_Part_9192_32515167.1213908160531 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist ------=_Part_9192_32515167.1213908160531--