PDA

View Full Version : [16F871] Power on RA4 before power on vdd?



Buzzz
- 31st August 2005, 11:31
Hello folks!

I am using a PIC16F871, with a voltage regulator (with power switch) for Vdd. I want to use RA4 as open drain output connected to a buzzer (BZ) which is powered directly from battery. Will I fry my 871 when Vbatt is connected to the buzzer, but no Vdd is present at the PIC? Or will it start buzzing when Vdd is not present?
In other words: What will happen when the switch is opened in this schematic:



F871
----
| ____
RA4 |-------|_BZ_|--------------------------
| |
Vdd |------\ -----------+5V ---regulator -------- +7.2V
| switch
----
|
GND


Thanks for your help!

Melanie
- 31st August 2005, 21:34
No pin on a PIC should be at a higher potential than Vdd, and certainly NOT highter than the max rating in the Datasheet (which is usually around 5.5v). Some PICs are rated to run to 12v. Check the Datasheet.

Buzzz
- 1st September 2005, 08:33
I have been looking around, and it seems like I am allowed to put a higher voltage on pin RA4. Copy-paste from datasheet:



Absolute Maximum Ratings †

Voltage on any pin with respect to VSS (except VDD, MCLR. and RA4) ... -0.3V to (VDD + 0.3V)
Voltage on VDD with respect to VSS ................... -0.3 to +7.5V
Voltage on MCLR with respect to VSS (Note 2) ........0 to +13.25V
Voltage on RA4 with respect to Vss .......................0 to +8.5V

I am using the PIC at 5V, so I thought that voltage on any pin would be Vdd + 0.3V, so that would be 5.3V max.
The line about RA4 simply says 0 to +8.5V, so I assume that I am allowed to sink 25mA's max at 8.5V max since I am using RA4 as an Open Drain output.

So this would leave me with the problem that I don't know whether I am allowed to connect the buzzer directly to 7.2V, and whether it will fry my PIC whenn Vdd is switched off? Also, am I getting the first part right?

Acetronics2
- 1st September 2005, 09:23
Hi, Buzz

Why not use a stupid N Mosfet ( 2N7000 or BS 170 ) to switch your Buzzer ???
It would provide all the insulation you need ...

just invert your output level ( better for Power-on response of the Buzzer... hmmmm ? ) or use a P-Mosfet ( BS 250 ) and buzzer between Drain and ground ...

Alain

PS : 13v ... doesn't make you remember something about programming your PIC ??? ... jam at sight !!!

Buzzz
- 1st September 2005, 09:33
Yes, a stupid mosfet or even a cheap ass transistor could be the solution. Problem is, that I already have a PCB, and even with redesign really no space for extra components, not even a TO92... :(
So that's why I would like to fix this with just a piece of wire between the (now unused) pin RA4 and the buzzer.

Acetronics2
- 1st September 2005, 09:39
Never soldered some components on your copper tracks and played with the cutter ??? ...
Time to learn !!!

Alain

PS: why not put your "piece of wire" to the 5v instead of 7v2 ??? just a track to cut ...
5v Buzzers also exist !!!

Buzzz
- 1st September 2005, 09:49
Normally, I would agree with you. I am very familiar with cutting traces and stuff (built several ground-planed spiderweb transmitters and so on ;) ). Problem is, that this design is already completed, several PCB's have been made, and I wouldn't like to rework them all with cutting traces and stuff. Feeding the buzzer with 5V gives me too much sound-loss.
I know I am starting to be a pain in the ass, but the solution like in my opening post would suit me best. I think I am going to sacrifice a PIC, and just see what happens. The 7.2V voltage probably wont't be the problem, the only thing I am afraid of, is that the PIC might not like the 7.2V being present when the Vdd-voltage regulator is switched off. I'll just see what happens, if it fries my PIC, I probably cannot bypass the extra FET-idea...

edit: unfortunately 5V buzzers are too "quiet". I ordered like 7 or 8 different types, but I didn't like any of them...
...my demands are just way too high... ;)

Buzzz
- 2nd September 2005, 11:27
All this effort for nothing... ;)
The buzzer appears to draw just over 30 mA's of current, even at 5V. So I will need a tranistor/fet anyways. So thanks for all your help, I am going to "spiderize" my PCB's.... :)

Melanie
- 2nd September 2005, 12:48
Why a Buzzer instead of a Piezo sounder which is cheaper, draws near no current of consequence and can be driven directly from a PIC via something as small as a 100nF decoupling Capacitor? Another consideration is some buzzers have a serious back-emf problem which will blow your PIC's I/O (or even an external transistor) in no time flat unless you add suppression (more PCB real-estate eaten away).

Acetronics2
- 3rd September 2005, 09:12
All this effort for nothing... ;)
The buzzer appears to draw just over 30 mA's of current, even at 5V. So I will need a tranistor/fet anyways. So thanks for all your help, I am going to "spiderize" my PCB's.... :)

Hi Buzzzz

I understand ... I was caught on this, somtimes ago ... But I was lucky ( or careful ??? ) , it was just the proto board ...

Alain

Mike, K8LH
- 3rd September 2005, 13:57
Just a thought -- we use miniature Soberton GT111P speakers which can be connected directly to a PIC pin on 3.3v or 5.0v products and they work quite well...

Good luck with your project... Regards, Mike

Bob_W
- 4th September 2005, 18:29
I'll just see what happens, if it fries my PIC, I probably cannot bypass the extra FET-idea...

edit: unfortunately 5V buzzers are too "quiet". I ordered like 7 or 8 different types, but I didn't like any of them...
...my demands are just way too high... ;)

Take a look at these http://www.mallory-sonalert.com/catalog_sonalert_index.htm
The've got a whole bunch of sounds, and all the 5 volt ones will run directly from RA4 - no diodes, no hacking, no popped PICs.

Buzzz
- 5th September 2005, 08:32
Thanks for the help and ideas! I'll go and see what will suit my project best!

Melanie
- 5th September 2005, 09:41
> unfortunately 5V buzzers are too "quiet"

I thought this way once. But trust me, if you hit the correct resonant frequency of a Piezo transducer, you'll bring the house down! Your mobile phone Ringer loud enough set to full volume? It's probably running at 3v!

Luciano
- 5th September 2005, 17:48
you'll bring the house down!
Buzzdozer???

Piezo transducers are available with or without built-in oscillator.

If you use a transducer without built-in oscillator you will have to
drive it with software or, if available, with a hardware PWM of the PIC.

Luciano