• AVR Freaks

Hot!PIC12F1840 Sleep standby current 12uA and not 20 to 100nA expected

Author
Gordy7
New Member
  • Total Posts : 7
  • Reward points : 0
  • Joined: 2013/02/17 01:47:20
  • Location: 0
  • Status: offline
2013/02/17 02:49:38 (permalink)
0

PIC12F1840 Sleep standby current 12uA and not 20 to 100nA expected

Hi,
New to the 12F1840 and its abundance of peripheral functions.
I am having problems getting the standby current in Sleep below 12uA with 3V supply.
The 12uA would tend to indicate that I have not turned off some peripheral.
But I can't find out what that is. Must be making the same mistake over and over!
Been developing an IR remote controller.
My main code works fine. Have been using PICkit 2 and 3 programmers.
My main code has been written in GCGBasic, but diagnotics with MPLab IDE 8.89.
The circuit:

The prototype board without the microcontroller plugged in draws abot 0.4uA
That is likely the 100uF multilayer ceramic.
The chip I have been using is PIC12F1840 I/P MP6 1239W.
The total board current with this chip in sleep is 13.2uA at 3v. The PICkit is not connected when I make this measurement.
I have measured 0V (<0.1mV) across each of the 10K pull downs and have also checked that the pull downs are actually in circuit (not open circuit).
 
The code for preparing to enter sleep is in the attachment below.

Hope someone can point out what I am doing wrong and what I need do do. 
 
Cheers
Gordon
 
 
 
 
 
 
 
post edited by Gordy7 - 2013/03/06 00:54:42

Attached Image(s)

#1

12 Replies Related Threads

    Gordy7
    New Member
    • Total Posts : 7
    • Reward points : 0
    • Joined: 2013/02/17 01:47:20
    • Location: 0
    • Status: offline
    Re:PIC12F1840 Sleep standby current 12uA and not 20 to 100nA expected 2013/02/21 12:24:02 (permalink)
    0
    In the early stages of finding out more about the 12F1840 12uA standby current (Sleep).
    I have noted that the PIC microcontrollers I have used turn off the peripherals at POR (power on reset) so unless a peripheral is used there is no need to turn it off.
    The way I read the data sheets I should expect a total standby current (typical) of 50nA (corected for 12F1840 330nA).
    This consists of core 20nA + (6 port pins at 5nA= 30nA) giving a total of 50nA.
    Correction: For the 12F1840 I should expect 330nA (@3V) (core 300nA + (6 port pins at 5nA= 30nA))
     
    I have created a small program to test several 12F chips and a couple of 16F chips:
    - Configs: internal osc=4MHz, wdt=off, mclr=off, bor=off, clkout=off (details depend on chip)
    - Pulse an LED for 100K NOPs (100ms) to show program has run and to avoid using any timers. 
    - Change the ports to inputs and disable any weak pull ups if exist in chip. (external 10K pull downs used on each port pin).
    - In some chip tests the ports were changed to outputs and set to 0V before sleep.
    - Vregpm=1 (for 12F1840)
    - Put the chip to Sleep
     
    The results so far
    Test board without chip <100nA
    12F509  <100nA
    12F675  <100nA
    12F1840 approx 12uA  ports inputs and 10K pull downs
    12F1840 approx 12uA ports outputs and set to 0V
    16F690 <100nA on Demo PCB, ports outputs and set to 0V
    16F887 <100nA ports outputs and set to 0V, RE3 with 10K pull down.
     
    Might try a few more chips.
    Have ordered some 12LF1840 chips which were hard to find.

     
     
     
     
     
     
     
    post edited by Gordy7 - 2013/03/02 21:59:57
    #2
    al_bin
    Super Member
    • Total Posts : 173
    • Reward points : 0
    • Joined: 2011/02/11 06:28:47
    • Location: 0
    • Status: online
    Re:PIC12F1840 Sleep standby current 12uA and not 20 to 100nA expected 2013/02/21 12:47:16 (permalink)
    0
    I don't know source of your problems, but try to reread the datasheet.
    20nA is only for 12LF1840 not 12F1840, and only if Vcc is 1.8V not 3V
     
    Albert
    #3
    Gordy7
    New Member
    • Total Posts : 7
    • Reward points : 0
    • Joined: 2013/02/17 01:47:20
    • Location: 0
    • Status: offline
    Re:PIC12F1840 Sleep standby current 12uA and not 20 to 100nA expected 2013/02/21 14:54:01 (permalink)
    0
    Thanks Albert.
    Yes I stand corrected. Did not read the data sheet correctly. :-(
    I did not pick the white/shaded areas of the data sheet correlating 12LF1840 and 12F1840 data.
    So for the 12F1840 at 3V I should be expecting 330nA total standby current.
    In the test program I do have the 12F1840 VREGPM = 1.
     

     
    Gordon

     
     
    post edited by Gordy7 - 2013/02/21 15:00:41

    Attached Image(s)

    #4
    Gordy7
    New Member
    • Total Posts : 7
    • Reward points : 0
    • Joined: 2013/02/17 01:47:20
    • Location: 0
    • Status: offline
    Re:PIC12F1840 Sleep standby current 12uA and not 20 to 100nA expected 2013/03/06 00:50:36 (permalink)
    0
    The wrap up:
    I have created a small program to test several 12F chips and a couple of 16F chips for Sleep current: 
    - Configs: internal osc=4MHz, wdt=off, mclr=off, bor=off, clkout=off (details depend on chip) 
    - Pulse an LED for 100K NOPs (100ms) to show program has run and to avoid using any timers.  
    - Change the ports to inputs and disable any weak pull ups if exist in chip. (external 10K pull downs used on each port pin). 
    - In some chip tests the ports were changed to outputs and set to 0V before sleep. The PGM port was fitted with a 10K pull down.
    - Vregpm=1 (for 12F1840) 
    - Put the chip to Sleep 
      
    The results: 
    Test board without chip and 2x 100nF ceramic capacitors on Vdd <100nA @3V
    12F509  <100nA 
    12F675  <100nA 
    16F690 <100nA on Demo PCB, ports outputs and set to 0V  
    16F887 <100nA ports outputs and set to 0V, RE3 with 10K pull down. 
    12F1840 approx 3.7uA @3V, ports output at 0V, RA3 10K pull down, Vregpm=1
    12F1840 approx 36uA @3V, ports output at 0V, RA3 10K pull down, Vregpm=0
    12LF1840 <100nA @3V, ports output at 0V, RA3 10K pull down.
     
    In the last 3 tests, very similar code was used for the 12LF1840 and the 12F1840.
    The 12F1840 included the extra Vregpm code.
    I haven't solved why the 12F1840 draws more current than expected.
     
    I am going to use the 12LF1840 for my project and get back to the main project code.
     
    Attached is some code used in tests.
     
    post edited by Gordy7 - 2013/03/06 00:52:40
    #5
    al_bin
    Super Member
    • Total Posts : 173
    • Reward points : 0
    • Joined: 2011/02/11 06:28:47
    • Location: 0
    • Status: online
    Re:PIC12F1840 Sleep standby current 12uA and not 20 to 100nA expected 2013/03/06 15:11:40 (permalink)
    0
    Gordy7
    I haven't solved why the 12F1840 draws more current than expected.

     
     Your program says:
    Vregcon = 2
     
    DS says:
    [VREGCON]
    bit 0 Reserved: Read as ‘1’. Maintain this bit set.
     
    Albert
    #6
    Gordy7
    New Member
    • Total Posts : 7
    • Reward points : 0
    • Joined: 2013/02/17 01:47:20
    • Location: 0
    • Status: offline
    Re:PIC12F1840 Sleep standby current 12uA and not 20 to 100nA expected 2013/03/06 16:28:34 (permalink)
    0
    Thanks again Albert
     
    I will try Vregcon = 3
    That should maintain the reserved bit as a 1 and put the 12F1840 regulator into low standby current mode.
    The compiler I was using did not seem to allow direct bit set of Vregpm.
    So hence the Vregcon code.
    Will give it a try tonight.
     
     
     
    post edited by Gordy7 - 2013/03/06 16:32:12
    #7
    Gordy7
    New Member
    • Total Posts : 7
    • Reward points : 0
    • Joined: 2013/02/17 01:47:20
    • Location: 0
    • Status: offline
    Re:PIC12F1840 Sleep standby current 12uA and not 20 to 100nA expected 2013/03/07 00:17:45 (permalink)
    0
    Latest results:
     
    12F1840 meter flicks between 100 and 200nA @3V, ports outputs at 0V, RA3 10K pull down, Vregpm=1 
    12F1840 approx 11.9uA @3V, ports outputs at 0V, RA3 10K pull down, Vregpm=0 
    12LF1840 <100nA @3V, ports outputs at 0V, RA3 10K pull down. 
      
    In these tests, very similar code was used for the 12LF1840 and the 12F1840. 
    The 12F1840 included the extra Vregpm code. 
    With Albert's help I am now happy with the low Sleep current.
     
    Back to my main project code. grin
     
    Code files used in my latest tests are attached.
    Sorry but the file names seem to have been shortened/truncated in the uploads.
    The file names are:
    47 Sleep tests 12F1840out Vreg1 gcb.txt
    47 Sleep tests 12F1840out Vreg1.asm
    42 Sleep tests 12LF1840out gcb.txt
    42 Sleep tests 12LF1840out.asm


    post edited by Gordy7 - 2013/03/07 00:26:11
    #8
    rbraddy
    New Member
    • Total Posts : 9
    • Reward points : 0
    • Joined: 2018/01/23 20:07:19
    • Location: 0
    • Status: offline
    Re:PIC12F1840 Sleep standby current 12uA and not 20 to 100nA expected 2019/07/20 07:28:27 (permalink)
    -1 (1)
    I have been facing a similar situation with the PIC16LF18345 and trying to get into nanoamp level low-power sleep current drain. The keys for me were disabling brown out reset (BOR) and making MCLR a pin. Once I made those two changes, along with setting all other pins as digital outputs (temporarily), the part now sleeps and consumes less than 1 microamp (my old digital meter only reads down to microamps and it now reads 0.000 millamps!
     
    Very helpful post!
    #9
    Gordy7
    New Member
    • Total Posts : 7
    • Reward points : 0
    • Joined: 2013/02/17 01:47:20
    • Location: 0
    • Status: offline
    Re:PIC12F1840 Sleep standby current 12uA and not 20 to 100nA expected 2019/07/22 13:47:24 (permalink)
    +1 (1)
    I was also faced with my DMM not measuring low enough current on various projects, so I made up this resistor adapter. It allows me to use my DMM in voltage mode with sufficient resolution to read to 0.1uA when the adapter push button is pressed.
     
     
     

    Attached Image(s)

    #10
    rbraddy
    New Member
    • Total Posts : 9
    • Reward points : 0
    • Joined: 2018/01/23 20:07:19
    • Location: 0
    • Status: offline
    Re:PIC12F1840 Sleep standby current 12uA and not 20 to 100nA expected 2019/07/22 16:14:05 (permalink)
    0
    Very cool. What is value of R1 (10R)?
    #11
    ric
    Super Member
    • Total Posts : 24582
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re:PIC12F1840 Sleep standby current 12uA and not 20 to 100nA expected 2019/07/22 16:23:43 (permalink)
    +1 (1)
    10R is 10 ohms.

    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!
    #12
    NKurzman
    A Guy on the Net
    • Total Posts : 18034
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re:PIC12F1840 Sleep standby current 12uA and not 20 to 100nA expected 2019/07/22 17:06:27 (permalink)
    0
    Many Cheap DMMs will not accurately measure currents that low.  Additionally contaminates on the board could affect the readings.  Make sure it is cleaned.  And it is addressed in production too.
    #13
    Jump to:
    © 2019 APG vNext Commercial Version 4.5