Well first question is are you generating square waves or sine waves If you want the quick and dirty answer you can use Pulse width Modulation Example ( this is a 4 level but you can expand it ) Output on a single line Volume level 1 = ~___~___~_______________~___~___~_______________ Volume level 2 = ~~__~~__~~______________~~__~~__~~______________ Volume level 3 = ~~~_~~~_~~~_____________~~~_~~~_~~~_____________ Volume level 4 = ~~~~~~~~~~~~____________~~~~~~~~~~~~____________ A Higher Tone in Valume 2 = ~~__~~__________~~__~~__________~~__~~__________ A Lower Tone in Volume 2 = ~~__~~__~~__~~__~~__~~_______________________~~__> _ = 0 ~ = High You now use a small Cap to filter the higher frequencies that this trick will produce To write the code will require a little planning with some loops If you need a Sign wave thats another trick Archmage PS before people ask i gave allot of detail for the newbies, Hey i found out about this mailing list from a high school kid that make robots for fun, who knows what kind of people are lurking in this list PSS and for my bad spelling : Bad Spellers of the World Untie ----- Original Message ----- From: "Richard Sloan" To: Sent: Wednesday, March 20, 2002 1:02 AM Subject: [EE]: digital volume for tones Lets say you are generating some tones into a mono headphone, what could be used to give say 32 levels of volume and also function as the headphone driver? Any ideas? I am thinking along the lines of 5 IO lines on a PIC processor adjusting in and out resistors on some type of opamp? Ideas? Richard. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.