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 CCS Technical Support

Digital power switch

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



Joined: 28 Feb 2006
Posts: 151

View user's profile Send private message

Digital power switch
PostPosted: Mon Dec 29, 2008 12:24 am     Reply with quote

Hi! i am working on a 18f252 battery powered project... i use a standard power switch to turn on and off the circuit... but now i want to turn on and off the circuit by pressing a pushbutton... like a cellphone...

I tried a N CHANNEL MOSFET, but when i drive the gate low, the circuit turn off.. but not entirely...

any ideas???

i cant use the SLEEP function because the consumption on sleep mode is too high (300uA)

thanks!
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Mon Dec 29, 2008 1:37 am     Reply with quote

With appropriate configuration, the sleep mode current consumption can be as low as a few uA with most PIC devices. This requires, however, to disable oscillators and any additional internal load, e.g. brown-out detection. Also the port pins must be configured in a way that avoids additional current draw, particularly by floating inputs or loaded outputs and pull-up resistors.

An external switch transistor can further reduce the current, if required. It's difficult to understand, why your circuit doesn't operate as intended, without knowing the schematics.
championx



Joined: 28 Feb 2006
Posts: 151

View user's profile Send private message

PostPosted: Mon Dec 29, 2008 7:12 am     Reply with quote

I cant use SLEEP mode because the circuit have a few components that cant be turned off, like LCD, some zener diodes, etc.

I dont have the schematics. But i have succesfully use the sleep function on other proyects, but in this one, i have to make a DIGITAL SWITCH, any ideas?
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Mon Dec 29, 2008 7:33 am     Reply with quote

Quote:
I cant use SLEEP mode because the circuit have a few components that cant be turned off, like LCD, some zener diodes, etc.

You didn't tell, that the power consumption is from external parts. My usual solution is to use a switch for the external parts supply and Sleep mode for the processor. Either a NMOS/NPN switch in negative supply or PMOS/PNP switch in positive supply can do. Obviously you have to set the port pins connecting the switched peripherals to an appropriate state.
championx



Joined: 28 Feb 2006
Posts: 151

View user's profile Send private message

PostPosted: Mon Dec 29, 2008 7:36 am     Reply with quote

yes, i know, the problem is that the circuit is already made, so i cant modify the hardware, i just can add a digital switch to it.
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Mon Dec 29, 2008 8:16 am     Reply with quote

As mentioned before by FvM, it is difficult to help with your problem without knowing the schematics. Can you post a picture/drawing? Or describe in words how you connected the mosfet?

Using Google I found many 'power off' schematics, for example http://www.edn.com/archives/1996/120596/25di_03.htm
Does your setup look similar to this one?
championx



Joined: 28 Feb 2006
Posts: 151

View user's profile Send private message

PostPosted: Mon Dec 29, 2008 9:30 am     Reply with quote

hi ckielstra! i can give you a description:

Is a 18F252 at 20mhz
-I2C memory
-I2C RTCC
-LCD 16x2
-ONE ADC
-LDO 5v regulator.
-5 pushbuttons

The switch is between the pic and the 5v regulator. When turned OFF, it cut off the power from the circuit, except the RTCC.

I only replaced the switch for a 2n7000 Nchannel mosfet. But didnt worked...

I will try this circuit, do you know a P channel mosfet like the 2N7000 (to92)???.

thanks!
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Mon Dec 29, 2008 9:38 am     Reply with quote

If you switch off power to the VCC pin of a PIC but leave +5V going to any port pin (with a few odd exceptions) the protection diode of the port pin will forward conduct to the VCC bus of the chip, thus powering the PIC at a reduced voltage.

Maybe this is what you mean by the circuit turning off but not entirely.
_________________
The search for better is endless. Instead simply find very good and get the job done.
championx



Joined: 28 Feb 2006
Posts: 151

View user's profile Send private message

PostPosted: Mon Dec 29, 2008 9:42 am     Reply with quote

Hi SherpaDoug, no, i mean that the mosfet doesnt entirely cut off the power. I dont have any pin connected when vcc is off. The only thing connected is the RTCC bat pin.
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Mon Dec 29, 2008 10:03 am     Reply with quote

An NMOS switch connected to VCC would need a gate voltage above VCC for suitable operation. I already made a comment about the useful options with NMOS and PMOS transistors, I've nothing to add to.

Another point, I don't fully understand. You're talking about a voltage regulator. What is it's supply current? As far as I know, even said micropower regulators have about 100 uA supply current at no load. This doesn't sound well-thought. So, if you need voltage regulator and a supply switch, a regulator with disable as a LP2985 seems more suitable.
championx



Joined: 28 Feb 2006
Posts: 151

View user's profile Send private message

PostPosted: Mon Dec 29, 2008 11:13 am     Reply with quote

The regulator that i use have a very low current, about 5uA...
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