|
|
View previous topic :: View next topic |
Author |
Message |
JohnLeung
Joined: 18 May 2004 Posts: 15
|
'Pop' noise following each sqaure tone |
Posted: Tue Aug 24, 2004 4:05 am |
|
|
I am using port C.2 to generate two square pulses of 625Hz and 725Hz from PORTC.2 to generate a simple DING DONG alert tone for a calling system. When the PORTC.2 is fed to a simple buzzer, the tone was good. However, for public annoucement, I need to feed the PORTC.2 via a bandpass filter of 500Hz<->1000Hz to a 5W amplifier. There is annoying 'pop' noise right after each DONG tone.
I just wonder if it is intrinsic to the square tone because it is a discrete 0-5V voltage level.
Is there any way to eliminate it the pop noise?
Any help would be grateful.
[email protected]
John Leung |
|
|
Ttelmah Guest
|
Re: 'Pop' noise following each sqaure tone |
Posted: Tue Aug 24, 2004 4:43 am |
|
|
JohnLeung wrote: | I am using port C.2 to generate two square pulses of 625Hz and 725Hz from PORTC.2 to generate a simple DING DONG alert tone for a calling system. When the PORTC.2 is fed to a simple buzzer, the tone was good. However, for public annoucement, I need to feed the PORTC.2 via a bandpass filter of 500Hz<->1000Hz to a 5W amplifier. There is annoying 'pop' noise right after each DONG tone.
I just wonder if it is intrinsic to the square tone because it is a discrete 0-5V voltage level.
Is there any way to eliminate it the pop noise?
Any help would be grateful.
[email protected]
John Leung |
The problem, is that when you stop sending the tone, the pin sits at 0v, or 5v. The 'mean' voltage of the square wave (assuming the mark-space ratio is 50:50), is at about 2.5v, so there is a sudden shift in the DC offset, by this much, when you start or stop the tone.
Try this instead. Have a pair of resistors (perhaps 2.2K each), with one running to the +5v rail, and one running to the 0v rail, attached to the output pin. Then when you stop sending, change the pin to be an input (change TRIS, or if you are using standard_io, perform an 'input' on the pin). The resistors will then keep the pin biased to about 2.5v, when not sending anything. When you send, change the pin back to being an output, and send the tone. This way, there should only be a tiny shift.
Best Wishes |
|
|
Haplo
Joined: 06 Sep 2003 Posts: 659 Location: Sydney, Australia
|
|
Posted: Tue Aug 24, 2004 5:56 am |
|
|
Just a quick note: I don't think it is a good idea to set that pin to input and hold it biased at 2.5v. This may cause both MOS transistors at the output stage to turn on and form a low-resistance path from VDD to GND. Quoting from the datasheet:
Quote: |
Analog levels on any pin that is defined as a digital input (including the AN7:AN0 pins), may cause the input buffer to consume current that is out of the device specifications.
|
You can try this: Gradually change your duty cycle from 50% to 0% in the last 100ms or so of your 'DONG' tone. This may do the trick. |
|
|
Ttelmah Guest
|
|
Posted: Tue Aug 24, 2004 8:38 am |
|
|
Haplo wrote: | Just a quick note: I don't think it is a good idea to set that pin to input and hold it biased at 2.5v. This may cause both MOS transistors at the output stage to turn on and form a low-resistance path from VDD to GND. Quoting from the datasheet:
Quote: |
Analog levels on any pin that is defined as a digital input (including the AN7:AN0 pins), may cause the input buffer to consume current that is out of the device specifications.
|
You can try this: Gradually change your duty cycle from 50% to 0% in the last 100ms or so of your 'DONG' tone. This may do the trick. |
One other thought would be to use one of the analog input pins, and switch it to become an ADC input, instead of a digital input. However 2.5v, _should_ be OK, provided the pin has a TTL input buffer, since 2.5v, is defined as a 'high' level (much TTL circuitry, only guarantees to drive to 2.4v, and the input 'high' level for the TTL buffers is 2v min). However port C, as Schmitt input buffers, so this problem could definately apply...
Best Wishes |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|