• AVR Freaks

Hot!pic12f675 have the lowest sleep current from Microchip?

Author
piticbogdan
New Member
  • Total Posts : 14
  • Reward points : 0
  • Joined: 2018/12/02 17:58:02
  • Location: 0
  • Status: offline
2020/01/18 11:08:31 (permalink)
0

pic12f675 have the lowest sleep current from Microchip?

Hi everyone,
 
I'm planning to use a pic, mostly in sleep, and when ExtInterrupt or IntOnChange to power up some external circuits from the pic i/o directly.
 
I was looking for a mcu with the lowest sleep current... and, so far i found this old pic12f675 (1nA ???? when in sleep @2-3V)
 
Unfortunately when tested (multiple, pic12f675 extended version with rev.= 0xb, build in 2019 week 42, and bought from digikey) the sleep current was 54nA @3V measured with a CurrentRanger. The test was done with only the pic, no external circuits present on the board.
 
Not sure if the extended / industrial version will make a difference (i just ordered both versions now from MicrochipDirect for further testing).
 
1. do, any of you got 1nA on this chip? (i do have the feeling is something wrong in the datasheet, i didn't find nothing in the errata also)
 
2. do you have a recommendation for a different chip?
 
Thank you all 

Attached Image(s)

#1

18 Replies Related Threads

    jtemples
    عُضْوٌ جَدِيد
    • Total Posts : 11577
    • Reward points : 0
    • Joined: 2004/02/13 12:31:19
    • Location: Southern California
    • Status: offline
    Re: pic12f675 have the lowest sleep current from Microchip? 2020/01/18 11:40:43 (permalink)
    +2 (2)
    It doesn't seem likely an old non-LF PIC would be 1 nA.  Some of the newer "XLP" PICs are in the tens of nA.
    #2
    NKurzman
    A Guy on the Net
    • Total Posts : 18266
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: pic12f675 have the lowest sleep current from Microchip? 2020/01/18 14:07:06 (permalink)
    +1 (1)
    And you disabled all the Peripherials, the the WDT and BOR, and set all the pins to be outputs?
    #3
    1and0
    Access is Denied
    • Total Posts : 10346
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: pic12f675 have the lowest sleep current from Microchip? 2020/01/18 15:10:53 (permalink)
    +1 (1)
    Test with this and report back.
            list p=12F675, r=dec, w=1
            #include <p12f675.inc>
           
     __CONFIG _FOSC_INTRCIO & _WDTE_OFF & _PWRTE_OFF & _MCLRE_OFF & _BOREN_OFF & _CP_OFF & _CPD_OFF
           
            org     0x000
            banksel GPIO
            clrf    GPIO        ; init GPIO
            movlw   0x07        ; comparator off
            movwf   CMCON
           
            banksel ANSEL
            clrf    ANSEL       ; all digital i/o
            clrf    TRISIO      ; all output, except GP3
            movlw   0x80        ; pullups disabled, int clock TMR0
            movwf   OPTION_REG
           
            sleep
            end

    Hex file:
    :020000040000FA
    :10000000831285010730990083169F018501803096
    :040010008100630008
    :02400E00943FDD
    :00000001FF

     
    Edit: Don't forget to put a pull-up or pull-down resistor on GP3.
     
     
    post edited by 1and0 - 2020/01/18 15:14:09
    #4
    piticbogdan
    New Member
    • Total Posts : 14
    • Reward points : 0
    • Joined: 2018/12/02 17:58:02
    • Location: 0
    • Status: offline
    Re: pic12f675 have the lowest sleep current from Microchip? 2020/01/19 12:43:47 (permalink)
    0
    ..first, I appreciate the help
     
    Unfortunately I'm having errors when I tried to change the toolchain or to add your code into the xc8.
    This is the code I used:
    #pragma config FOSC = INTRCIO
    #pragma config WDTE = OFF
    #pragma config PWRTE = ON
    #pragma config MCLRE = OFF
    #pragma config BOREN = OFF
    #pragma config CP = OFF
    #pragma config CPD = OFF

    #include <xc.h>

    int main(void) {

        ANSELbits.ANS3 = 0;
        ANSELbits.ANS2 = 0;
        ANSELbits.ANS1 = 0;
        ANSELbits.ANS0 = 0;
       
        OPTION_REGbits.nGPPU = 0; // GPIO pull-ups are enabled by individual PORT latch values

        WPUbits.WPU5 = 0;
        WPUbits.WPU4 = 0;
        WPUbits.WPU2 = 0;
        WPUbits.WPU1 = 0;
        WPUbits.WPU0 = 0;

        TRISIObits.TRISIO5 = 0;
        TRISIObits.TRISIO4 = 0;
        TRISIObits.TRISIO3 = 1; //50k pull up on it
        TRISIObits.TRISIO2 = 0;
        TRISIObits.TRISIO1 = 0;
        TRISIObits.TRISIO0 = 0;
       
        GPIObits.GPIO5 = 0;
        GPIObits.GPIO4 = 0;
        GPIObits.GPIO3 = 1;
        GPIObits.GPIO2 = 0;
        GPIObits.GPIO1 = 0;
        GPIObits.GPIO0 = 0;
        
        VRCONbits.VREN =0;
                
        CMCONbits.CM2 = 1;
        CMCONbits.CM1 = 1;
        CMCONbits.CM0 = 1;
     
    //T1CON: TIMER1 CONTROL REGISTER
        //T1CONbits.T1OSCEN = 0;
        
    SLEEP();
    NOP();

    return 0;
    }
     
     
    Thank you
    #5
    ric
    Super Member
    • Total Posts : 25592
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: pic12f675 have the lowest sleep current from Microchip? 2020/01/19 14:14:47 (permalink)
    +1 (1)
    piticbogdan
    Unfortunately I'm having errors when I tried to change the toolchain

     
    what did you try to change it to, and WHAT errors did you get?
    (It's so hard to help when people won't divulge what the error said!)
    That was assembly code that 1and0 posted, so you just had to select MPASM.
    That's installed as part of MPLABX, so you must have it.
     

    or to add your code into the xc8.
    This is the code I used:

    So why did you rearrange it all?
     
    A one for one match of that assembly would be:

    #pragma config FOSC = INTRCIO
    #pragma config WDTE = OFF
    #pragma config PWRTE = ON
    #pragma config MCLRE = OFF
    #pragma config BOREN = OFF
    #pragma config CP = OFF
    #pragma config CPD = OFF

    #include <xc.h>


    void main(void)
    {
        GPIO = 0;    // init GPIO
        CMCON = 0x07;    // comparator off
        ANSEL = 0;    // all digital i/o
        TRISIO = 0;    // all output, except GP3
        OPTION_REG = 0x80;    // pullups disabled, int clock TMR0
        SLEEP();
    }


    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #6
    ric
    Super Member
    • Total Posts : 25592
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: pic12f675 have the lowest sleep current from Microchip? 2020/01/19 14:14:47 (permalink)
    0
    piticbogdan
    Unfortunately I'm having errors when I tried to change the toolchain

     
    what did you try to change it to, and WHAT errors did you get?
    (It's so hard to help when people won't divulge what the error said!)
    That was assembly code that 1and0 posted, so you just had to select MPASM.
    That's installed as part of MPLABX, so you must have it.
     

    or to add your code into the xc8.
    This is the code I used:

    So why did you rearrange it all?
     
    A one for one match of that assembly would be:

    #pragma config FOSC = INTRCIO
    #pragma config WDTE = OFF
    #pragma config PWRTE = ON
    #pragma config MCLRE = OFF
    #pragma config BOREN = OFF
    #pragma config CP = OFF
    #pragma config CPD = OFF

    #include <xc.h>


    void main(void)
    {
        GPIO = 0;    // init GPIO
        CMCON = 0x07;    // comparator off
        ANSEL = 0;    // all digital i/o
        TRISIO = 0;    // all output, except GP3
        OPTION_REG = 0x80;    // pullups disabled, int clock TMR0
        SLEEP();
    }


    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #7
    piticbogdan
    New Member
    • Total Posts : 14
    • Reward points : 0
    • Joined: 2018/12/02 17:58:02
    • Location: 0
    • Status: offline
    Re: pic12f675 have the lowest sleep current from Microchip? 2020/01/19 16:05:40 (permalink)
    0
    Sorry for not being clear.
    (the error was "no rule to make target" after i select the mpasm in the tools>options>embedded>build_tools and also in the ProjectProperties>CompilerToolchain....and the code prior quoted was the one i tested the current in sleep)
     
    With your posted code (thank you) i have the same current in sleep (=54nA)
     
    ...Looks like my next step will be to wait few more days for the new chips
     
    Thank you
     
    #8
    piticbogdan
    New Member
    • Total Posts : 14
    • Reward points : 0
    • Joined: 2018/12/02 17:58:02
    • Location: 0
    • Status: offline
    Re: pic12f675 have the lowest sleep current from Microchip? 2020/01/21 17:22:52 (permalink)
    0
    follow-up
    The new chips arrived
     
    Not a big difference:
    - extended version 52-54nA in sleep
    - industrial version 49-50nA in sleep
     
    I will try to move over now, probably to PIC12LF1612 (20nA sleep)
    #9
    ric
    Super Member
    • Total Posts : 25592
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: pic12f675 have the lowest sleep current from Microchip? 2020/01/21 18:30:00 (permalink)
    +1 (1)
    It may be worth trying the opposite ANSEL setting.
    i.e. change all the analog capable pins to analog mode, which turns the digital input buffers OFF.
    ANSEL = 0b0001111;    // all pins analog mode.
     
    That may save a tiny bit of supply current.

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #10
    simong123
    Lab Member No. 003
    • Total Posts : 1359
    • Reward points : 0
    • Joined: 2012/02/07 18:21:03
    • Location: Future Gadget Lab (UK Branch)
    • Status: offline
    Re: pic12f675 have the lowest sleep current from Microchip? 2020/01/21 18:51:30 (permalink)
    +3 (3)
    Why are you so concerned with such rediculously low sleep currents?
    Even with a small 30mAh CR1025 as a supply the sleep lifetime will be >25 years at 100nA. Your achievable lifetime will be dominated by the consumption during wake.
    #11
    NorthGuy
    Super Member
    • Total Posts : 5917
    • Reward points : 0
    • Joined: 2014/02/23 14:23:23
    • Location: Northern Canada
    • Status: offline
    Re: pic12f675 have the lowest sleep current from Microchip? 2020/01/21 19:07:05 (permalink)
    +1 (1)
    The note to the power consumption table says: "Power-down current is measured with the part in Sleep mode, with all I/O pins in high-impedance state and tied to VDD". I suggest you do the same. You probably will get better current, but probably not 1 nA because the other note to the table says: "These parameters are for design guidance only and are not tested"
     
    Also, I wouldn't expect the current from the "Typ" column. "Max" column gives you the current which you should expect to be achieved.
    #12
    NKurzman
    A Guy on the Net
    • Total Posts : 18266
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: pic12f675 have the lowest sleep current from Microchip? 2020/01/21 19:24:51 (permalink)
    +2 (2)
    Also note with those low Currents your Board must be very clean.  Flux residue and other contaminants can cause leakage current.
     
    #13
    Howard Long
    Super Member
    • Total Posts : 782
    • Reward points : 0
    • Joined: 2005/04/04 08:50:32
    • Status: offline
    Re: pic12f675 have the lowest sleep current from Microchip? 2020/01/22 02:07:45 (permalink)
    +3 (3)
    I can't remember if it was this chip, but I did some measurements with a PIC of this era using an SMU a few months ago, and yes, sleep current was definitely sub 1nA, and yes, it surprised me too.
     
    I would be wary of the Current Ranger on these low currents. I have one too, and wasn't hugely impressed with it in the end. Perhaps mine needs a firmware upgrade. Multimeters with low current measurements are similarly hit and miss. If you can source an electrometer or better still an SMU with appropriate probing you should be able to achieve much more accurate and consistent measurements.
     
    There's also an issue of dynamic range and burden voltage to consider, which is another reason to consider an SMU with the highest resolution you can, to cope with the MCU going in and out of sleep.
     
    When measuring currents below about 3 or 4uA, you need to start taking additional precautions, and as NKurzman pointed out, a clean board free from ionic contaminants is essential. Both flux and flux removal agents often have significant ionic content: you can even see it bubbling away under the microscope when the DUT is powered up.
     
    I pop the board into a warm ultrasonic cleaner for ten minutes (I use Safewash SWAS), and then rinse twice with de-ionised water. If it's a small board to quickly dry it off I wave a hot air soldering iron around it, watching the water evaporate under microscope.
     
    You can also do these measurements on solderless breadboard without the need to clean if you have a DIP package.
     
    I don't know your application, but as Simong mentions, in what scenario is 1nA going to add value practically speaking compared to, say, a few tens of nA?
     
    Furthermore, please be aware that typically there is a comparatively expensive current spike of several uA on PICs when they power up (this is reset, not coming out of sleep): if your application has, say, a small energy harvesting power source, it will need to be able to sustain the PIC for those few microseconds during POR.
    #14
    Howard Long
    Super Member
    • Total Posts : 782
    • Reward points : 0
    • Joined: 2005/04/04 08:50:32
    • Status: offline
    Re: pic12f675 have the lowest sleep current from Microchip? 2020/01/22 09:50:07 (permalink)
    0
    To add, it looks like it was the PIC16F676 that I achieved a sleep current under 1nA, which I believe is the 14 pin variant of the PIC12F675.
    #15
    1and0
    Access is Denied
    • Total Posts : 10346
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: pic12f675 have the lowest sleep current from Microchip? 2020/01/22 10:27:34 (permalink)
    0
    Howard Long
    To add, it looks like it was the PIC16F676 that I achieved a sleep current under 1nA, which I believe is the 14 pin variant of the PIC12F675.

    ...which specs
    Standby Current:
    - 1 nA @ 2.0V, typical

    similar to the '675.
    #16
    1and0
    Access is Denied
    • Total Posts : 10346
    • Reward points : 0
    • Joined: 2007/05/06 12:03:20
    • Location: Harry's Gray Matter
    • Status: offline
    Re: pic12f675 have the lowest sleep current from Microchip? 2020/01/22 10:37:50 (permalink)
    +2 (2)
    A side note. OP's code takes about 4 or 5 times longer to perform the same operation. That gotta amount to more current consumption. ;)
     
     
    #17
    Howard Long
    Super Member
    • Total Posts : 782
    • Reward points : 0
    • Joined: 2005/04/04 08:50:32
    • Status: offline
    Re: pic12f675 have the lowest sleep current from Microchip? 2020/01/23 12:35:06 (permalink)
    +3 (3)
    I've made some sleep current measurements with a Keithley 238 SMU on a PIC12F675.
     
    Mounted on solderless breadboard, 10k pullup on MCLR, 10nF decupling cap. 32kHz watch crystal with a pair of 22pF caps.
     
    Crystal oscillator, LP, running, 12.5uA @ 2V
     
    Sleep, 5V: 540pA
    Sleep, 3V: 290pA
    Sleep, 2V: 230pA
     

    // PIC12F675 Configuration Bit Settings
     
    // 'C' source line config statements
     
    // CONFIG
    //#pragma config FOSC = INTRCCLK // Oscillator Selection bits (INTOSC oscillator: CLKOUT function on GP4/OSC2/CLKOUT pin, I/O function on GP5/OSC1/CLKIN)
    #pragma config FOSC = LP // Oscillator Selection bits (LP oscillator: Low power crystal on GP4/OSC2/CLKOUT and GP5/OSC1/CLKIN)
    #pragma config WDTE = OFF // Watchdog Timer Enable bit (WDT disabled)
    #pragma config PWRTE = OFF // Power-Up Timer Enable bit (PWRT disabled)
    #pragma config MCLRE = ON // GP3/MCLR pin function select (GP3/MCLR pin function is MCLR)
    #pragma config BOREN = OFF // Brown-out Detect Enable bit (BOD disabled)
    #pragma config CP = OFF // Code Protection bit (Program Memory code protection is disabled)
    #pragma config CPD = OFF // Data Code Protection bit (Data memory code protection is disabled)
     
    // #pragma config statements should precede project file includes.
    // Use project enums instead of #define for ON and OFF.
     
    #include <xc.h>
    #define _XTAL_FREQ 32768
     
    int main(void)
    {
    TRISIO=0;
    WPU=0;
    GPIO=0;
    ANSEL=0;

    while (1)
    {
    // Twiddle a GPIO so we can see it's about to go into sleep
    GPIObits.GP2=1;
    __delay_ms(500);
    GPIObits.GP2=0;
    __delay_ms(500);
    GPIObits.GP2=1;
    __delay_ms(2000);
    GPIObits.GP2=0;
    SLEEP();
    NOP();
    }
    return 0;
    }
     

     
     
    #18
    Howard Long
    Super Member
    • Total Posts : 782
    • Reward points : 0
    • Joined: 2005/04/04 08:50:32
    • Status: offline
    Re: pic12f675 have the lowest sleep current from Microchip? 2020/02/08 10:50:00 (permalink)
    0
    ** Since this post, I've confirmed with the OP that newer PIC12F675 do operate at very much higher sleep currents.
     
    46nA @5V for date code 1938, vs 540pA @5V for date code 0429.
     
    Please see this thread: https://www.microchip.com/forums/m1111931-p2.aspx#1127573
    #19
    Jump to:
    © 2020 APG vNext Commercial Version 4.5