microchip has a to92 voltage detector...... different voltages and draws 1 microamp....
http://ww1.microchip.com/downloads/e...Doc/21434g.pdf
microchip has a to92 voltage detector...... different voltages and draws 1 microamp....
http://ww1.microchip.com/downloads/e...Doc/21434g.pdf
@robbo78
That solution is not good for battery.
With zener regulator current draw from battery is same in if pic is sleep mode as in run mode.
If you use zener, then feed that voltage into analog pin, and then do ADC. This way current thru zener can be few uA instead few mA.
I don't know how wedded you are to the PIC12F683 but PIC12f617 looks similar but with a 0.6v ref but no EEPROM (although it can self write so that needn't be a show stopper).
PIC 12F1822 has FVRs and eveyrthing else you need.
I recently made a low battery warning for a 12V lead acid battery using a 12F675. B+ 12V powers the PIC through a 3.3V LDO regulator.The same B+ 12V goes to the ADC pin through a 220K resistor. The ADC pin then has 47K to ground. Here's the code I used. It flashes an LED when the battery gets weak. Perhaps you can tweak the code and circuit for your application to put the PIC in low power mode.
ANSEL = 0 'all inputs digital ADC command will convert it to analog
CMCON = 7 'comparators off
DEFINE OSCCAL_1K 1 ' Set OSCCAL for 1K device
TRISIO = %00000001 'INPUT ANA0 FOR ADC READINGS
GPIO = 0 'ALL OUTPUTS LOW
BATTEST VAR BYTE
@ DEVICE MCLR_OFF, WDT_ON, BOD_ON, PWRT_ON, PROTECT_ON
TEST:
Clear 'CLEAR BATTEST
ADCIN 0,BATTEST 'TEST CHARGE
IF BATTEST <= 166 Then GoSub BLINK
GoTo TEST
BLINK:
High GPIO.2
Pause 500
Low GPIO.2
Pause 500
Return
Oh yes, thats nice. I don't understand why I didn't find that in the truly horrible Microchip selector... but of course, it's terrible.PIC 12F1822 has FVRs and eveyrthing else you need.
@ pedja,
sheesh, your right, I'm not sure which datasheet I was looking at but it wasn't for the 12f683.
As others have pointed out there are other choices such as the 12f1822, etc. that do.
Dwight
These PIC's are like intricate puzzles just waiting for one to discover their secrets and MASTER their capabilities.
Good idea! I have just found this part which is a bit of a "cheat", and quite cheap? - http://www.farnell.com/datasheets/1669371.pdf@robbo78
That solution is not good for battery.
With zener regulator current draw from battery is same in if pic is sleep mode as in run mode.
If you use zener, then feed that voltage into analog pin, and then do ADC. This way current thru zener can be few uA instead few mA.
EDIT: Just realised that "amgen" already stated this
microchip has a to92 voltage detector...... different voltages and draws 1 microamp....
http://ww1.microchip.com/downloads/e...Doc/21434g.pdf
Last edited by robbo78; - 26th February 2016 at 19:06.
Bookmarks