|
|
View previous topic :: View next topic |
Author |
Message |
Will Reeve
Joined: 30 Oct 2003 Posts: 209 Location: Norfolk, England
|
LVD required BROWNOUT fuse? |
Posted: Wed Feb 23, 2005 9:03 am |
|
|
Hi all,
I am playing with the low voltage detect feature of the PIC18F452, it seems that to get the LVD to work I need the BROWNOUT fuse set. I can't see why this is as the data sheet doesn't mention it. I want to be as tight as possible with current, at the moment I have 50uA in sleep mode with the BROWNOUT fuse. If I set the NOBROWNOUT fuse the PIC won't enter sleep at all...any ideas?
Keep well,
Will |
|
|
Ttelmah Guest
|
|
Posted: Wed Feb 23, 2005 10:01 am |
|
|
You realise that the LVD interrupt will wake the processor from sleep?. Hence if you are sending it to sleep without disabling LVD, it'll wake up again.
With the brownout reset enabled, the processor will go into a shutdown mode if the voltage drops below the brownout voltage, not 'sleep'.
The point about LVD, is it allows you to execute code _before_ the procesor stops. You could (for instance), have an interrupt routine, which then turns off the voltage reference circuit (this is drawing quite a lot of your 50uA), disabled the LVD interrupt, and puts the processor to sleep. However remember you then have the responsibility to wake the chip up again, when the power is restored.
Have a look at document 70056b on the Microchip site, which describes how to use the LVD.
Best Wishes |
|
|
Will Reeve
Joined: 30 Oct 2003 Posts: 209 Location: Norfolk, England
|
|
Posted: Wed Feb 23, 2005 10:28 am |
|
|
I disable the interrupt and set LVDEN to 0 before issuing sleep(); what is strange is that if BROWNOUT fuse is set everything works perfectly, however if I use NOBROWNOUT the pic never goes to sleep (or maybe it does then as you say wakes up instantly). The only interrupts I have enabled during sleep are INT_RB for the buttons. I don't use the WDT at all. I'm off to read that document. Cheers,
Will |
|
|
Ttelmah Guest
|
|
Posted: Wed Feb 23, 2005 3:13 pm |
|
|
Key thing. You need to clear the interrupt 'flag', as well as just disabling the interrupt (do this after disabling the module). Basically, if it has triggered in the past (even during power up), the flag will already be set. Wake up, does not require the interrupt to occur, just the flag to be set... :-)
LVD does work without brownout enabled on the chip (I use it).
Best Wishes |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|