• AVR Freaks

Sleep current 6mA

Page: < 12 Showing page 2 of 2
Author
Sobottech
Super Member
  • Total Posts : 253
  • Reward points : 0
  • Joined: 2015/12/02 03:32:17
  • Location: 0
  • Status: offline
Re: Sleep current 6mA 2017/11/19 08:41:33 (permalink)
0
Hm, you should not connect the MCRL-Pin directly to Vdd.
Look at DS30010118B-page 29 for RECOMMENDED MINIMUM CONNECTIONS.
#21
Sobottech
Super Member
  • Total Posts : 253
  • Reward points : 0
  • Joined: 2015/12/02 03:32:17
  • Location: 0
  • Status: offline
Re: Sleep current 6mA 2017/11/19 08:50:33 (permalink)
0
I would start for example with something like:
 
while (1)
{
// Add your application code
__delay_ms(1000);
LATAbits.LATA6 = ~LATAbits.LATA6; //Toggle LED RA6
}
 
and put a LED and a resistor on a PIN or better Osciloscope.
 
Just to see the program is running fine without resetting.
#22
Roldan88
New Member
  • Total Posts : 20
  • Reward points : 0
  • Joined: 2017/11/16 03:07:08
  • Location: 0
  • Status: offline
Re: Sleep current 6mA 2017/11/19 09:34:37 (permalink)
4 (1)
Normally MCLR is connected as suggested in "RECOMMENDED MINIMUM CONNECTIONS", but connecting directly to VDD makes no difference in the current, so I put to VDD to simplify.
 
I have an oscilloscope, toggling PIN A4 works fine:
 
 
Also, setting OSC2 as clock output, with my test code you can see the clock when is active:

 
And the clock when is in sleep:

#23
Roldan88
New Member
  • Total Posts : 20
  • Reward points : 0
  • Joined: 2017/11/16 03:07:08
  • Location: 0
  • Status: offline
Re: Sleep current 6mA 2017/11/19 09:36:55 (permalink)
0
All tests now are conducted with MCLR connected as suggested.
#24
Howard Long
Super Member
  • Total Posts : 676
  • Reward points : 0
  • Joined: 2005/04/04 08:50:32
  • Status: offline
Re: Sleep current 6mA 2017/11/19 09:39:15 (permalink)
4 (2)
I note that in your .zip file, the CLKO oscillator pin is set to digital I/O, so I'm not sure how you're detecting that it's in sleep.
 
Agreed regarding MCLR, 10k to Vdd is an excellent rule of thumb, although I'm not convinced this has anything to do with the OPs problem.
 
I'd also caution about using MCC, it's bug ridden, I have zero confidence in it. While I realise it doesn't equate with today's instant gratification model, you're going to have to use and understand the datasheet and errata anyway, so I don't see what value MCC adds.
 
I don't have your chip, but this is some code on a PIC24FJ128GA202 on a solderless breadboard which consumes 3.8uA at 3.3V.
 

// CONFIG3
#pragma config SOSCSEL = OFF // SOSC Selection bits (Digital (SCLKI) mode)
#pragma config PLLSS = PLL_FRC // PLL Secondary Selection Configuration bit (PLL is fed by the on-chip Fast RC (FRC) oscillator)
#pragma config BOREN = OFF // Brown-out Reset Enable (Brown-out Reset Disabled)
// CONFIG2
#pragma config POSCMD = NONE // Primary Oscillator Select (Primary Oscillator Disabled)
#pragma config OSCIOFCN = OFF // OSCO Pin Configuration (OSCO/CLKO/RA3 functions as CLKO (FOSC/2))
#pragma config FNOSC = FRC // Initial Oscillator Select (Fast RC Oscillator (FRC))
// CONFIG1
#pragma config WINDIS = OFF // Windowed WDT Disable (Standard Watchdog Timer)
#pragma config FWDTEN = OFF // Watchdog Timer Enable (WDT disabled in hardware; SWDTEN bit disabled)
#pragma config JTAGEN = OFF // JTAG Port Enable (Disabled)
#include <xc.h>
#define FCY 4000000
#include <libpic30.h>
int main(void)
{
LATA=0;
LATB=0;
TRISA=0;
TRISB=0;
ANSA=0;
ANSB=0;

Sleep();

while (1)
{
Nop();
}
return 0;
}

#25
Roldan88
New Member
  • Total Posts : 20
  • Reward points : 0
  • Joined: 2017/11/16 03:07:08
  • Location: 0
  • Status: offline
Re: Sleep current 6mA 2017/11/19 09:45:24 (permalink)
0
Thanks, I will take a look.
 
Indeed in the .zip OSC2 is set as an I/O, I modified it right now to take the screenshots and show you that we can see the clock stopping.
#26
DarioG
Allmächtig.
  • Total Posts : 54081
  • Reward points : 0
  • Joined: 2006/02/25 08:58:22
  • Location: Oesterreich
  • Status: offline
Re: Sleep current 6mA 2017/11/19 09:45:28 (permalink)
3 (2)
Howard Long
 today's instant gratification model




<3 love this one wink !!

GENOVA :D :D ! GODO
#27
Roldan88
New Member
  • Total Posts : 20
  • Reward points : 0
  • Joined: 2017/11/16 03:07:08
  • Location: 0
  • Status: offline
Re: Sleep current 6mA 2017/11/19 09:56:54 (permalink)
0
Howard Long, I compiled your code and it draws exactly the same amount of current, 5.2 mA.
Maybe I damaged the part with an electrostatic dischargue?
#28
Howard Long
Super Member
  • Total Posts : 676
  • Reward points : 0
  • Joined: 2005/04/04 08:50:32
  • Status: offline
Re: Sleep current 6mA 2017/11/19 10:06:47 (permalink)
4 (1)
I don't know what scope you're using, but are you sure you're not loading any outputs?
 
I fiddled about with your code to make it run on a PIC24FJ128GA202 that I have in stock. After a dozen or so minor modifications (mostly around #pragma configs and removing pull up/ pull down SFR assignments), it built.
 
It's 1.33mA when the oscillator's running and 3.6uA in sleep after the 5s delay, all at 3.3V.
 
#29
Howard Long
Super Member
  • Total Posts : 676
  • Reward points : 0
  • Joined: 2005/04/04 08:50:32
  • Status: offline
Re: Sleep current 6mA 2017/11/19 10:11:36 (permalink)
4 (1)
Roldan88
Howard Long, I compiled your code and it draws exactly the same amount of current, 5.2 mA.
Maybe I damaged the part with an electrostatic dischargue?




Possibly, but before considering that I'd say there's something else afoot. From your earlier measurements, there's some significant static loading. As I mentioned before, are you sure your measurements themselves aren't adding uncertainty?
 
Perhaps the best lesson so far is to always have a spare or two ;-)
#30
Howard Long
Super Member
  • Total Posts : 676
  • Reward points : 0
  • Joined: 2005/04/04 08:50:32
  • Status: offline
Re: Sleep current 6mA 2017/11/19 10:13:33 (permalink)
0
By the way I tested my circuit with MCLR connected directly to Vdd rather than via a 10k and it made no difference, still 3.6uA.
 
#31
Howard Long
Super Member
  • Total Posts : 676
  • Reward points : 0
  • Joined: 2005/04/04 08:50:32
  • Status: offline
Re: Sleep current 6mA 2017/11/19 10:17:59 (permalink)
0
Just a thought, regarding loading, are you sure your scope isn't set to 50 ohm input with a 10x Lo-Z probe? That would explain your current readings reasonably accurately.
post edited by Howard Long - 2017/11/22 02:51:10
#32
Roldan88
New Member
  • Total Posts : 20
  • Reward points : 0
  • Joined: 2017/11/16 03:07:08
  • Location: 0
  • Status: offline
Re: Sleep current 6mA 2017/11/19 10:24:58 (permalink)
4 (1)
I do not follow you (English is not my mother tongue), what do you mean by "loading any outputs"?
 
I measure the current with a multimeter in series, I have tried different multimeters. I have also tried measuring indirectly with a 12.1 ohm shunt resistor, and the voltage drop was 60.7 mV (around 5 mA)
#33
Roldan88
New Member
  • Total Posts : 20
  • Reward points : 0
  • Joined: 2017/11/16 03:07:08
  • Location: 0
  • Status: offline
Re: Sleep current 6mA 2017/11/19 10:27:03 (permalink)
3 (1)
I just connected the oscilloscope to measure the clock, when I make the current readings everything is disconnected.
 
#34
Sobottech
Super Member
  • Total Posts : 253
  • Reward points : 0
  • Joined: 2015/12/02 03:32:17
  • Location: 0
  • Status: offline
Re: Sleep current 6mA 2017/11/19 10:42:11 (permalink)
3 (1)
Hm.
I would desolder the pic, just to check, if there is no current on the board/caps, if that's no problem.
The pic may be faulty, but they are robust.
The pic may be damaged, something is wrong with the board, maybe cleaning can help or some cap is damaged.
If the board without pic drains no current, an other pic would be great to check the current...
#35
Roldan88
New Member
  • Total Posts : 20
  • Reward points : 0
  • Joined: 2017/11/16 03:07:08
  • Location: 0
  • Status: offline
Re: Sleep current 6mA 2017/11/19 12:27:12 (permalink)
0
The PIC is in a breadboard, I tried various breadboards, including a top notch 3M breadboard. No current is drained without PIC, I tried different capacitors, even no capacitors at all.
I just ordered another sample from microchip an hour ago, when it arrives I will test it with extreme ESD caution.
#36
Howard Long
Super Member
  • Total Posts : 676
  • Reward points : 0
  • Joined: 2005/04/04 08:50:32
  • Status: offline
Re: Sleep current 6mA 2017/11/21 10:17:52 (permalink)
4.5 (2)
I tried your device PIC24FJ256GA702 today on the same solderless breadboard (plus an extra Vss that your chip uses that the other device I had didn't need).
 
With the original code you posted, it runs at 588uA for the first five seconds, then 5.3uA when in sleep.
 
With OSCIOFNC=OFF, and 10X probe loading, its 982uA then 5.7uA.
 
With OSCIOFNC=OFF, and no probe loading, its 807uA then 5.3uA.
 
Edit: debugger was disconnected for all current readings.
 
#37
Roldan88
New Member
  • Total Posts : 20
  • Reward points : 0
  • Joined: 2017/11/16 03:07:08
  • Location: 0
  • Status: offline
Re: Sleep current 6mA 2017/11/21 10:28:13 (permalink)
0
Thank you very much for your dedication to my problem. It seems increasingly probable that the PIC is faulty for some reason. I will update the thread when the new sample arrives.
 
 
Howard Long
I tried your device PIC24FJ256GA702 today on the same solderless breadboard (plus an extra Vss that your chip uses that the other device I had didn't need).
 
With the original code you posted, it runs at 588uA for the first five seconds, then 5.3uA when in sleep.
 
With OSCIOFNC=OFF, and 10X probe loading, its 982uA then 5.7uA.
 
With OSCIOFNC=OFF, and no probe loading, its 807uA then 5.3uA.
 
Edit: debugger was disconnected for all current readings.
 




#38
Roldan88
New Member
  • Total Posts : 20
  • Reward points : 0
  • Joined: 2017/11/16 03:07:08
  • Location: 0
  • Status: offline
Re: Sleep current 6mA 2017/11/30 08:27:42 (permalink)
4 (1)
Good day Howard Long and eveyone else that tried to help me,
 
The sample arrived and I plugged it to the board with maximum care. With the code I posted I obtain now coherent measurements.
We can close the case now, the previous PIC was indeed faulty or damaged, we will never know.
But from now on I will have extra ESD care regarding this kind of chips.
 
Thank you everyone for your help.
 
 
Howard Long
I tried your device PIC24FJ256GA702 today on the same solderless breadboard (plus an extra Vss that your chip uses that the other device I had didn't need).
 
With the original code you posted, it runs at 588uA for the first five seconds, then 5.3uA when in sleep.
 
With OSCIOFNC=OFF, and 10X probe loading, its 982uA then 5.7uA.
 
With OSCIOFNC=OFF, and no probe loading, its 807uA then 5.3uA.
 
Edit: debugger was disconnected for all current readings.
 




#39
Page: < 12 Showing page 2 of 2
Jump to:
© 2019 APG vNext Commercial Version 4.5