PIC24FJ128GA306 sleep mode current: 16+ mA current consumption

Page: 12 > Showing page 1 of 2
Author
dwalkes
New Member
  • Total Posts : 15
  • Reward points : 0
  • Joined: 2016/02/02 11:36:21
  • Location: 0
  • Status: offline
2016/03/17 16:17:09 (permalink)
0

PIC24FJ128GA306 sleep mode current: 16+ mA current consumption

Hi Everyone,
I’m working on a migration from a design that used a 24FJ256GB110 to a similar design which uses a 24FJ128GA306.  This design includes a sleep mode state where I need minimum power consumption for longer battery life.  Both parts use the same firmware design with some conditional compiles for things like configuration bits and IO.
 
What I’ve noticed is that when I run the design on the 24FJ256GB110 I see a few hundred microamps on the VDD supply for IO and pic while the pic is in sleep mode.  If I run on the 24FJ128GA306 I see 16+ mA.
 
If I hold the 24FJ128GA306 in reset, current on the VDD supply drops from 16+ mA to a few hundred microamps, which I believe suggests that the current consumption is coming from either the processor or IO driven by the processor when the pins and IO registers are not in reset states.
 
I can see the same behavior on multiple devices, so it’s not limited to a single chip or board issue.
 
I’m using the primary oscillator in my design when in the mode that is sleeping, switched from the Fast RC oscillator which is configured out of reset.  My config bits are:
_CONFIG1(GWRP_OFF & JTAGEN_OFF & ICS_PGx3 & FWDTEN_WDT_SW & WINDIS_OFF & FWPSA_PR128 & WDTPS_PS4); 
 _CONFIG2(IESO_ON & FNOSC_FRC & OSCIOFCN_ON & POSCMD_HS & FCKSM_CSECMD & IOL1WAY_OFF); 
 _CONFIG3(SOSCSEL_OFF);
I’m entering sleep using the Sleep() macro defined in each part header file, which in both cases is the following define:
#define Sleep()  {__asm__ volatile ("pwrsav #0");}
 
I remain in sleep for 16ms based on the watchdog timer settings.  I can see that the oscillator stops during sleep mode every 16ms on either platform.  If I toggle a pin before and after the Sleep() function I can see a 16 ms delay, so I believe the processor is stopped in the Sleep() function for at least this long.  The duration of wakeup time between the two platforms is identical.  Increasing the amount of time in sleep via the watchdog to the point where the processor sleeps indefinitely does not reduce current below 16 mA.
 
My suspicion after reading other forum posts about high current in sleep mode was that improperly configured IO was responsible for the additional current.  However, I’ve checked and double checked my IO settings to confirm I don’t have something like a analog value on a digital input, or a digital output driving the wrong logic level, or a misconfigured IO pin.  I haven't come up with any way to explain additional current draw by incorrect IO settings.  I did find a few problems with analog voltages on digital inputs but after fixing this and verifying the registers were now set correctly I didn't see any difference in current consumption.
 
I’ve paused execution with the debugger and looked at differences in SFRs between the two different micros to see if there might be a peripheral that’s somehow being turned on and left on in sleep mode which might explain the difference in current.  I don’t see differences between the two platforms related to peripherals being on or off.
 
Finally, I noticed the comments in several forum posts about ap note CE342 as a deep sleep example, and have built and run this on the 24FJ128GA310 (with some small adaptations for config bits).  I see the same 16+ mA with this code.
 
I’m running out of ideas about things to try, hoping someone here will have some suggestions.
 
Thanks for any ideas or suggestions you can provide.
 
#1

26 Replies Related Threads

    flubydust
    Super Member
    • Total Posts : 1286
    • Reward points : 0
    • Joined: 2005/05/19 13:44:42
    • Status: offline
    Re: PIC24FJ128GA306 sleep mode current: 16+ mA current consumption 2016/03/17 21:08:30 (permalink)
    3 (2)
    16mA sounds excessive as an operating current never mind sleep. The datasheet typical supply current @ 16 MIPS is only 5mA.  I expect some enabled peripherals can increase that but not by that much. What is the supply current when you don't sleep at all?
     
    I would suspect you are driving a significant load with one or more pins. I would probably check the voltage on each pin is what you think it should be and what the pin connects to.
     
     
    #2
    MBedder
    Circuit breaker
    • Total Posts : 6554
    • Reward points : 0
    • Joined: 2008/05/30 11:24:01
    • Location: Zelenograd, Russia
    • Status: offline
    Re: PIC24FJ128GA306 sleep mode current: 16+ mA current consumption 2016/03/18 00:20:49 (permalink)
    0
    I would suspect the driver named "hands.sys" - worth updating ASAP LoL
    #3
    niteshverma.ind
    Starting Member
    • Total Posts : 45
    • Reward points : 0
    • Joined: 2015/04/15 06:53:27
    • Location: 0
    • Status: offline
    Re: PIC24FJ128GA306 sleep mode current: 16+ mA current consumption 2016/03/19 21:07:47 (permalink)
    0
    Same Problem & i m trying PIC24FJ128GA310 & PIC24FJ128GA010 PIM with explorer board 16. 
    I can reduce the current to 12 mA ( or you can say 9 mA beacuse 1 LED in blinking for board power).
     
    Waiting for some SUPER MEMBER to solve this issue.
     
    Well you will trying to test the same with code maximum power supply. If you can try this will minimum power required to PIC controller. I suggest you to try it once & share the results with us.
     
    Best of Luck
    Regards
    Niks
     
     
    #4
    Aussie Susan
    Super Member
    • Total Posts : 3363
    • Reward points : 0
    • Joined: 2008/08/18 22:20:40
    • Location: Melbourne, Australia
    • Status: offline
    Re: PIC24FJ128GA306 sleep mode current: 16+ mA current consumption 2016/03/20 19:13:21 (permalink)
    3 (1)
    From what you have written, you need to distinguish between the current draw from the MCU and the current draw from everything else on the explorer board. Are you doing that?
    Susan
    #5
    dwalkes
    New Member
    • Total Posts : 15
    • Reward points : 0
    • Joined: 2016/02/02 11:36:21
    • Location: 0
    • Status: offline
    Re: PIC24FJ128GA306 sleep mode current: 16+ mA current consumption 2016/03/21 09:35:03 (permalink)
    0
    Hi Everyone,
    Thanks very much for the responses.  I also continued to suspect IO issues since this was really the only thing that made sense.  I tried a new test today, which is to sacrifice a board and cut each IO pin out one by one, checking current after each pin was cut.
     
    I started with a new board than the one I was using previously with 16mA current draw where I saw slightly different current consumption of 20mA when in sleep mode.
     
    Here’s the code I’m using

    _CONFIG1(GWRP_OFF & JTAGEN_OFF & ICS_PGx3 & FWDTEN_WDT_SW & WINDIS_OFF & FWPSA_PR128 & WDTPS_PS4);
    _CONFIG2(IESO_OFF & FNOSC_FRC & OSCIOFCN_ON & POSCMD_NONE & FCKSM_CSDCMD & IOL1WAY_OFF);
    _CONFIG3(SOSCSEL_OFF)
    _CONFIG4(DSSWEN_ON & DSWDTEN_ON & DSWDTOSC_LPRC & DSWDTPS_DSWDTPS5)

    #define DONTSLEEP 0
    #define DEEPSLEEP 0
    int main (void)
    {
        TRISDbits.TRISD2=0;
        
        RCONbits.SWDTEN=1;
        while(1)
        {
            LATDbits.LATD2=0;
    #if DEEPSLEEP
            DSCON=0;
            DSCONbits.DSEN=1;
            DSCONbits.DSEN=1;
    #endif
    #if DONTSLEEP
    #else
            Sleep();
    #endif
            ClrWdt();
            LATDbits.LATD2=1;
        }
        
        return 0;
    }


     I’m toggling RD2 to prove that I’m actually entering sleep mode.  I see this pin pulse high and then remain low for ~16ms, indicating I am in Sleep() as I would expect.  With this code built for the very similar 24FJ256GB110 hardware I see 160uA current consumption.
     
    With the PIC24FJ128GA306 device and hardware I see 22mA when running with #define DONTSLEEP 1 and never entering Sleep(), or 20 mA when running with #define DONTSLEEP 0.  If I ground /MCLR I see ~600uA of current while the device is held in reset.
     
    I then proceeded to cut every IO and other pin I could, leaving only the power and reset pins.
     
    In the end I’ve cut every pin except the list below on the 64 pin PIC24FJ128GA306, all of which are required connections based on section 2.1 of the datasheet.
    MCLR pin 7
    VSS pin 9
    VDD pin 10
    AVDD pin 19
    AVSS pin 20
    VSS pin 25
    VDD pin 26
    VDD pin 38
    VSS Pin 41
    VCAP/VDDCore pin 56
     
    I still see 20mA current consumption in this state.  I still see current drop to 600uA when grounding /MCLR (and there are no other devices connected to /MCLR, with the exception of the external reset monitor output).  I still see pin RD2 toggling at 16ms intervals indicating I am in sleep mode.
      All VDD/AVDD pins are 3.0V and an ohmmeter measures 0 ohms resistance between them.  VDD remains at 3.0V when holding the part in reset.All VSS/AVSS pins are grounded and an ohmmeter measures 0 ohms resistance between them.The VCAP/VDDCORE pin is 1.8V and remains at this voltage when holding the part in reset.
     
    I believe this test proves the problem isn’t IO related, at least with respect to the way IO is connected on the PCB (since all IO are now disconnected).  Given that the RD2 IO pin is toggling the way it is I don’t see how the device could be in anything other than sleep mode.  This leads me to believe there’s some way to end up with high current in sleep mode for this particular part, which isn’t obvious in the datasheet.
     
    Nothing in part errata appears to explain this either, the only sleep current related errata item #7 mentions the maximum current for deep sleep is 6uA.

    Please let me know if you have any other suggestions about additional things to try.
    #6
    flubydust
    Super Member
    • Total Posts : 1286
    • Reward points : 0
    • Joined: 2005/05/19 13:44:42
    • Status: offline
    Re: PIC24FJ128GA306 sleep mode current: 16+ mA current consumption 2016/03/21 10:18:33 (permalink)
    3.67 (3)
    Long shot but check VDDCORE with a scope in case the regulator is oscillating, probably because it doesn't like the capacitor on it.
     
     
     
    #7
    dwalkes
    New Member
    • Total Posts : 15
    • Reward points : 0
    • Joined: 2016/02/02 11:36:21
    • Location: 0
    • Status: offline
    Re: PIC24FJ128GA306 sleep mode current: 16+ mA current consumption 2016/03/22 08:14:49 (permalink)
    0
    Thanks for the suggestion, I don't see any oscillating on VDDCORE, it's steady at 1.8V in and out of part reset.
    #8
    PKaban
    New Member
    • Total Posts : 13
    • Reward points : 0
    • Joined: 2016/03/04 05:21:55
    • Location: 0
    • Status: offline
    Re: PIC24FJ128GA306 sleep mode current: 16+ mA current consumption 2016/03/22 10:16:01 (permalink)
    0
    dwalkes,
    20 mA with IO lines cut, IO lines set to low and debugger detached is indeed too much. 
     
    Have you tried explicitely disabling peripherals via PMD registers? I have no experience with FJ128GA, but it made some difference on FxxKA devices.
    #9
    bosco
    Super Member
    • Total Posts : 2119
    • Reward points : 0
    • Joined: 2004/07/24 10:17:53
    • Location: Idaho
    • Status: offline
    Re: PIC24FJ128GA306 sleep mode current: 16+ mA current consumption 2016/03/22 11:17:39 (permalink)
    0
    Sound like it is time to get Microchip support involved, however long it may take.
    #10
    dwalkes
    New Member
    • Total Posts : 15
    • Reward points : 0
    • Joined: 2016/02/02 11:36:21
    • Location: 0
    • Status: offline
    Re: PIC24FJ128GA306 sleep mode current: 16+ mA current consumption 2016/03/22 11:20:06 (permalink)
    0
    Thanks, I agree, I did open a support request yesterday.  Will post here when I figure out what's going on.
    #11
    PKaban
    New Member
    • Total Posts : 13
    • Reward points : 0
    • Joined: 2016/03/04 05:21:55
    • Location: 0
    • Status: offline
    Re: PIC24FJ128GA306 sleep mode current: 16+ mA current consumption 2016/03/24 07:02:31 (permalink)
    0
    dwalkes,
    Could you perhaps write which versions of compiler/IDE are used?
     
    A colleague of mine was kind enough to provide test rig (FJ128GA306 + NCP583). The following code yields approximately 4 uA using MPLAB X 3.10 and XC16 v1.25 :
     
    Config:
    // CONFIG4
    #pragma config DSWDTPS = DSWDTPS1F // Deep Sleep Watchdog Timer Postscale Select bits (1:68719476736 (25.7 Days))
    #pragma config DSWDTOSC = LPRC // DSWDT Reference Clock Select (DSWDT uses LPRC as reference clock)
    #pragma config DSBOREN = ON // Deep Sleep BOR Enable bit (DSBOR Enabled)
    #pragma config DSWDTEN = ON // Deep Sleep Watchdog Timer Enable (DSWDT Enabled)
    #pragma config DSSWEN = ON // DSEN Bit Enable (Deep Sleep is controlled by the register bit DSEN)

    // CONFIG3
    #pragma config WPFP = WPFP127 // Write Protection Flash Page Segment Boundary (Page 127 (0x1FC00))
    #pragma config VBTBOR = ON // VBAT BOR enable bit (VBAT BOR enabled)
    #pragma config SOSCSEL = ON // SOSC Selection bits (SOSC circuit selected)
    #pragma config WDTWIN = PS25_0 // Watch Dog Timer Window Width (Watch Dog Timer Window Width is 25 percent)
    #pragma config BOREN = OFF // Brown-out Reset Enable (Brown-out Reset Enable)
    #pragma config WPDIS = WPDIS // Segment Write Protection Disable (Disabled)
    #pragma config WPCFG = WPCFGDIS // Write Protect Configuration Page Select (Disabled)
    #pragma config WPEND = WPENDMEM // Segment Write Protection End Page Select (Write Protect from WPFP to the last page of memory)

    // CONFIG2
    #pragma config POSCMD = NONE // Primary Oscillator Select (Primary Oscillator Disabled)
    #pragma config BOREN1 = EN // BOR Override bit (BOR Enabled [When BOREN=1])
    #pragma config IOL1WAY = ON // IOLOCK One-Way Set Enable bit (Once set, the IOLOCK bit cannot be cleared)
    #pragma config OSCIOFCN = OFF // OSCO Pin Configuration (OSCO/CLKO/RC15 functions as CLKO (FOSC/2))
    #pragma config FCKSM = CSECMD // Clock Switching and Fail-Safe Clock Monitor Configuration bits (Clock switching is enabled, Fail-Safe Clock Monitor is disabled)
    #pragma config FNOSC = FRCDIV // Initial Oscillator Select (Fast RC Oscillator with Postscaler (FRCDIV))
    #pragma config ALTVREF = DLT_AV_DLT_CV // Alternate VREF/CVREF Pins Selection bit (Voltage reference input, ADC =RA9/RA10 Comparator =RA9,RA10)
    #pragma config IESO = ON // Internal External Switchover (Enabled)

    // CONFIG1
    #pragma config WDTPS = PS256 // Watchdog Timer Postscaler Select (1:256)
    #pragma config FWPSA = PR128 // WDT Prescaler Ratio Select (1:128)
    #pragma config FWDTEN = WDT_SW // Watchdog Timer Enable (WDT controlled with the SWDTEN bit)
    #pragma config WINDIS = OFF // Windowed WDT Disable (Standard Watchdog Timer)
    #pragma config ICS = PGx3 // Emulator Pin Placement Select bits (Emulator functions are shared with PGEC1/PGED1)
    #pragma config LPCFG = ON // Low power regulator control (Disabled)
    #pragma config GWRP = OFF // General Segment Write Protect (Disabled)
    #pragma config GCP = OFF // General Segment Code Protect (Code protection is disabled)
    #pragma config JTAGEN = ON // JTAG Port Enable (Enabled)

     
    The main is as follows:
    #include <xc.h>

    #include "stdint.h"
    #include "PwrMgnt.h"

    volatile uint32_t t_ctr;

    int16_t main()
    {
        RCONbits.SWDTEN = 0;
        RCONbits.RETEN = 0;
        __builtin_write_OSCCONL(4);
        
        PMD1 = 0xFFFF;
        PMD2 = 0xFFFF;
        PMD3 = 0xFFFF;
        PMD4 = 0xFFFF;

        PMD6 = 0xFFFF;
        PMD7 = 0xFFFF;
        
        ANSB = 0x0;
        ANSD = 0x0;
        ANSE = 0x0;
        ANSG = 0x0;
        
        TRISB = 0x0;
        TRISC = 0x0;
        TRISD = 0x0;
        TRISE = 0x0;
        TRISF = 0x0;
        TRISG = 0x0;
        
        LATB = 0x0;
        LATC = 0x0;
        LATD = 0x0;
        LATE = 0x0;
        LATF = 0x0;
        LATG = 0x0;

        while(1)
        {
            for (t_ctr = 0; t_ctr < 100000; t_ctr++)
            {
                Nop();
            }
            
            mPWRMGNT_GotoSleepMode();
        }
    }

     
    It does exactly nothing, though, and does not use external crystals (it pops to like 6 uA with Timer1 running off 32 KHz for wakeups).
     
    If you choose to try this code on your device, please write about results. According to my workmates, they have never had any problem like you've encountered, barring hardware damage.
     
    #12
    dwalkes
    New Member
    • Total Posts : 15
    • Reward points : 0
    • Joined: 2016/02/02 11:36:21
    • Location: 0
    • Status: offline
    Re: PIC24FJ128GA306 sleep mode current: 16+ mA current consumption 2016/03/30 07:22:39 (permalink)
    0
    Hi Everyone,
    I've reproduced high current observations on MPLAB8 and MPLABX development environments.
    I've also reproduced with a minimally modified version of the low power reference design firmware implementation at  (not allowed to add URL - see microchip.secure.force.com and add on microchipknowledge/articles/Technical_Support/How-to-get-the-lowest-power-consumption-out-of-a-16-bit-PIC-microcontroller)  per Microchip support's recommendation.
     
    I've then ordered the LCD demo dev board hardware at (not allowed to add URL - see microchipdirect dot com then add ProductSearch.aspx?Keywords=DM240314 ) which used the GA310 and could *not* reproduce on this hardware.  Remaining differences between my hardware and this configuration were:
     
    1) Power supply voltage: I use 3V, whereas the dev board uses 3.3V. 
    2) I'm using a PIC24FJ128GA306 whereas the dev board uses the PIC24FJ128GA310 
    3) Some of the cut pins on my board would be floating or configured as output pins whereas these will be connected to the LCD in most cases on the LCD explorer board. 
    Note: I did try a special build which configured all pins as output and drove low, this made no difference in power consumption.
     
    To eliminate difference #2 and #3 I made a socket connection to VCAP/VDDCORE on my hardware and connected this to the socketed PIC24FJ128GA310  from the LCD dev board.  I found that could reproduce the same high current problems in this configuration.
     
    I then changed power supply voltage on my board to 3.3V to match the Microchip dev board and the problem went away.
     
    I verified on a second hardware device that I could get to < 100 uA current consumption by *increasing* my power supply voltage to 3.3V from 3.0V.
     
    So it appears the solution in my case is to increase my power supply voltage to 3.3V from 3.0V.
     
    Microchip support has stated they are not aware of any limitation like this with the part and they have not yet independently verified this result.  I'm curious if anyone else has noticed something like this.
    post edited by dwalkes - 2016/03/30 07:34:01
    #13
    dwalkes
    New Member
    • Total Posts : 15
    • Reward points : 0
    • Joined: 2016/02/02 11:36:21
    • Location: 0
    • Status: offline
    Re: PIC24FJ128GA306 sleep mode current: 16+ mA current consumption 2016/03/30 07:28:55 (permalink)
    0
    I'm not allowed to add links yet but see microchip.secure.force.com and add on microchipknowledge/articles/Technical_Support/How-to-get-the-lowest-power-consumption-out-of-a-16-bit-PIC-microcontroller to find the low power reference design recommended by Microchip.
    #14
    dwalkes
    New Member
    • Total Posts : 15
    • Reward points : 0
    • Joined: 2016/02/02 11:36:21
    • Location: 0
    • Status: offline
    Re: PIC24FJ128GA306 sleep mode current: 16+ mA current consumption 2016/03/30 07:31:23 (permalink)
    3 (1)
    I did try disabling several peripheral I could find that was enabled out of reset, didn't find any major differences in current consumption.  Also none of the microchip documentation hints that peripheral power consumption could be anywhere near the mA range.
     
    The solution for me was to increase power supply voltage from 3.0V to 3.3V.  See my comment from a few minutes ago on this thread.  I unfortunately can't link it here.
     
    #15
    roundrocktom
    Super Member
    • Total Posts : 1009
    • Reward points : 0
    • Joined: 2012/09/07 08:19:09
    • Location: Texas
    • Status: offline
    Re: PIC24FJ128GA306 sleep mode current: 16+ mA current consumption 2016/03/30 07:44:57 (permalink)
    3 (1)
    Very odd.  I wonder if the MPC2200 (Vcc 3.0V to 5.5V) is causing an issue.   Looking at the The LCD Explorer Development Board DM240314 Board Schematic doesn't show anything else that jumps out at me. 
     
    I'm curious as to why current goes up at 3.0V  (I've seen parts when brown out conditions occur, need more current as they are initializing internal state machines waiting for power up).   
    #16
    PKaban
    New Member
    • Total Posts : 13
    • Reward points : 0
    • Joined: 2016/03/04 05:21:55
    • Location: 0
    • Status: offline
    Re: PIC24FJ128GA306 sleep mode current: 16+ mA current consumption 2016/03/30 08:22:27 (permalink)
    0
    Hi,
     
    First of all, thanks for sharing latest info. I agree that peripheral/IO configuration is pretty much ruled out.
     
    3.0V threshold is very odd, people has been using GA306 with 2.8V VDD without problems. If I understood correct, your board has default connections for VCAP and VBAT (VCAP grounded through ~10uF cap, and VBAT tied to VDD, respectively)?
    #17
    dwalkes
    New Member
    • Total Posts : 15
    • Reward points : 0
    • Joined: 2016/02/02 11:36:21
    • Location: 0
    • Status: offline
    Re: PIC24FJ128GA306 sleep mode current: 16+ mA current consumption 2016/03/30 09:19:25 (permalink)
    3 (1)
    PKaban
    If I understood correct, your board has default connections for VCAP and VBAT (VCAP grounded through ~10uF cap, and VBAT tied to VDD, respectively)?

    Correct.
    #18
    PKaban
    New Member
    • Total Posts : 13
    • Reward points : 0
    • Joined: 2016/03/04 05:21:55
    • Location: 0
    • Status: offline
    Re: PIC24FJ128GA306 sleep mode current: 16+ mA current consumption 2016/03/30 11:32:51 (permalink)
    0
    Guess I am running out of ideas, then. Since you have reproduced the solution on two devices, defective part and possible mounting problems (some misplaced solder etc.) are ruled out. Maybe playing with VCAP capacitor size with 3.0V VDD will yield some results?
     
    BTW, what power supply do you use?
     
    I'll try to find 3V NCP583 and use the code you've posted to reproduce. This is weird, I have not seen defective Microchip part in years, and your test show there are multiple problematic samples.
    #19
    dwalkes
    New Member
    • Total Posts : 15
    • Reward points : 0
    • Joined: 2016/02/02 11:36:21
    • Location: 0
    • Status: offline
    Re: PIC24FJ128GA306 sleep mode current: 16+ mA current consumption 2016/03/30 11:38:39 (permalink)
    3 (1)
    PKaban
    Guess I am running out of ideas, then

    Me too, I'm going to wait to see if Microchip can reproduce and if they can't modify the development board to try to reproduce there.
    PKaban
    BTW, what power supply do you use?

    I'm using an SPX3819M5 adjustable regulator with resistor divider values 43K and 30K and 10uF output bulk capacitance.  Input voltage is 3xAAA cells.
    #20
    Page: 12 > Showing page 1 of 2
    Jump to:
    © 2018 APG vNext Commercial Version 4.5