Harrison Cooper wrote: > The PIC won't be able to drive a speaker very well, so I figure to put > some sort of audio amp, and if memory serves me right, National has > some new ones that have a digital volume control (8 bit port or > something like that....have to search the website for that), It's going to be expensive! A PIC has ternary outputs (1,0,off) so three outputs give you 27 levels. Four outputs gives 81 levels so if you allow for driving alternately positive and negative, you have 40 possible output amplitudes plus "off". The difference between 39 and 40 won't be too noticeable however, while the difference between 2 and 3 will. But for your purpose of a warning tone, that should work quite well. An LM386 (standard component in sound cards) is a good cheap amplifier. Note that horn speakers have a quite awful frequency response below their aperture cut-off. IOW, you use resistors on the output pins in ratios of three, e.g.: 100k, 33k, 10k, 3k3 and a pair of 2k2 to each rail (sets the quiescent value to ¸Vcc). Capacitor from this common point to the amplifier input. The actual output code consists of two nibbles for each volume; a TRIS mask and an output code. Could use a lookup table, 40 entries. A square wave is generated by complementing the output code, same as ever, switching on/ off by TRIS to the volume code or all input. Easy? -- Cheers, Paul B.