Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

16F628, how to get very low power consumption??

Status
Not open for further replies.

Mr RB

Well-Known Member
Hi, I've been working on a verbal voltage alarm using a TalkBot PIC controller. This has a PIC 16F628, 20MHz resonator and a low power low dropout +5v regulator and I am using the comparators to measure an analog voltage so the alarm sounds if the voltage is over/under X volts.

The idea is that it can be used for any basic alarm condition over/under voltage or temperature or light level etc etc and the TalkBot speaks a verbal alarm message. This may be of use for visually impaired and/or elderly people.

The power source will be 4 cells (AA or AAA) or maybe a 9v battery. I'm trying to get the PIC power consumption to a minimum. The other hardware is good, the +5v regulator, audio amp and eeproms only use a handful of uA when not playing the sound alarm.

Does anyone have any suggestions about how to get the PIC current down to the minimum? It only needs to check the alarm about twice a second as it is for slow changing signals like temperature or battery voltage. I have never done a very low power project using a PIC and comparators, so I would appreciate any tips re whether its worth turning the comps and vref OFF while in sleep mode, vs leaving them on so they are stable and not needing to be running for as long. Likewise i'm not sure about the other peripherals, timers etc if it is worth messing with them or even if an external resistor vref will use less power than the internal one etc etc.

Any tips are welcomed for leaving the PIC in a very low power sleep for 0.5 seconds, then minimising the total time/current needed to wake up and just check one comparator to test 1 voltage.
 

Pommie

Well-Known Member
Most Helpful Member
I can't help with the comparator configuration etc but would suggest switching the the 16F88 as this has a switchable oscillator. You could use the (low power) internal 32k oscillator during sleep/monitoring and switch to the 20MHz resonator when you need to play speech.

Mike.
 

Mr RB

Well-Known Member
Wow you're quick Pommie, i went to google for PIC appnotes for a couple minutes then checked and someone had posted a reply! :)

Hmm, i can't change the PIC because the TalkBot is a prebuilt module but I seem to remember the 16F628 does have switchable internal oscillators... If so it's a great option. I'll check into that.
 

Pommie

Well-Known Member
Most Helpful Member
Unfortunately, the 628 can't switch between the internal and external oscillators. So your stuck with the resonator.

Mike.
 

Mr RB

Well-Known Member
Yeah I've just been reading the datasheet. The 16F628 has a switchable internal RC osc, 4Mhz and 37kHz, but the config_ will be set to HS osc for the resonator... :(

Anyway it does look like I can leave the PIC in sleep with one comparator on, and use the comparator interrupt to wake it from sleep. So it could be permanently in sleep mode unless the comparator triggers the alarm.

But checking the specs now it looks like one comparator uses about 30uA and the vref module uses 135uA. So I really think it might be best to leave them off, using the watchdog (only 6uA) and then only powering up the comparator and vref twice a second for the actual measurement...

So the other problem now is to make a energy efficient 0.5 second sleep timer, then just wake the PIC up and do the voltage test. Looks like it will have to start the resonator up every watchdog woof just to keep the timer running...
 

Pommie

Well-Known Member
Most Helpful Member
So the other problem now is to make a energy efficient 0.5 second sleep timer, then just wake the PIC up and do the voltage test. Looks like it will have to start the resonator up every watchdog woof just to keep the timer running...

Isn't that just the WDT with a prescaler of 32?

Mike.
 

Mr RB

Well-Known Member
Yep. :) Can you tell it's been 6 years since I used a Watchdog timer? :eek:

(edit) WDT sucks. :( I have all these high speed fine-tuned C-ASM routines to get small code size and fast execution, and now I have to go through and cram CLRWDT instructions in everywhere - just so i can use the thing to wake from sleep mode... Grrr. Why didn't someone give it a on/off switch? Now I remember why I don't use the mongrel thing. ;)

(edit2) OK looks like I got it as low as it can go. In pure sleep mode (no wakeups) with everything turned off the whole PCB draws about 130uA. Then with the PIC running (ie sleep/wakeup) and checking the comparator at watchdog 1:1 (about 50 times per second) it's still less than 135uA. Hard to read an exact value with my 2.000mA range meter but there's no point trying to get it less than that.

Thanks everyone! (that means you Pommie! :) )
 
Last edited:
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top