PDA

View Full Version : Problem running from a 3v battery



tbirchall
- 9th September 2005, 23:29
I'm using a 16F628A which I believe should run as low as 2 volts. It works just fine from batteries providing just under 6 volts but not from 3 volts. The setup is a simple button to INT that triggers an LED to blink. Bypassing the chip and powering the LED (though the resistor) lights up the LED just fine. I figured maybe the battery didn't have enough juice, so I connected the circuit to a line power supply set at 3 volts and it didn't work. Me thinks I'm missing something here...

Thanks,
Tom

mister_e
- 10th September 2005, 00:26
Did you also tried with the LF serie???

Did you try to disable the Brown-Out detect fuse???

F serie are suppose to work @ 3v under 10MHZ. See the Voltage-Frequency graph at the end of the datasheet.

I have a load (>10 000 units) of these F serie and LF serie on the market now running with a pair of AAA cells. No problem with them... as now...

Bob_W
- 10th September 2005, 00:31
Do you have the BOREN configuration bit set? If so, it looks like you'll be in brown out reset if you are under 3.65-4.00 volts.

Bruce
- 10th September 2005, 00:38
I think Bob has hit on the problem. You'll need to disable BOR, and stay below 10MHz oscillator frequency to run this PIC at 3V.

Bob_W
- 10th September 2005, 00:42
Actually, I think it was race to the finish between me and mister_e based on the timestamps. He said it also..... He must type faster than me : )

mister_e
- 10th September 2005, 02:16
hehe i had this impression of 'already said before' or "DEJA VUE' depending french ore english version you want to have.

Now that we are 3 with the same version/results... i must be true :)

tbirchall
- 10th September 2005, 22:10
I did try disabling the brown out and got interesting results. I think I mentioned above that I have a button triggering an interrupt that flashes an LED. Well, with brown out disabled, the LED constantly flashes. I don't have to press the button. (At least it runs, but not how I'd hoped.) I should have mentioned that I'm using the internal oscillator. Honestly, I'm not sure what it is running at. I think it defaults to 4MHz.

mister_e
- 10th September 2005, 23:41
Can you post your code?

tbirchall
- 11th September 2005, 02:06
The idea is that the chip sleeps until it gets an interrupt. This all works fine with 6 volts. I'm not setting the brown out to disabled here because I have to do it via the programmer (believe me, I've tried it both ways). I also set the internal oscillator with the programmer. It only has a setting for internal with or without the clock, not a frequency.

Code:



'----------------------------------------------------------------
' includes
'----------------------------------------------------------------
Include "modedefs.bas"

'----------------------------------------------------------------
' definitions
'----------------------------------------------------------------

'----------------------------------------------------------------
' constants
'----------------------------------------------------------------

'----------------------------------------------------------------
' variables
'----------------------------------------------------------------
i var byte

'----------------------------------------------------------------
' init
'----------------------------------------------------------------
init:

' set all VARs to zero
clear

' set configuration fuses
@ DEVICE pic16F628A, WDT_OFF ' turn watchdog timer off

' set up interrupt handler
INTCON = %10010000
OPTION_REG = 0
on interrupt goto handleInterrupt

low 7

' set portb/0 to input
TRISB.0 = 1


'----------------------------------------------------------------
' main
'----------------------------------------------------------------
main:

sleep 0
pause 1

' blink an LED on pin RB7
for i = 0 to 3

high 7
pause 300
low 7
pause 300

next

goto main

'----------------------------------------------------------------
' handleInterrupt
'----------------------------------------------------------------
disable
handleInterrupt:

' globally turn off interrupts
INTCON.7 = 0

' clear the interrupt triggered flag
INTCON.1 = 0
resume

enable

END


Thanks!

-Tom