PIC10F202 sleep current only 1.5 nA? - Page 1
Forum section: electronics / general

author: FrankBuss
author_rank: Unknown
timestamp: September 20, 2025, 08:32:15 am
content: I measured about 1.5 nA sleep current for the PIC10F202 at 3.3 V. WDT and MCLR is off, and I go to sleep mode with SLEEP, with wake-up on pin change configured. I use a 10k pullup on GP3. Looks very low, the datasheet says typical 100 nA at 2 V. Is this possible?Maybe I measured it wrong? I have a Fluke 8842A here, which should have > 10 Gigohm input resistance in the 20 V range. I tested it with just a 1 uF cap, charged to 3.3 V, and then discharged the input capacitor, and connected it again to the 1 uF, and the voltage dropped to 2 V, so should have an input cap of about 0.65 uF.Then I checked it with an external 1 uF, and 2 Meg parallel resistor. It dropped from 12 V to 4 V in about 4s, which should match the 1.65 uF effective capacitance pretty well.Finally I charged it with 3.3 V (with the external 1 uF, so 1.65 uF in sum), and it dropped to 3.1 V in 210 seconds, which means about 0.95 mV/s, or 1.5 nA.

author: hans
author_rank: Super Contributor
timestamp: September 20, 2025, 10:40:47 am
content: I presume that 10k (plus any other I/Os) are connected to the same capacitor you're taking voltage drain measurements from? Its easy to power a part through I/O pins with just 100nA of current required.1.5nA really sounds too low imo. E.g. at <1uA currents you can't exactly sprinkle high value caps everywhere because they are more likely to leak as much current themselves (a neat trap with supercaps). For 1uF MLCCs its probably not that big of an issue, but still, 1.5nA vs 100nA is a large difference.Maybe you can wire the circuit with e.g. a 100k resistor to its power rail, but in order to boot, you temporarily short the 100k out. Then once the PIC has entered standby, remove the short over that 100kR and measure the voltage drop with the DMM. At 100nA standby current, 100k should drop about 10mV.

author: FrankBuss
author_rank: Unknown
timestamp: September 20, 2025, 12:38:57 pm
content: Good idea, I tried it with 100k, and can measure 80 uV. But pretty sensitive, just touching the crocodile insulation increases it to 110 uV. This would be even lower, but I guess might be more accurate than with the capacitor, or maybe the microcontroller has some spikes sometimes. And the microcontroller is working fine: when shorting the resistor again and then pushing the button, it starts with the proper reset-from-sleep bit set. And right, looks like the 1 uF capacitors (X7R 0805) has also like 0.1-0.2 nA leakage.I guess I'll let it run for longer with only the 1 uF and nothing else connected, this should prove it then, unless it gets magically energy from somewhere.

author: hans
author_rank: Super Contributor
timestamp: September 20, 2025, 01:21:06 pm
content: 80uV over 100kR is only 0.8nA!? That's even lower..Yes uVs is quite sensitive level.. it can get into Seeback effects with different metals touching.Seeing the photo, is that LED wired in some way with the PIC? I believe these can also act as photovoltaic cells which might affect the measurement. At 100nA it doesn't require a great PV cell with room lightning to power the PIC, perhaps.

author: FrankBuss
author_rank: Unknown
timestamp: September 20, 2025, 02:28:30 pm
content: Yes, it is a RGB LED, connected to the PIC. But I removed it, and same effect. I tried it also with 1 Meg in series, and also same, starting with 950 uV, and then after some minutes going to even like 750 uV. There is also definitely some contact voltage: If I short it at the end of the leads, I measure 30 uV, or maybe this is an offset error of the multimeter.I tried it now with the 1 uF capacitor charged, and no power supply connected after going to sleep, only the Fluke, so effectively 1.65 uF. And this results in a higher average current of 2.3 nA, which should be most accurate, but still very low.Maybe I should run it with a 10 uF capacitor, then I could disconnect the Fluke as well, because the input capacitance wouldn't matter much when reconnecting it.

author: FrankBuss
author_rank: Unknown
timestamp: September 20, 2025, 04:39:04 pm
content: I did a cross reference with an ATTiny402, measurement setup all the same. And this needs a lot more, 136 nA, attached also the source code. I know, it is probably not the lowest power microcontroller, but wouldn't have expected such a difference. For their PIC extreme low power power (XLP) microcontrollersthey advertise itwith down to 9 nA in sleep mode. Maybe they use this for new production of the PIC10F202 as well now?

author: SiliconWizard
author_rank: Super Contributor
timestamp: September 20, 2025, 05:16:31 pm
content: The datasheet says about 100 nA @ 2 V in standby mode. I have a really hard time believing the 1.5 nA. I suppose you have the equipment to measure such a low current accurately.

author: hans
author_rank: Super Contributor
timestamp: September 20, 2025, 09:07:34 pm
content: Well the datasheet also only gives 1 significant digit. Maybe they didn't want to write 0.0 as its obviously notzero, but perhaps it is <<0.1uA.For example, a PIC16LF1516 specs 0.02uA typ. A STM32C0 does <=10nA. So its not unheard of. But with the PIC10F not being marketed as having XLP, and I expect Microchip to have the capability of measuring such low currents on their products, I wouldn't expect it. 1nA vs 100nA is still a huge difference.Though I do vaguely recall a Reddit (or here) thread that linked Microchip's product portfolio, and called them out on these currents as being a suspect typo. Unfortunately can't find where I read that.. many many months ago.But I also found this:https://www.reddit.com/r/microchip/comments/14nzkr3/list_of_pic_chips_by_typical_sleep_or_deep_sleep/So perhaps the measurement isn't a red herring, and these are some neat "undocumented" features of PICs. One of the comments in that thread posted by OP is right in pointing out that many manufacturers don't bother specifying leakage currents any better than 1uA with jellybean MOSFETs, diodes, etc. too.

author: FrankBuss
author_rank: Unknown
timestamp: September 21, 2025, 03:55:08 am
content: I did some more measurements, and also described everything in detail, and uploaded test projects for it::https://github.com/FrankBuss/low-power-testResult: Looks like it needs about 7 nA. I guess the lower measurement with the attached Fluke is because of the cables, contact voltage and mains noise etc. The 7 nA was measured just powered by 10 uF over 10 minutes, with no cables attached. And I also could verify this with a uCurrent. The ATtiny 402 needed 148 nA with the uCurrent.So I guess the conclusion is that the claimed 9 nA from Microchip for some microcontrollers is realistic, and that they probably even changed this for their old microcontrollers.The github project has also the programming hex files. Needs only a PICKit or MiniPro or other PIC programmer, would be cool if someone could measure and confirm it, too. I think it is a surprising result.Of course, for battery applications it doesn't matter. Self discharge for a CR2032 coin cell is like 300 nA, so it would still last like 10 years with the ATtiny in sleep mode. But might be important for energy harvesting applications, if you really need the lowest possible current consumption.PS: the PIC project is written in C, nice that with the __persistent keyword the variables are preserved with a wake-up reset. But the free compiler still doesn't produce good optimized assembler.

author: PanagiotisBourlakis
author_rank: Newbie
timestamp: September 23, 2025, 04:15:52 pm
content: This is really interesting! I am currently working on my Thesis which involves a triboelectric nanogenerator (known as TENG among academics). To be more specific, the triboelectric nanogenerator I made is a 20x20cm tile that will be placed on the floor:1) to harvest energy from human movement during the day2) as a sensing device during the nightThe "sensing" part in my design requires an MCU (for at least 8hrs) to read the signal on one pin --> Set another pin high for the TPS22860 load switch --> Enable the NRF54L for BLE silent alarm notification.Basically I am really grateful for this but I have one question:I don't have any ultra-low current measuring equipment available apart from the Nordic Power Profiler 2 which measures microAmps. I was wondering if I can use an electrometer to accurately measure the discharging of the capacitor (let's say 10uF). I mean, we use it to measure the charging voltage due to the very high internal impedance, and very low current losses, so in theory it's accurate enough for this?Thanks!

author: FrankBuss
author_rank: Unknown
timestamp: September 23, 2025, 05:51:42 pm
content: Haven't used an electrometer so far. Easiest thing is probably to use a multimeter with gigohm inputs like the Fluke 8842A I have here. But as demonstrated, this gives wrong results in the low nanoamp range, probably because of cables, stray capacitance etc.I'm planning to add a simple voltage follower on a test PCB, see screenshot. The OPA340NA has only 0.2 pA input bias, 10^13 ohm input resistance (10 TΩ), and a few pF capacitance, which should work perfectly for it.

author: PanagiotisBourlakis
author_rank: Newbie
timestamp: September 23, 2025, 07:18:08 pm
content: Op-Amps are pretty sweet for this type of job. I had a picture of the electrometer in my phone but forgot about it. It's the Keithley 617. It's quite old but offers >200TΩ input impedance with 20pF capacitance.I wish you had made this post sooner, I recently ordered some parts from Mouser and this should have been included! haha

author: FrankBuss
author_rank: Unknown
timestamp: September 23, 2025, 09:42:29 pm
content: The Keithley 617 looks nice, and with the shielded input probably no problem with noise etc. There is one on eBay for $500. But yeah, I wouldn't need it often, better to just buy a $2 opamp which does the same, at least for this test.

author: hans
author_rank: Super Contributor
timestamp: September 30, 2025, 01:00:48 pm
content: Out of curisioty, I tried to follow along with Frank using another PIC.I have a PIC18F26J50 here in DIP package. I connected it to a breadboard completely barebones: PGD/PGC/MCLR to PICKIT3 (which is disconnected during measurements of course), MCLR has 1K pull-up, 10uF alu cap on VCAP, VDD&VUSB connected to VDD (3.3V) and VSS to GND. There is 1x 100nF ceramic cap on VDD/VSS.Then I wrote this simple test program:Code:#include <xc.h>// PIC18F26J50 Configuration Bit Settings// 'C' source line config statements// CONFIG1L#pragma config WDTEN = OFF // Watchdog Timer (Disabled - Controlled by SWDTEN bit)#pragma config PLLDIV = 1 // PLL Prescaler Selection bits (No prescale (4 MHz oscillator input drives PLL directly))#pragma config STVREN = ON // Stack Overflow/Underflow Reset (Enabled)#pragma config XINST = OFF // Extended Instruction Set (Enabled)// CONFIG1H#pragma config CPUDIV = OSC1 // CPU System Clock Postscaler (No CPU system clock divide)#pragma config CP0 = OFF // Code Protect (Program memory is not code-protected)// CONFIG2L#pragma config OSC = INTOSC // Oscillator (INTOSC)#pragma config T1DIG = OFF // T1OSCEN Enforcement (Secondary Oscillator clock source may not be selected)#pragma config LPT1OSC = OFF // Low-Power Timer1 Oscillator (High-power operation)#pragma config FCMEN = OFF // Fail-Safe Clock Monitor (Disabled)#pragma config IESO = ON // Internal External Oscillator Switch Over Mode (Enabled)// CONFIG2H#pragma config WDTPS = 32768 // Watchdog Postscaler (1:32768)// CONFIG3L#pragma config DSWDTOSC = INTOSCREF// DSWDT Clock Select (DSWDT uses INTRC)#pragma config RTCOSC = INTOSCREF// RTCC Clock Select (RTCC uses INTRC)#pragma config DSBOREN = OFF // Deep Sleep BOR (Disabled)#pragma config DSWDTEN = OFF // Deep Sleep Watchdog Timer (Enabled)#pragma config DSWDTPS = G2 // Deep Sleep Watchdog Postscaler (1:2,147,483,648 (25.7 days))// CONFIG3H#pragma config IOL1WAY = OFF // IOLOCK One-Way Set Enable bit (The IOLOCK bit (PPSCON<0>) can be set once)#pragma config MSSP7B_EN = MSK7 // MSSP address masking (7 Bit address masking mode)// CONFIG4L#pragma config WPFP = PAGE_63 // Write/Erase Protect Page Start/End Location (Write Protect Program Flash Page 63)#pragma config WPEND = PAGE_WPFP// Write/Erase Protect Region Select (valid when WPDIS = 0) (Page WPFP<5:0> through Configuration Words erase/write protected)#pragma config WPCFG = OFF // Write/Erase Protect Configuration Region (Configuration Words page not erase/write-protected)// CONFIG4H#pragma config WPDIS = OFF // Write Protect Disable bit (WPFP<5:0>/WPEND region ignored)void startup() {volatile uint16_t dl = 25000;while (dl > 0) {dl = dl - 1;}}void main(void) {for (int i = 0; i < 100; i++) {startup();}TRISA = TRISB = TRISC = 0;while(1) {//WDTCONbits.REGSLP = 1;OSCCONbits.IDLEN = 0;INTCONbits.GIE = 0;DSCONHbits.DSEN = 1;asm("sleep");}return;}I have a Nordic PPK2. When I set it to sample 1Hz, the noise floor is at nA level.The program counts down from 25000 to 0 around 100 times. This should take the PIC a few seconds to do. When it is doing this, I measure 1.51mA current consumption at 3.3V (datasheet: 1.5mA typ)(the current spike during boot)Then the PIC enters sleep. When I just enable 3.3V output with no device connected, the PPK2 measures a current offset of approximately 2nAWhen I connect this PIC and after it enters sleep, I measure a current consumption of 15.5nA.When I disconnect the PIC power supply, the current consumption settles down back to previously measured 2nA.(here you can see the current settling down after disconnecting the PIC supply)That means 15.5-2nA = 13.5nATyp from datasheet should be about 3nA, max 50nA.Fun Fact; when I remove the 100nF cap the measured current drops down to 5.7nA (so net 3.7nA). But since you may need the cap during active mode, probably better left in circuit.So it looks like the 3nA from the datasheet is correct. Ironic how a cap consumes more power than the MCU...

author: FrankBuss
author_rank: Unknown
timestamp: September 30, 2025, 02:28:44 pm
content: Nice, the PIC18F26J50 is a pretty beefy chip with 64 kB flash and 3800 bytes RAM and USB, and still such a low power sleep mode. Setting all ports to output with TRISx=0 looks right, no influence because of some oscillating input. And right, capacitors can have a leakage current in the nA range, even ceramic. Thanks for testing.

author: hans
author_rank: Super Contributor
timestamp: September 30, 2025, 05:12:10 pm
content: Yes, the TRIS set to zero is to make sure no I/O pins leak current. I think the spec also says all pins are at either VDD or VSS.Presumably, in deep sleep mode the chip is powergated off almost completely. To be honest there are many more MCUs that advertize with tens of nA sleep current..Unfortunately the run current of this PIC18 does show its age. The INTOSC is only 4MHz so 1MIPS. I think if I shop in STM32 land with 1.5mA@3.3V, I can get a chip running at 16MHz (STM32U0).I have 1 correction on my previous post. The typ current in deep-sleep is 33nA at 25C, not 3nA (which is the figure for -40C). That makes the measurement a bit better than spec.Just to verify my measurement setup. There is no 50Hz ripple when sampling faster, as that could skew measurements.I also tried heating up this PIC with a bit of hot air... not sure how hot it got exactly, but it was leaking almost 0.5uA, so from datasheet its probably in the order of 70C.Make a guess where I touched the chip to check if was hot ( initially hot to the touch, but my finger quickly absorbed the remaining heat quickly )