ATtiny*61A unusually high current consumption, I'm baffled

Go To Last Post
18 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

 

this is my first post, hello to everyone. I'm a software engineer and I work with microcontrollers in my free time (I know software, electronics is a bit of a trial and error business for me, though I've had some accomplishments). I'm familiar with and mostly use the ATtiny24 and ATtiny85, I've also played with some of the ATmegas a bit.

 

I recently began a project where I needed more PWM channels than the 24 or 85 offer, and so I opted for the ATtiny861A. I wrote some code and successfully programmed and verified my chip, so I'm certain that my hardware isn't broken. However when I connect to a power source, the chip draws way too much current (in excess of 250mA) without anything hooked up to the I/O pins. I suspected some mistake in my programming at first, or perhaps some fault with the particular chip, so I tested all the other 9 chips (still in factory condition!!) that I have, and they all show the same behavior.

 

I've been up and down the datasheet and I'm out of ideas as to what to try to get this chip to run or what I'm doing wrong (connecting VCC and GND is about as simple as it gets, and as I understand it, the amount of current that I am observing should never happen). Like I said I can program and read/verify the chip (using a GALEP5), so the hardware appears to be fine.

 

Does anybody have any ideas?

 

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

Welcome to AVRFreaks! 

 

Since we can not see your project you will need to be our eyes and hands. 

Start by posting your schematic of your project (please do not tell me you don't have schematic). 

And a clear picture of the project as well. 

 

You state it draws too much current, how much is too much, state how many milliamps it is drawing and what you expected.

Are you accounting for the current draw of the other parts of the circuit and not just the micro?

Do you still have your programmer attached, the current draw will change when it is not connected/connected.

Check your solder connections, it is easy to short two pins together if you are new to soldering.

 

I'm sure I'll think of more, but lets see the schematic and the picture, we'll be kind, really!

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

Last Edited: Thu. Jun 20, 2019 - 12:24 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dear Jim,

thank you for your reply.

I do not, in fact, have a circuit diagram handy -- however I really believe it is not necessary in this case. Please bear with me for one moment before explaining why it really is.

My circuit consists of a power source (USB-powered serial adapter, I am just using Vcc and GND), a voltmeter for current measurement and the chip itself, no other components(!).

I tested this setup with one chip that I had programmed, and then with nine other chips that were untouched since the factory, with the same results -- more than 250mA drawn by a chip which, when idle and not driving any I/O should draw in the neighborhood of 5mA.

This is definitely not caused by external components or faulty wiring/soldering, because there is none of either.

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

siberion wrote:

.. I wrote some code and successfully programmed and verified my chip, so I'm certain that my hardware isn't broken. However when I connect to a power source, the chip draws way too much current (in excess of 250mA) without anything hooked up to the I/O pins. I suspected some mistake in my programming at first, or perhaps some fault with the particular chip, so I tested all the other 9 chips (still in factory condition!!) that I have, and they all show the same behavior.

Do you have decoupling caps ?  What power supply are you using ?

Does the chip get hot ?

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

Dear Who-me,

thanks for your reply.

I'm not using any caps at this point (I never needed to with ATtiny85 and such, for my purposes at least) and the power supply is a USB to serial adapter that's part of the myAVR package. I've successfully used it to test and drive many previous ATtiny projects.

I didn't keep the power connected long enough to let the chip get hot. The serial adapter has a power LED which dimmed visibly when I made the connection, and sometimes the short-circuit protection tripped. After that I only made a connection long enough to measure the current flow with a voltmeter in between.

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

Such a symptom is often caused by pins that are set to be outputs at logic high, but are then grounded, externally. That external ground can be caused by an number of "Oh, sh*t, I didn't think that was there!" kinds of things.

 

The very first and easy thing to do: make ALL port pins to be inputs. Let them float, no pull up or down. Then measure the current. That means no peripherals (e.g. output compares) "connected" to pins because those often over-ride explicit port pin instructions.

 

Hmmm, just a minute.... HOW are you measuring the current? A software guy might miss this. To measure current, the meter MUST be in series between the supply and the load. The meter goes ACROSS when you measure voltage. If you have the meter across your power source and switch it to a current range, it will read as high a current as the circuit allows.

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

Last Edited: Thu. Jun 20, 2019 - 01:01 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

however I really believe it is not necessary in this case.

The last famous words.....

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Dear Jim,

thanks for your reply.

I have a foam desktop topper, kind of like a large mouse pad. While it may not have the most ideal electrostatic properties, I'm quite sure that it doesn't conduct electricity, and that (statistically) at least one of the ten chips I tested didn't touch that implied stray piece of conductive whatever on my desk :| Mind you I did also test the chip in an actual circuit on a circuit board (with the same results) but it turned out that the external components or my soldering were not to blame when I tested outside of my project circuit.

I will try to set all ports to input tomorrow (it's in the middle of the night here where I live), however I would have expected a chip in factory condition to work normally in order to support in-system programming.

As for current measurement, yes I did that in series.

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

js I knoooooooow :D

How many support tickets have I had that had gone this way.

But seriously, a diagram for a power source, a voltmeter (in series) and the supply pins of a chip?

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

But you are missing VITAL parts are pointed out above, they are NOT optional for stable and correct operations.

 

The reason why we ask (actually I no longer bother) is because we get these kind of problems almost daily here, days are wasted on useless software answer etc. only to find out that people don't have a good circuit to start with. Missing bypass caps, missing series resistors with LEDs, partly connected power pins etc.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

Are you familiar with measuring currents?   At least show your measurement setup (photo).

It is virtually impossible for the chip to draw 250ma connected to nothing.  Is your meter accurate?  You did mention led dimming, so sound like current is flowing.

What VOLTAGE and POLARITY did you measure before you applied to to the chip?

 

I seriously hope you didn't hook up all of your chips, just to burn them all out, say by treating them to 12Volts or reverse polarity.  In NO case should you ever be trying nine different brand new chips.

 

 

 

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: 1

If I read your problem description correctly, you can program and verify the chips - at this point, what is powering the chips? The programmer? Then you hook the chip up to some other power supply and they draw too much current.

 

I think we can agree that something is fundamentally wrong - be it the power supply, the way you're measuring the current or how it's wired - something is NQR. Without anything visual to look at, all we're doing is guessing. If you can give us a nice, clear photo of the setup, we've got something to go on.

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

Thank you all for your replies.

 

I was all set to take super detailed photos of my setup, and while I laid everything out nicely along with a printout of the pin configuration for direct reference, I worked it out (to my embarrassment).

 

I had the polarity HALF wrong -- the ATTiny861 has two supplies (a separate one for the analog converter), and for weeks while studying the datasheet, I kept reading as VCC and AVCC (as well as GND and AGND) being directly opposite each other. In truth, VCC is opposite AGND :(

 

Thank you all very much for your time, I'm going to go sit in the basement and be embarrassed now.

 

Also, thankfully no chips were actually burned out!

Last Edited: Thu. Jun 20, 2019 - 09:02 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

siberion wrote:
I had the polarity HALF wrong -- the ATTiny861 has two supplies (a separate one for the analog converter), and for weeks while studying the datasheet, I kept reading as VCC and AVCC (as well as GND and AGND) being directly opposite each other. In truth, VCC is opposite AGND :(

Just as with software, one starts with a plan for how the program will work, for hardware it all starts with a schematic! 

Without one, you risk mistakes like this one!  Siberion, I'm not picking on you, just using this as a learning experience for others that follow! 

Thanks, and good luck with your future projects!

 

Jim

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

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

True enough! I even have a schematic of the actual project that the µC is meant to run in, but 1) the schematic also contained the bad pin assignment, so it didn't save me from that mistake, and 2) the full schematic doesn't correspond to the minimal test setup that I used once I saw that there was a problem and began to eliminate possible causes.

 

This experience certainly reinforces a lesson that I've already learnt many many times, but can't seem to ever get done learning: If things don't work as expected, question and verify EVERYTHING, no exceptions.

 

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

Glad you have it working.

 

Now, for future reference, DON'T put 9 good chips in a row in a non-functional board!

 

JC

 

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

ghjk

Doing magic with a USD 7 Logic Analyser: https://www.avrfreaks.net/comment/2421756#comment-2421756

Bunch of old projects with AVR's: http://www.hoevendesign.com

Last Edited: Mon. Jun 24, 2019 - 08:38 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DocJC wrote:

Now, for future reference, DON'T put 9 good chips in a row in a non-functional board!

 

Absolutely! I tested the other chips outside of the board in question. Of course, at that point I was still convinced of the wrong pin assignment, so they all tested equally.

 

And yes, I tested all 10 chips in my possession, because I was convinced that I just couldn't possibly make a mistake on something as simple as hooking up Vcc and GND and was beginning to consider the possibility of a bad batch.