Author Topic: Arduino Pro Mini - two copies have different sleep currents  (Read 29505 times)

0 Members and 1 Guest are viewing this topic.

Offline PeabodyTopic starter

  • Super Contributor
  • ***
  • Posts: 2008
  • Country: us
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #50 on: July 25, 2020, 04:38:00 pm »
Out of curiosity, more than any particular idea.

Would you like to try my SimpleSleep Arduino library

  https://github.com/sleemanj/SimpleSleep


Code: [Select]
#include <SimpleSleep.h>

SimpleSleep Sleep;

void setup()
{

}

void loop()
{

  for (i = 0; i < 20; i++) {          // all pins to one rail or the other - power saving
    pinMode(i,OUTPUT);
    digitalWrite(i,LOW);
  }

  Sleep.forever();
}

It should behave the same as your test code I think and produce the same results, but worth a shot.

I tried your library and sketch, and the Mini still sleeps at 150uA.

 
The following users thanked this post: thm_w

Offline drvtech

  • Regular Contributor
  • *
  • Posts: 111
  • Country: gb
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #51 on: July 28, 2020, 02:03:24 pm »
I know it's not much help but I just put a couple of chips onto bare boards (with a single decoupling cap) and they sleep at around 0.2uA according to my trusty EEVBlog 121GW meter.
The exact chip marking details are:

Mega328P U-TW
354730
1825017
Sleeps at around 0.15uA (Yes, 150nA)

Mega328PB-U
1824D TW
1824TWY
Sleeps at 0.2uA

I had to recheck the readings as they seemed unrealistically low but there is definitely a mu symbol and not an m on the display.
I added a few lines of code to send a squarewave out to one pin for 10 seconds before it goes to sleep just so I could check that I was really reading the current and hadn't forgotten to connect something! They draw about 7 mA before they go to sleep.

The boards don't have a crystal so the chips were running from the internal 8MHz oscillator
These chips were bought from RS components so they will be genuine.

As I said, it's not much help but it might serve as another data point. I guess that the 1824 might indicate a 2018 manufacturing date.
 

Offline SilverSolder

  • Super Contributor
  • ***
  • Posts: 6126
  • Country: 00
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #52 on: July 28, 2020, 04:46:57 pm »

What happens to processors that are rejected at the Atmel factory for drawing too much current during sleep....   ?   

 

Offline PeabodyTopic starter

  • Super Contributor
  • ***
  • Posts: 2008
  • Country: us
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #53 on: July 28, 2020, 05:11:40 pm »
Thanks very much for that report.  Yes, 1824 is the 24th week of 2018,  And all chips of that age appear to work just fine.  My "good" chip is 1829, and Kevin Darrah has confirmed that he has chips from Digikey with the 1829 date code, and they also sleep at under 1uA.

All the chips I got in my two recent Pro Mini clone orders are dated between 1936 and 1942, and they all sleep at 150uA.  So the question is - are the new ones counterfeits, or are the new ones genuine Microchip parts, and by implication, has Microchip screwed up the 328P?  Kevin is going to try to get *current* product direct from Microchip, just to eliminate any possibility of a counterfeit, but if he isn't successful, Digikey has confirmed to me that they have stock dated March, 2020, so I can get one there if needed.

I think there's a good bit at stake here.  If Microchip has been pumping out bad parts since mid-2019, they've gone into  every Pro Mini, Uno, Nano, etc, etc, that's been made since then.  The sleep current issue may not be important in most usage cases, but any design that's battery powered, and uses sleep mode to minimize power consumption, would be affected.  And of course we don't know what else in the chip may not function correctly.  So I'm kinda hoping my chips are counterfeit.

Anybody on here have more recent 328P-AU parts on hand that they know are genuine?
 
The following users thanked this post: elecdonia

Offline DrG

  • Super Contributor
  • ***
  • !
  • Posts: 1199
  • Country: us
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #54 on: July 28, 2020, 06:30:16 pm »
Thanks very much for that report.  Yes, 1824 is the 24th week of 2018,  And all chips of that age appear to work just fine.  My "good" chip is 1829, and Kevin Darrah has confirmed that he has chips from Digikey with the 1829 date code, and they also sleep at under 1uA.

All the chips I got in my two recent Pro Mini clone orders are dated between 1936 and 1942, and they all sleep at 150uA.  So the question is - are the new ones counterfeits, or are the new ones genuine Microchip parts, and by implication, has Microchip screwed up the 328P?  Kevin is going to try to get *current* product direct from Microchip, just to eliminate any possibility of a counterfeit, but if he isn't successful, Digikey has confirmed to me that they have stock dated March, 2020, so I can get one there if needed.

I think there's a good bit at stake here.  If Microchip has been pumping out bad parts since mid-2019, they've gone into  every Pro Mini, Uno, Nano, etc, etc, that's been made since then.  The sleep current issue may not be important in most usage cases, but any design that's battery powered, and uses sleep mode to minimize power consumption, would be affected.  And of course we don't know what else in the chip may not function correctly.  So I'm kinda hoping my chips are counterfeit.

Anybody on here have more recent 328P-AU parts on hand that they know are genuine?

I have been following this thread and the one on avrfreaks. I was really happy to hear that you made contact with Kevin Darrah  https://www.kevindarrah.com/wiki/index.php?title=Projects: He seems very well suited to investigate the issue(s) and I am looking forward to hearing what he can uncover.

At this point,I am just going to wait before speculating too much on counterfeits or, for lack of a better term, manufacturing flaws. If there is a systematic problem due to either, it will be uncovered.
- Invest in science - it pays big dividends. -
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16621
  • Country: us
  • DavidH
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #55 on: July 28, 2020, 06:33:50 pm »
It would not be the first time that parts with a high out of specification quiescent current were accidentally sold.  In most applications it would not be noticed.
 

Offline PeabodyTopic starter

  • Super Contributor
  • ***
  • Posts: 2008
  • Country: us
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #56 on: July 28, 2020, 09:26:48 pm »

I have been following this thread and the one on avrfreaks. I was really happy to hear that you made contact with Kevin Darrah  https://www.kevindarrah.com/wiki/index.php?title=Projects: He seems very well suited to investigate the issue(s) and I am looking forward to hearing what he can uncover.

At this point,I am just going to wait before speculating too much on counterfeits or, for lack of a better term, manufacturing flaws. If there is a systematic problem due to either, it will be uncovered.

I contacted Kevin because he is known for his ultra-low-power stuff.  And I agree that he is better suited than I to take this to a conclusion one way or another.  In the end, I just want to find a source of Arduino Pro Mini clones that sleep properly.  I hope that's still possible.
 

Offline DrG

  • Super Contributor
  • ***
  • !
  • Posts: 1199
  • Country: us
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #57 on: July 28, 2020, 10:00:07 pm »

I have been following this thread and the one on avrfreaks. I was really happy to hear that you made contact with Kevin Darrah  https://www.kevindarrah.com/wiki/index.php?title=Projects: He seems very well suited to investigate the issue(s) and I am looking forward to hearing what he can uncover.

At this point,I am just going to wait before speculating too much on counterfeits or, for lack of a better term, manufacturing flaws. If there is a systematic problem due to either, it will be uncovered.

I contacted Kevin because he is known for his ultra-low-power stuff.  And I agree that he is better suited than I to take this to a conclusion one way or another.  In the end, I just want to find a source of Arduino Pro Mini clones that sleep properly.  I hope that's still possible.

Yeah, I hear ya. At this point, I just don't think it is something silly and that is what gets me so interested. We shall see - probably :)
- Invest in science - it pays big dividends. -
 

Offline PeabodyTopic starter

  • Super Contributor
  • ***
  • Posts: 2008
  • Country: us
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #58 on: July 30, 2020, 11:34:11 pm »
Another interesting tidbit.  Here's a recent Ralph Bacon video about using a DS3231 to wake up a 328P-PU breadboard Arduino.



At 6:10 into the video he puts the processor to sleep, then disconnects power to the RTC, and measures the resulting sleep current.  He gets 150uA.  And of course that's exactly what I'm getting on the new AU parts.

I've written to him asking about the date code on the PU chip, and asking if he can repeat the test with an older PU.

I would just say it's beginning to look like all 328P parts may now have this flaw.

Kevin Darrah has ordered new stock from Digikey, and will test it on arrival.  So we shall see pretty soon now.  But I thought the Ralph Bacon thing was interesting.
 
The following users thanked this post: thm_w, elecdonia

Offline SilverSolder

  • Super Contributor
  • ***
  • Posts: 6126
  • Country: 00
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #59 on: July 31, 2020, 12:06:53 am »

Have you tested ATmega328PB as an alternative?
 

Offline PeabodyTopic starter

  • Super Contributor
  • ***
  • Posts: 2008
  • Country: us
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #60 on: July 31, 2020, 01:40:13 am »

Have you tested ATmega328PB as an alternative?

No, I have no experience with the PB.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4199
  • Country: us
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #61 on: July 31, 2020, 01:59:17 am »
Quote
I noticed your pro mini arduino board has a 4 ohm series resistor in the RAW power supply line. My identical boards have a 5 ohm.
I'm pretty sure that that's a polyfuse, not a resistor...
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 4040
  • Country: nz
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #62 on: July 31, 2020, 02:13:19 am »
Annoys me he keeps referring to a bare ATMega328 as an "Arduino". Too picky? Two thirds of my boards that use the Arduino API have cpus other than AVR.
 
The following users thanked this post: newbrain

Offline sleemanj

  • Super Contributor
  • ***
  • Posts: 3025
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #63 on: July 31, 2020, 06:48:59 am »
As another data point, just tested in my test socket PCB I made a few years ago and forgot that I had....

 1933 date code pulled from a Chinese Nano sourced in the last 6-8 months sometime power down mode circa 150uA, idle current ( delay(...) ) 3.3mA

 1648 date code from some Chinese supplier a few years ago, power down mode less than 1uA, idle current 3.6mA

This is with the exact hardware, exact firmware, literally pulled one chip out of the socket put the next one in.  Verified with two meters, unfortunately I don't have a meter than can give me the nano amps for the 1648 coded one.



~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 
The following users thanked this post: thm_w, Peabody

Offline PeabodyTopic starter

  • Super Contributor
  • ***
  • Posts: 2008
  • Country: us
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #64 on: July 31, 2020, 01:27:30 pm »
Thanks very much.  So far it seems that 2019 date codes sleep at 150uA, but older ones sleep at less than 1uA.  But we still don't know if known genuine Microchip parts also follow that pattern.  Should know more about that next week.  The latest date code I have from a Chinese source that sleeps at 1uA is 1829.


« Last Edit: July 31, 2020, 01:29:09 pm by Peabody »
 

Offline SilverSolder

  • Super Contributor
  • ***
  • Posts: 6126
  • Country: 00
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #65 on: July 31, 2020, 06:56:07 pm »

The picture of the "Good" processor is incorrect in that post (forum has a picture attachment bug that you may have fallen foul of)

I went back again and checked it this morning, and it had replaced the correct image that had been there before with a schematic that I had posted in another thread.  So I've deleted the schematic, then attached the correct picture again.  It all looks ok to me now, but that's not to say it won't get messed up again.  Is there any information on what leads to this bug or what can be done to avoid it?

There is a workaround listed here:  https://www.eevblog.com/forum/chat/website-error-reports/msg3151250/#msg3151250

The surrounding thread has been talking about the bug for a while.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16621
  • Country: us
  • DavidH
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #66 on: July 31, 2020, 07:27:58 pm »
How could such a complex integrated circuit be cloned?  Could they have gained access to the masks or would this be another case of rejected chips being remarked and sold?
 

Offline hans

  • Super Contributor
  • ***
  • Posts: 1641
  • Country: nl
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #67 on: July 31, 2020, 09:01:50 pm »
An ATMEGA328P is not a complex chip for todays standards. Digital descriptions are easily transferred by a common format such as VHDL/Verilog, which can be synthesized for FPGAs (as soft-core, which is often done by FPGA community) or silicon. There are lots of community clones of AVR cores for FPGA's (take a look on github or opencores.org, which can be repurposed for own silicon. Cloners probably only need to add analog peripherals and some missing digital stuff, and then package it.

Analog performance of clones is often not as good, in particular ADC/voltage reference performance (e.g. less accurate, more noise) and power consumption (often higher). I suspect that cloners are not concerned that "sleep" functions only copy behaviour, but not the specifications..
 

Offline robca

  • Frequent Contributor
  • **
  • Posts: 257
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #68 on: July 31, 2020, 10:24:49 pm »
How could such a complex integrated circuit be cloned?  Could they have gained access to the masks or would this be another case of rejected chips being remarked and sold?
At the moment there are 6 Chinese clones of the STM32F103, each subtly different but broadly compatible. It is causing countless problems with people buying Blue Pills. Some chips (like the GD32) can actually be considered even better than the original, as they can be clocked higher and have a faster onboard flash

Granted, that chip is based on a M3 ARM core, so at least some part might be easier to clone, but it's a significantly more complex chip than an Atmega32p

The real question to me is "why clone a chip that is getting old and costs so little". But the Atmega 328p is still pretty ubiquitous and saving cents probably matters to the OEMs selling cheap gizmos on eBay/Alibaba
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 4040
  • Country: nz
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #69 on: August 01, 2020, 12:16:45 am »
At the moment there are 6 Chinese clones of the STM32F103, each subtly different but broadly compatible. It is causing countless problems with people buying Blue Pills. Some chips (like the GD32) can actually be considered even better than the original, as they can be clocked higher and have a faster onboard flash

That appears to be not quite right :-)

It seem certain from die shots that the GD32 and GD32V (RISC-V) chips have VERY slow and cheap flash on a separate die in the package and copy it to onboard SRAM on startup.

That explains:

- why they can be clocked so much higher

- why the GD32 & GD32V take ~130 ms to come out of reset (and 120 ms to wake from the 7 uA standby mode vs 6 us from the 400 uA "deep sleep"), while STM32F103 takes 50 us to come out of the 2 uA standby mode and 5 us from the 13 uA stop mode. The GD32 is copying your code from flash to SRAM after reset or standby.
 

Offline robca

  • Frequent Contributor
  • **
  • Posts: 257
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #70 on: August 01, 2020, 01:00:52 am »
At the moment there are 6 Chinese clones of the STM32F103, each subtly different but broadly compatible. It is causing countless problems with people buying Blue Pills. Some chips (like the GD32) can actually be considered even better than the original, as they can be clocked higher and have a faster onboard flash

That appears to be not quite right :-)

It seem certain from die shots that the GD32 and GD32V (RISC-V) chips have VERY slow and cheap flash on a separate die in the package and copy it to onboard SRAM on startup.

That explains:

- why they can be clocked so much higher

- why the GD32 & GD32V take ~130 ms to come out of reset (and 120 ms to wake from the 7 uA standby mode vs 6 us from the 400 uA "deep sleep"), while STM32F103 takes 50 us to come out of the 2 uA standby mode and 5 us from the 13 uA stop mode. The GD32 is copying your code from flash to SRAM after reset or standby.
Yes, I did oversimplify to avoid hijacking the thread (your explanation is the correct one, though). By using SRAM, de facto they have what the user perceives as "faster flash". Even without overclocking, a GD32 can fetch instructions from "flash" faster than an STM32 can (because it's not flash :)). The tradeoff is the slow boot and wake up time. But there are valid scenarios where their design decision makes a lot of sense. My main point was that the GD32 is one of the better clones (including better docs than most other clones), but still not an STM32F103
 

Offline phil from seattle

  • Super Contributor
  • ***
  • Posts: 1029
  • Country: us
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #71 on: August 01, 2020, 03:18:40 pm »
How could such a complex integrated circuit be cloned?  Could they have gained access to the masks or would this be another case of rejected chips being remarked and sold?
At the moment there are 6 Chinese clones of the STM32F103, each subtly different but broadly compatible. It is causing countless problems with people buying Blue Pills. Some chips (like the GD32) can actually be considered even better than the original, as they can be clocked higher and have a faster onboard flash

Granted, that chip is based on a M3 ARM core, so at least some part might be easier to clone, but it's a significantly more complex chip than an Atmega32p

The real question to me is "why clone a chip that is getting old and costs so little". But the Atmega 328p is still pretty ubiquitous and saving cents probably matters to the OEMs selling cheap gizmos on eBay/Alibaba

This is why I have decided not to do a product based on the Blue (or Black) Pill.  Too much variability to be able to say "buy X and install it".  Even a given merchant selling them over time never quite knows what they actually have at any point. I'll stick with the teensys - at least you get a guaranteed product every time.

And, yes, the GD F103 does appear to be quite a bit faster than the original.  At least they don't claim to have a real ST32F103...
 
The following users thanked this post: elecdonia

Offline gamblingfetus

  • Newbie
  • Posts: 3
  • Country: us
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #72 on: August 03, 2020, 01:52:53 am »


  • 354A3P - 5V 16 MHz version
  • 35473D - 3.3V 8 MHz version

I bought both versions intentionally here.

1039616-0

1039620-1
 

Offline PeabodyTopic starter

  • Super Contributor
  • ***
  • Posts: 2008
  • Country: us
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #73 on: August 03, 2020, 04:25:20 pm »

  • 354A3P - 5V 16 MHz version
  • 35473D - 3.3V 8 MHz version

I bought both versions intentionally here.


I have one exactly like your first one - same date code and everything.  I also have one like your second one except the date code is earlier - 1936.  Both of mine sleep at 150uA at 3.3V.  By the way, I don't think the processor itself is necessarily different for 3.3V and 5V.  They would be flashed with different bootloaders, and possibly have different fuse settings, but I think all the 328Ps will work fine at either voltage.

Well, the only way I know of to test the sleep current is to remove the voltage regulator and power-on LED, which kinda ruins the Mini if that's not the way you intend to use them.  So I'm not going to suggest you do that.  Besides, at this point I think the test that counts is the one Kevin will do on a known-genuine 328P that he should receive this week from Digikey.

 

Offline sleemanj

  • Super Contributor
  • ***
  • Posts: 3025
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
Re: Arduino Pro Mini - two copies have different sleep currents
« Reply #74 on: August 10, 2020, 06:07:34 am »
My Pro-Minis from Taobao finally arrived (shipping PITA currently), date code 2002.  I won't pull a chip off yet to test but will hold onto a couple in case we still need more data.

~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf