View previous topic :: View next topic |
Author |
Message |
ljb
Joined: 19 Nov 2003 Posts: 30
|
Can't get 18LF2620 below 500uA, can anyone help. |
Posted: Tue Nov 14, 2006 4:42 am |
|
|
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
|
|
Posted: Tue Nov 14, 2006 5:22 am |
|
|
Do you have all your peripherals shutdown prior to sleep?
CCP
Timers
Brownout
PortB Pullups
Everything? |
|
|
Ttelmah Guest
|
|
Posted: Tue Nov 14, 2006 5:48 am |
|
|
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
|
|
Posted: Tue Nov 14, 2006 6:05 am |
|
|
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
|
|
Posted: Tue Nov 14, 2006 6:11 am |
|
|
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
|
|
Posted: Tue Nov 14, 2006 6:32 am |
|
|
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
|
|
Posted: Tue Nov 14, 2006 6:52 am |
|
|
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
|
|
Posted: Tue Nov 14, 2006 8:17 am |
|
|
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
|
|
Posted: Tue Nov 14, 2006 5:19 pm |
|
|
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. |
|
|
|