Hi, recently someone asked if it was possible to use the fact that PIC pins can be tri-stated to produce a different kind of DAC. (Using ideal components of coures.) The answer is that it requires an inverting op-amp with the +ve input at Vsupply/2. If you then use a R-3R-9R-27R network to sink and source current it is possible to get a reasonably linear response. (depending on how little current the tri-state input sinks) Each output can occupy three states Hi,Lo, or Tri. Here are the first few codes. Generating the remainder is left as an exercise for the three-fingered student from Sirius. MSB 2 3 LSB (R) (3R) (9R) (27R) 0 Hi Hi Hi Hi 1 Hi Hi Hi Tri 2 Hi Hi Hi Lo 3 Hi Hi Tri Hi 4 Hi Hi Tri Tri 5 Hi Hi Tri Lo 6 Hi Hi Lo Hi 7 Hi Hi Lo Tri 8 Hi Hi Lo Lo 9 Hi Tri Hi Hi It's probably not worth generating these codes from scratch, just use an 81 byte lookup table with one nibble containing the Port bits and the other the Tris bits. Have fun, Keith. P.S. The three fingered alien came from Sirius because everyone knows the little green men come from Alpha Centauri ;-) ========================================================== Keith Dowsett "Variables won't; constants aren't." E-mail: kdowsett@rpms.ac.uk WWW: http://kd.rpms.ac.uk/index.html