Myke, Here's two more, V3 -> o0 at Gnd, o1 at Vcc, o2 at High Impedance, V4 -> o0 at Gnd, o2 at Vcc, o1 at High Impedance, If the resistors are wired as shown here, you can parallel them to get more voltages. Obviously, you must choose your resistors wisely to get unique voltages. | o0 |--- R0 ---+--- Output | | | | | | o1 |----R1----+ | | | | | | o2 |----R2----+ | I am enjoying your book. Nice Job! Paul Date: Sun, 12 Oct 1997 10:27:40 -0400 From: myke predko Subject: Re: making sounds (with a pic and a speaker) Hiya, I just sent this reply back to Paul directly when I meant to send it to the entire list: Paul Webster Wrote: > Someone posted a two-resistor "ladder" array and stated it permitted >four levels or states. Wrong! Three output states for each resistor >makes nine, enough for quite detailed analogue sound output. Paul, could you explain how to do this with a Resistor ladder? The Best that I can do is n + 1 (where "n" is the Number of Resistors): | o0 |--- R0 ---+--- Output | | | R1 | | o1 |----------+ | | | R2 | | o2 |----------+ | With this circuit, I can get: Vcc -> o0 at Vcc, o1 = o2 = High Impedance Gnd -> o0 at Gnd, o1 = o2 = High Impedance V1 -> o0 at Vcc, o1 at Gnd, o2 at High Impedance, V1 = R1 / ( R0 + R1 ) V2 -> o0 at Vcc, o2 at Gnd, o1 at High Impedance, V2 = ( R1 + R2 ) / ( R0 + R1 + R2 ) Now, I suppose that multiple Outputs could be turned on to get parallel resistances, but I would be concerned about this with uneven current drive capabilities with different pins. This method would make it very hard to calculate the actual Voltage Outputs. There must be something I'm missing? Or is a circuit other than a ladder used? myke Check out "Programming and Customizing the PIC Microcontroller" at: http://www.myke.com ------------------------------