View previous topic :: View next topic |
Author |
Message |
Christophe
Joined: 10 May 2005 Posts: 323 Location: Belgium
|
Pin on PIC drive |
Posted: Thu May 12, 2005 8:56 am |
|
|
Hi,
this is the scheme:
http://expand.xs4all.nl/uploadarchief/download.do?file=schma.jpg
I need to drive ENABLE_CHARGING LOW to disable charging. This means that the pin on the PIC (I'm using PIC16lF877A Vdd = 3V) is on Vadap via a pull-up resistor. Vadap = 8V ; can that harm the pic?
thx |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1907
|
|
Posted: Thu May 12, 2005 9:17 am |
|
|
That will definitely harm the PIC. Use a transistor to pull that line low instead.
PIC --- R --- base of BJT (or gate of FET), emitter (or source) to GND
The collector/drain of the transistor then goes to your ENABLE CHARGING line. The only difference is that now a logic high on the PIC line will bring ENABLE CHARGING low. |
|
|
Guest
|
|
Posted: Thu May 12, 2005 9:43 am |
|
|
There is another way without requiring additional components and without harming the PIC. Use RA5 of the PIC to drive this PIC. RA5 is open drain. |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1907
|
|
Posted: Thu May 12, 2005 9:53 am |
|
|
Good point, only it's A4 that's open drain, not A5.
The only thing is that A4 can only tolerate a maximum of 8.5V (first page of chapter 17 of the 877A's data sheet). If the line that it is connected to is a nominal 8V, it doesn't leave much room for error. |
|
|
Guest
|
|
Posted: Mon May 16, 2005 1:43 pm |
|
|
can I put a diode in series with the resistor? then I have 8V-0.7V = 7.3 op RA4 |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1907
|
|
Posted: Mon May 16, 2005 2:44 pm |
|
|
I guess so. I'm just overly cautious - experience has taught me to be that way. As I said before, I'd do things differently. |
|
|
|