328P sleep current wildly different between two copies

Go To Last Post
152 posts / 0 new

Pages

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

We're talking 'Power Down' mode here? Yes?

 

Has anyone looked to see EXACTLY what the generated code from the OP's sketch is?

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I wonder if those parts might be from green logic or whatever that AVR clone company is called.

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That would surprise me they have there own version that in many ways are better.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I know almost nothing about chip manufacturing. Must all deficient chips unconditionally invariably be destroyed, or is it possible to steal semi-defective devices?

The truth is more important than the facts.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't know how it's with microchip, but I know that Atmel didn't really test on die level it was cheaper to put them in a house, so they could be tested in a (cheaper) less clean environment.

So what happen with those that don't pass is a good question.

I remember that we had a place here in DK that in the 80's sold cheap ti TTL chips that only had a code on the bottom side (very very cheap and no warranty).

 

But since all these boards behave the same way I don't think it's rejects.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Brian Fairchild wrote:

We're talking 'Power Down' mode here? Yes?

 

Has anyone looked to see EXACTLY what the generated code from the OP's sketch is?

 

Yes.

 

My test sketch is in my first post.  You are welcome to do a test compile for the 3.3V Pro Mini, and examine whatever the IDE produces.  But in the end, the code works fine on the older Mini, but not on the newer ones, and whatever code is produced is the same for all.  So I don't think that exercise would tell you anything.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I reread this (#49), and I'm still not sure about floating inputs!

 

As asked in #33 what about the RX pin, you say that you have everything taken of the board.

Are you 100% sure that the bootloader disable the USART ? (To be clear if the RX bit is enabled in the USART the RX pin is an input regardless of the DDR register for pin.)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OP indicated he flashed the same bootloader, same fuses, and same application code to both PCBs...so USART will be configured the same between them.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Peabody wrote:

You are welcome to do a test compile for the 3.3V Pro Mini,...

 

That assumes that...

 

a) I have the Arduino toolchain installed

b) I can remember where to find, ideally the generated .lst file or likely, the .hex file and

c) if it's .hex that I have a way of disassembling it.

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Peabody wrote:

The new ones have these markings:

 

Atmel
MEGA328P
U-TW
35473D
1947X5N

and
1936S2P

 

 

The old one is:

 

Atmel
MEGA328P
U-KR
35473D
1829R5G

 

If those markings are on genuine chips then both your old and new chips have the same die and revision in them, 35473 rev D

 

The only difference is then the country of origin, KR vs TW (Korea/Taiwan).

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes but a floating input pin (without pull up) will behave different on different chips, and that is ok (it's outside spec) as long it's within spec of the datasheet  for normal use.

 

On some chips a floating pin go close to Gnd or Vcc (I guess leak in protection diodes), and it will be fine. On others it will sit close to Vcc/2 and the transistors will sit in the linear range and there will be a leak current.   

Last Edited: Fri. Jul 24, 2020 - 02:54 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Brian Fairchild wrote:
If those markings are on genuine chips

 

It's possible to check if they are genuine, the 328P keeps some data internally that should match the markings.

 

Discussion here:  https://www.avrfreaks.net/forum/undocumented-signature-row-contents

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Why not write a 12 line asm program...then there is no doubt all ports are output low, nothing is floating, all blocks use prr to power down, etc

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avrcandies wrote:

Why not write a 12 line asm program...then there is no doubt all ports are output low, nothing is floating, all blocks use prr to power down, etc

 

Why does it matter if it's 12 lines or 1200 lines?

 

OP indicated the SAME bootloader, SAME fuses, and SAME code were on both devices, yet one pulled more current than the other.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

OP indicated the SAME bootloader, SAME fuses, and SAME code were on both devices, yet one pulled more current than the other.

You seem to not be paying attention...if a line is left floating

 

on one chip there may be no effect

on another chip it may cause a large current draw 

 

   ...why...because it is floating, as no inputs on cmos logic should be allowed to float.... . However, when switching from one state to another, the input crosses the threshold region, causing the N-channel and the Pchannel to turn on simultaneously, generating a current path between VCC and GND. This current surge can be damaging, depending on the length of time that the input is in the threshold region (0.8 to 2 V). ...For example, if an 18-bit transceiver has 36 I/O pins floating at the threshold, the current from VCC can be as high as 150 mA to 200 mA. This is approximately 1 W of power consumed by the device

 

Now you are in the winner's circle!  The prize patrol will accept your credit card.

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 In case it matters, the new ones both had daubs of white paint covering the markings. 

I only order uC's in quantities of 10's not 10,000's, (or more).

But I've never seen factory new chips that were altered, (painted!).

That just sounds very suspicious.

 

It would be great if Peabody did open a support ticket with MC, as they can easily Xray the chip to see if it is their chip or a knock-off.

If it is a true MC part, then the question remains as to the current draw, if it is a counterfeit part then all bets are off, it doesn't have to follow the detailed spec's of the data sheet.

 

I thought I saw it mentioned above, but on a quick read through again I missed it.

I wondered the test set up and instrument used to measure the sleep currents.

I'd love to see a picture of the setup.

 

Although I have several DMMs, I only have one Fluke, (Thank you MicroCarl!), and I don't recall it's low range current capabilities.

I routinely measure mA's, not 1.x uA's or pA's ...

Hence my interest in how one does this accurately and reproducibly.

 

JC

  

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I routinely measure mA's, not 1.x uA's or pA's ...

I asked about this early in the thread, run-of-the-mill meters could be off a good fraction of a milliamp  (10's or 100's of microamps).. At least go back to the "working" chip to ensure  its not a matter of  0.1 mA (100 uA) drift.

 

I've got some pretty good 6.5 digit meters, but never really use 'em, just like my Fluke 189 instead.  I picked up a Yokogawa calibrator for a song (like $150), I should blow off the dust & get the calibrator calibrated!   Then go around and ensure everything is nulled out.

https://www.ebay.com/itm/YOKOGAWA-2552-12-1200V-25mA-DC-Standard-Source/143639293976?hash=item217191b018:g:EaIAAOSwB0he8qp4

 

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avrcandies wrote:

Now you are in the winner's circle!  The prize patrol will accept your credit card.

 

 

Woah, burn...you really got me there.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DocJC wrote:

 

I thought I saw it mentioned above, but on a quick read through again I missed it.

 

I wondered the test set up and instrument used to measure the sleep currents.

I'd love to see a picture of the setup.

 

Although I have several DMMs, I only have one Fluke, (Thank you MicroCarl!), and I don't recall it's low range current capabilities.

I routinely measure mA's, not 1.x uA's or pA's ...

Hence my interest in how one does this accurately and reproduciblly.

 

JC

 

I don't know what this "DMM " rubbish is you speak of.  Attached is a picture of my test instrument.  This is shown reading the current drawn by the bad Mini after it has gone to sleep,  set to the 0.5mA scale, or 500uA.  Not shown is the 3.3V power supply.  The good mini reads essentially zero (you can just barely see the needle move above zero) on the 50uA scale.

 

 

Attachment(s): 

Last Edited: Fri. Jul 24, 2020 - 10:28 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think grandpa wants his multimeter back! Oops! He thinks anything other than an AVO8 is trash :)

Regardless of whether you use a digital or analog multimeter, there’s traps when measuring low currents. Ron gave some links in#68. Whether the burden voltage is an issue in this case is debatable - it can cause weird results.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

Oh boy, you can certainly have a lot of meter troubles...since there is no analog circuitry to amplify the current, you probably have a very high ohm shunt (terrible as a low impedance AVR power supply connection).

Do you know what your burden voltage (voltage loss) is?   What voltage do you measure at the AVR when your current meter is installed to measure current?

 

Try running your current through a 100 ohm resistor and good size cap on the AVR side & just measure the voltage drop across that.  A  few microamps will then only generate a few hundred microvolts drop.  The 100 ohms isn't  the "best" connection, but tolerable.    You can set your meter to the current range & use another meter to ohm it out....see what it's shunt resistance is...it could be a few 1000 ohms.

 

One thing going for the analog gauge, is it does a nice job of averaging.   You definitely need to ditch it & at least get a true rms meter for general work.  True RMS is the ONLY way to go these days.  Don't buy a non-true rms meter.   

 

I took an old junko FREE harbor freight meter 

on the 200uA scale, it reads as a 1000 ohm shunt.....kinda blah

my fluke 197 reads 100 ohms on the ua scale...much better (well, 10 times better).

 

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Sat. Jul 25, 2020 - 01:03 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
Whether the burden voltage is an issue in this case is debatable - it can cause weird results.
My first thought.

 

avrcandies wrote:
Try running your current through a 100 ohm resistor and good size cap on the AVR side & just measure the voltage drop across that.

Or, bypass the meter with a hard short, then power-up the AVR.  Let it sit for a few seconds, long enough to be certain that the bootloader has timed out and the app has started and gone to sleep, then remove the hard short across the meter.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well I was kinda pulling your leg.  I also have a digital meter.  It reads 0 mA on the good Mini, and .15mA on the bad one.  So, the same reading on both meters.  And actually, I find the analog meter to be useful in some situations.  Anyway, this isn't a meter problem.  The difference between good and bad is two orders of magnitude.  A precise measurement isn't the issue.  And by the way, that analog meter is a genuine Soltec, not some cheap imitation.  :-)

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

The issue >>may<< be that with the burden voltage of any meter, analogue or digital, can cause the AVR to run out-of-spec while coming out of reset and running code before going to sleep.  Out-of-spec means all bets are off.  As in, no guarantees.  Process variations from different fabs may be the only thing at work here, with the 'bad' chips misbehaving in a way that shows your high sleep current, and the 'good' chips misbehaving in another way which does not.

 

Perform a proper test, as suggested in #74.  I don't >>expect<< to find any change, but still you must rule this out.

 

 

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Speaking of picking things up from Digikey, they sell quite a variety of current sensor ICs with shunt resistance in the milli (and micro I think!) ohm range.  Might take a bit of support stuff to make them behave (or buy a development kit) but if you're seriously worried about microamps and nanoamps you should get the right tools to measure them.  IMHO.  If $23 is important, perhaps you'd do better spending the money on a nice dinner with a cheerful friend.  S.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There's no point talking about the measuring equipment. We are not trying to distinguish between say 0.15µA and 0.16µA here. We are talking about much bigger differences.
 

The truth is more important than the facts.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Yes, but read post #76

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

poftamunk wrote:
There's no point talking about the measuring equipment

You've missed the point!

 

The point is that the meter's series resistance (whence "burden voltage") might be interfering with proper operation of the AVR.

 

Effectively, the power supply has a too-high impedance.

 

In particular, the high resistance might be preventing it from starting correctly - leaving it in an unexpected state, which draws the excess current.

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Perhaps have a BIG cap on the power and let it live of that while at sleep. Then measure the voltage every ? 10 min. (for a short time if it's a bad meter). If the voltage drop from 5V to 4V take the same time it's a current measuring problem. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

sparrow2 wrote:
Perhaps have a BIG cap on the power and let it live of that while at sleep

Good idea.

 

Would have to be sure it's a low-leakage cap, though ...

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

poftamunk wrote:
There's no point talking about the measuring equipment

You've missed the point! The point is that the meter's series resistance (whence "burden voltage") might be interfering with proper operation of the AVR.

 

The manual for the meter is online. The answer is 800 ohms.

 

 

[EDIT]

 

To be accurate it's 736 Ohms.

Attachment(s): 

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

Last Edited: Tue. Jul 28, 2020 - 11:47 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

And BTW, the burden resistance on the 50uA range will be 5k!

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

poftamunk wrote:

There's no point talking about the measuring equipment...

 

I beg to differ...

 

Brian Fairchild wrote:

To be accurate it's 736 Ohms.

 

And why does this matter.

 

You have a 736 Ohm resistor that is in series with your 3.3V supply.

 

On start up your chip, on 3.3V and 8MHz, will want to draw around 3mA. Which I make a drop of (0.003 x 800) = 2.4V. That's 2.4V across the meter. So your chip is left with 0.9V. So it won't even get to running your power saving code.

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Brian Fairchild wrote:
To be accurate it's 736 Ohms

which is rather high for a power supply impedance.

 

@ Peabody : What current does the AVR take at start up?  At that current, what will its Vdd voltage be?

 

EDIT: Brian beat me to it on that!

 

In #74, joeymorin wrote:
bypass the meter with a hard short, then power-up the AVR.  Let it sit for a few seconds, long enough to be certain that the bootloader has timed out and the app has started and gone to sleep, then remove the hard short across the meter.

Do that!

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Tue. Jul 28, 2020 - 12:01 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ohm's law is hard to argue with!

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ohm's law is hard to argue with!

I bet some of those protesters in Melbourne would try anyway.....they have rights you know, they may not agree with Ohms law and therefore they will not comply with it.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

Perhaps it's different "real" chips I was looking in different change notes and found this (for all mega48 88 168 328)

Atmel 2015

 

 And this from Microchip this year

 

 

So at some point then production have been moved to Colorado FAB5 

or perhaps the high current are SMIC chips

 

Add

Or is Microchip Colorado FAB5, an old Atmel FAB ? 

Last Edited: Wed. Jul 29, 2020 - 10:33 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

sparrow2 wrote:

...So at some point then production have been moved to Colorado FAB5...

 

I think that at the moment you start using chips so far out of spec then all bets are off and anything written in the datasheet is meaningless.

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Brian Fairchild wrote:
the moment you start using chips so far out of spec then all bets are off

Absolutely - you are into undefined behaviour !

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would like to add another bit of evidence that may support my belief that all the 328P stock now has the high sleep current.

 

There is a recent video by Ralph Bacon which deals with using a DS3231 alarm to wake up a 328P-PU DIP chip:

 

https://www.youtube.com/watch?v=-dW4XsBo3Mk

 

Of course he is concerned with sleep current here, and in an effort to determine what's drawing current, at 6:10 into the video he pushes the button that makes the processor set the alarm, then go to sleep, and then he disconnects the power from the DS3231.  At that point, the 328P sleep current drops to:

 

 

150uA.

 

 

Now of course I don't know his fuses or bootloader or whether he has everything turned off, but he has done all of this before many times, so I assume he's doing it right.  In fact he says he has demonstrated before that the 328P will sleep at far lower currents.  His explanation of the 150mA - the I2C lines - I believe is wrong because he has disconnected the power to the module.

 

I think it's possible that it's not just a coincidence that the 150uA he is seeing is exaclty the same as I am seeing in the AU parts.  I have written to him to ask about the date code on the PU, and if he can repeat his test using an older PU part.  I also asked about his source for the PU chips.

 

Meanwhile, Kevin Darrah reports that he has ordered new (i.e. - 2020) AU parts from Digikey, and will test them on arrival.  For those not familiar with him, here's his video from a while ago about sleep current:

 

https://www.youtube.com/watch?v=urLSDi7SD8M

 

Film at 11:00, as they used to say.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So have you done the test described in #74 (and mentioned in#86) yet ?

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, as I mentioned in #75, the analog meter was kind of a joke, and I also have a digital meter that reads the same current.  But apparently nobody paid any attention to that, preferring to give me grief about the analog meter.  But yes, I tried shorting around each meter until sleep was underway, and that made no difference.  But it doesn't matter.  Kevin will be testing one of my Minis, as well as a new 328P from Digikey, using his extensive gear.  And I think those tests will pretty much tell the story.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In both those videos I can see glaring errors/assumptions. Be careful how much creedence you give these. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

DMM have burden voltages, too.  Generally higher for lower current ranges.  What's yours on the range you are using?

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It's not entirely impossible that you did get two different chips - but instead of your thought that one was bad - perhaps it's that the other one was a wacky statistical outlier.  You got one awesome one - and the other was normal, not defective.  You should be happy.  S.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The promised value is below 0.2µA.

 

 

The truth is more important than the facts.

Last Edited: Fri. Jul 31, 2020 - 04:58 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

poftamunk wrote:

The promised value is below 0.2µA.

 

I don't think anyone disputes that.

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


The whole issue is easily solved.

 

1) Take 1 genuine 328P with the same die revision as the OP (35473D). BTW, I know it's genuine because I buy directly from Microchip.

 

2) Put it in the minimal circuit possible...

 

 

3) Set the fuses...

 

 

4) Program the code...

 

        /* Prepare the sleep in power down mode*/
        SMCR |= (1<<SE) | (0<<SM2) | (1<<SM1) | (0<<SM0);
        /* Disable brown out detection in sleep */
        tmp = MCUCR | (1<<BODS) | (1<<BODSE);
        MCUCR = tmp;
        MCUCR = tmp & (~(1<<BODSE));
        /* Enter sleep mode */
        #asm("sleep");

 

5) Measure the result...

 

 

6) Verify the test setup and methodology with different code...

 

    while (1) {


      }

 

7) Show the verification...

 

 

 

Happy to have any observations regarding my tests.

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Now, does anyone know if the OPs code falls foul of this note in CVAVR's help file regarding sleep functions...

 

Peabody wrote:

 

#include <avr/sleep.h>
#include <avr/wdt.h>
int i;

void setup(){

  for (i = 0; i < 20; i++) {          // all pins to one rail or the other
    pinMode(i,OUTPUT);
    digitalWrite(i,LOW);
  }
  ADCSRA = 0;                         // disable ADC for power saving
  wdt_disable();                      // disable WDT for power saving
  set_sleep_mode (SLEEP_MODE_PWR_DOWN); // Deep sleep
  sleep_enable();
  sleep_bod_disable();                // disable brownout detector during sleep
  sleep_cpu();                        // now go to sleep

}

void loop(){
}

 

 

Quote:

Note: There are specific situations where the power management functions can’t be used because of the timing limitations.

For example the ATmega168P chip has a feature which is not available in ATmega168: Brown-Out Detection disable during sleep.

If we wish to use this feature, we need to enter in sleep mode in maximum 4 clocks after the BODS bit is set in the MCUCR register.

But calling and executing the powersave function requires a longer time than than this, so this example code will not function correctly:

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

Pages