CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

LVD required BROWNOUT fuse?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Will Reeve



Joined: 30 Oct 2003
Posts: 209
Location: Norfolk, England

View user's profile Send private message Send e-mail Visit poster's website MSN Messenger

LVD required BROWNOUT fuse?
PostPosted: Wed Feb 23, 2005 9:03 am     Reply with quote

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







PostPosted: Wed Feb 23, 2005 10:01 am     Reply with quote

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

View user's profile Send private message Send e-mail Visit poster's website MSN Messenger

PostPosted: Wed Feb 23, 2005 10:28 am     Reply with quote

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







PostPosted: Wed Feb 23, 2005 3:13 pm     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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