> From: Scott Horton > > David: > > Thanks for the suggestion. Forgive my lack of understanding of speaker > electronics but I don't understand a couple of things...maybe you can > help. > > Your Suggested pseudo-code: > >>Beep > >> Turn_On_Speaker_Bit > >> Delay > >> Turn_Off_Speaker_Bit > >> Delay > >> Goto Beep > > I can't use a piezo buzzer of PC-speaker as you suggested. I actually > NEED to use a small headphone. The reason for this is that I need a user > to audibly detect an discreet event being monitored by my PIC. The device > will be used in a high noise (loud auditory) enviroment. They aren't > always looking at the led indicator which blinks, and can't hear something > on the device. > > Using you suggestion, how do I adjust volume, and tone on a set of > headphone speaker(s)? If the headphones are high impedance (>200 ohms) then drive them directly from a port pin, through a 1uF capacitor. If low impedance, use one of those mini 'transistor radio' transformers which have a 500ohm primary and 8ohm secondary. Again, drive the primary through a cap and connect the headphones to the secondary. I have used this arrangement to drive headphones and even a mini speaker. If not loud enough, you can add an extra 6dBm by using two outputs in bridge mode. To adjust the volume, use PWM. This is easy if you are using one of the PICs with PWM - you can even generate sine waves and arbitrary waveforms. It's still fairly easy if you have to program the PWM yourself. Regards, SJH Canberra, Australia