Something like this should be a good starting point.
Cheers
Al.
Last edited by aratti; - 25th June 2014 at 12:31.
All progress began with an idea
Thanx
Can it also be done with a N-ch FET like the 2N7000 in some way?
Will this schematic work?
When u press a button the FET will switch on the 7805 and the PIC, and then I hold RA4 low as long I want the PIC to run.
The +BATT terminal is from a 9V battery and the datasheet says that RA4 can handle up to 14 volts if I have understand it right, so 9V on RA4 will be OK?
It wont work. Because if PIC doesn't have power supply, current still can be drown from pin, and that will be probably enough to turn on fet. Even if RA4 is open drain, you can put more than VDD+0.6 on that pin. If you do this, you will damage input buffer.
So you need to to put transistor to bring down gate. Depending on P FET you use and battery voltage, maybe you need to put another resistor to create voltage divider for gate.
EDIT:
![]()
Last edited by pedja089; - 28th June 2014 at 19:13.
Using a voltage regulator introduce some complication. You will feed 9 volts to your inputs and this will demage your pic. You need to isolate in same way your pic (both input and output) see the attached suggestion. (remember that all the input must be pulled up)
Cheers
Al.
All progress began with an idea
Will this work then?
PORTB are using internal weak-pullups, and I keep RA0 high as long as I want the PIC to run.
Bookmarks