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

Can't get 18LF2620 below 500uA, can anyone help.

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



Joined: 19 Nov 2003
Posts: 30

View user's profile Send private message

Can't get 18LF2620 below 500uA, can anyone help.
PostPosted: Tue Nov 14, 2006 4:42 am     Reply with quote

Hi,
I am running an 18LF2620 at just over 3v @ 1Mhz internal clock.
I have got the code down to outputing a serial message as a test that the code is running, then passing into sleep mode.
I am not waking the pic up so that I can monitor the current in sleep.
The serial connection has been removed and the only connection to the device is a battery. The current is approx 500uA.
What is the lowest current in sleep (waking on external int) and idle (waking on timer1 overflow)? I know what the data sheet specifies, but is this acheivable?
I am using the 18F2620.h, does this make any difference?
Thanks in advance for any help.
Les
jecottrell



Joined: 16 Jan 2005
Posts: 559
Location: Tucson, AZ

View user's profile Send private message

PostPosted: Tue Nov 14, 2006 5:22 am     Reply with quote

Do you have all your peripherals shutdown prior to sleep?

CCP
Timers
Brownout
PortB Pullups

Everything?
Ttelmah
Guest







PostPosted: Tue Nov 14, 2006 5:48 am     Reply with quote

The specified figure, is normally quite easily obtainable. I have usually found them to be slightly 'pessimistic'.
Add 'have you got any inputs left floating', to jecottrel's questions.
How are you generating the supply (it is amazing how often people are 'caught ot' by the current drawn by a voltage regulator)?.
Are you sure you actually are going to sleep?.

Best Wishes
ljb



Joined: 19 Nov 2003
Posts: 30

View user's profile Send private message

PostPosted: Tue Nov 14, 2006 6:05 am     Reply with quote

Hi,
I had the code in a loop sending a msg over a ttl serial link, then inserted a sleep in the loop. Running the code, the msg displayed once, I then disconnected the link so that the only thing connected to the pic was a 3v7 Li-pol battery.(giving 3v4)
I've tried ADC_OFF with some reduction, but I am still in the 100's of uA.
I've also tried setup_uart(false), but the compiler doesn't like this - any ideas?
Thanks
Les
jecottrell



Joined: 16 Jan 2005
Posts: 559
Location: Tucson, AZ

View user's profile Send private message

PostPosted: Tue Nov 14, 2006 6:11 am     Reply with quote

Post your setups(prior to sleep) and your fuses.

Try starting a fresh project with the project wizard and disable everything. That will give you a good start with all the possible setup statements.

Without a schematic and some code, that's about all that can be said....

John
ljb



Joined: 19 Nov 2003
Posts: 30

View user's profile Send private message

PostPosted: Tue Nov 14, 2006 6:32 am     Reply with quote

The source is listed below, and the schematic is of a 2620 with a 3v4 battery connected, once the serial link is removed.

//------System------
#include <18F2620>
#fuses INTRC_IO,NOWDT,NOPROTECT,NOMCLR,NODEBUG,NOLVP
#use delay(clock=1000000)

//------serial streams------
#use rs232(baud=9600, xmit=PIN_C4, rcv=PIN_C5, stream=remote, invert)


void init(void);


void init(void){
//any initialisation done here.
fprintf(remote,"\r\n\nInitalisation\r\n\n");
setup_oscillator(OSC_1MHZ);
setup_adc(ADC_OFF);
}



void main(void){
delay_ms(1000);
init();
while(true){
fprintf(remote,"test message\r\n");
sleep();
delay_ms(1000);
}
}
jecottrell



Joined: 16 Jan 2005
Posts: 559
Location: Tucson, AZ

View user's profile Send private message

PostPosted: Tue Nov 14, 2006 6:52 am     Reply with quote

Try this and see if this helps at all....


Code:


while(true){
   fprintf(remote,"test message\r\n");
   setup_oscillator(OSC_OFF);   // <----- Look in header for correct 'OSC_OFF' syntax
   sleep();
   delay_cycles(1);
   setup_oscillator(OSC_1MHZ);
   delay_ms(1000);
}





EDIT:

Just looked at the data sheet... it says that all clocks are disabled during sleep....

3.3
Quote:
Entering the Sleep mode from any other mode does not
require a clock switch. This is because no clocks are
needed once the controller has entered Sleep. If the
WDT is selected, the INTRC source will continue to
operate. If the Timer1 oscillator is enabled, it will also
continue to run.
Ttelmah
Guest







PostPosted: Tue Nov 14, 2006 8:17 am     Reply with quote

If the 'only thing connected', is the supply, set _all_ the I/O pins to outputs, and drive them low, before sleeping. A floating input, if it sits just at the voltage to be seen as a high/low/high transition, can result in significant power being drawn.
Turn off the comparator. This can draw significant power, especially if the inputs are floating. Also the voltage reference for this.

Best Wishes
ckielstra



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

View user's profile Send private message

PostPosted: Tue Nov 14, 2006 5:19 pm     Reply with quote

Is the serial link using a MAX232 alike interface chip? These chips can use a considerable amount of current even when the serial line is removed.
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