'problem with pic outputs'
HI PIC Engineers.
I am using pic16c62 portb as output
I am driving LEDS and one buzzer.
Buzzer gets distorted signal.
I checked with digital scope I get this
I use BSF portb,RB3 ; sound when is high
My question is when you set any bit high shouldn't I get
clean 5 v signal or to have little distortion is normal.
How do you use buzzers with pics.
> I am using pic16c62 portb as output
> I am driving LEDS and one buzzer.
> Buzzer gets distorted signal.
> I checked with digital scope I get this
> | |
> I use BSF portb,RB3 ; sound when is high
> My question is when you set any bit high shouldn't I get
> clean 5 v signal or to have little distortion is normal.
> How do you use buzzers with pics.
I always use a transistor to turn on buzzers. Electromechanical
ones are not well suited to logic drive as they cause a lot of
inductive noise on the supply pin. Some of the Piezo devices
do work ok with just 5V but still safer to use a Transistor
and a freewheeling diode for any thing with large inductance
or capacitance (Piezo).
Not 100% sure if you have a drive problem or a resonance problem.
Many buzzers will only work well close to their resonant
frequency, they sound horrible at other frequencies.
Kalle Pihlajasaari ip.co.za kallehttp://www.ip.co.za/ip
Interface Products P O Box 15775, DOORNFONTEIN, 2028, South Africa
+ 27 (11) 402-7750 Fax: 402-7751 http://www.ip.co.za/people/kalle
DonTronics, Silicon Studio and Wirz Electronics uP Product Dealer
At 01:11 AM 8/11/97 -0700, Andre Abelian wrote:
Make sure you aren't exceeding the capacitance loading for the
particular part you are using. If its a piezo buzzer it likely
has a high capacitance across it. I've run into this and found was
able to get a higher sound level by putting a resistor in series
with the buzzer. I think I used 150 ohm. The buzzer I used required
me to clock out a 2khz signal.
| Jeff King Aero Data Systems |
| mich.com P.O. Box 510895 | jeff
| (810)471-1787 Livonia, MI 48151 |
|F(810)471-0279 United States |
|On Sun, 10 Aug 1997 20:57:14 -0400 Jeff King <MICH.COM> writes: jeff
I assume it is a piezo buzzer with built-in oscillator. These should
work fine directly from a port pin, as long as it uses less than 20 mA.
Electromechanical buzzers of the type with contact points are a definite
no-no since they will send nasty surges back into the PIC. Bare piezo
elements need you to clock out a signal of the proper frequency.
Possible sources of your trouble:
(a) There is a bug in the software, setting the port pin low or
configuring it for input when it isn't supposed to. This will naturally
turn the buzzer off.
(b) The buzzer is overloading the port pin. Check that the voltage is
close to 5V when the buzzer should be on. If not, other read-modify
write instructions to the port will turn it off even though they're not
supposed to. If the buzzer contains a capacitor in series with its power
supply it can create a transient overload that would cause a following
bsf or bcf to malfunction. My advice is not to use bsf/bcf [port pin],
xorwf [port],f etc. on ports that have any of their pins driving heavy
(c) The WDT is resetting the whole chip periodically. This will make the
ports go to inputs and turn the buzzer off until the tris registers are
set up again. Of course it will cause a lot of other problems as well,
which you may not be noticing because you're only trying to test the
buzzer now. Make sure WDT Off is selected in your programmer unless you
have clrwdt instructions in the proper place in the program. This is
about #2 on the list of PIC newbie mistakes.
Are you letting the WDT time out in your program causing it to reset your
program and reinitalise ? if so turn it off or clear it regularally this mabe
More... (looser matching)
- Last day of these posts
- In 1997
, 1998 only
- New search...