[SOLVED] ATtiny1634 pin PB3 - undocumented/unexpected 10k pulldown/leak to ground?

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

I've been experiencing some odd behaviour when using external pullups with PB3 on an ATtiny1634 that makes me wonder if there is a leak to ground or undocumented (or documented) internal pulldown on this pin.

 

Some time ago I was trying to minimise current in power-down mode, and removing a 470k pullup from PB3 dropped the usage from 9uA to the expected 0.1uA. At the time, I just worked around it.

 

Recently while experimenting I tracked down some problems with a circuit addition back to this pin. I got the setup down to a single 4.7k pullup resistor on the pin and measured the output voltage. It showed up as roughly 2.5V with a 3.9V supply. This made me wonder if there was some kind of leak to ground via this pin.

 

I tried a range of resistors from 1k through to 470k as pullups on this pin and measured the voltage. For the resistors from 1k through 10k, the measured voltage was consistent with an approximately 10k resistor to ground internal to the MCU, within an acceptable margin of error. As the pullup resistance increased much above 10k, so did the effective resistance in the MCU.

 

I'm probably just going to work around it again by swapping pins around somehow, but I'm curious if anyone else is experiencing this, if it is a known fault, or something I'd missed in the documentation.

 

If you'd like to try for yourself, this is what is needed:

 

- Hook up a 1634 to about a 3.9V supply, use a decoupling cap, etc.
- Hook up a 4.7k between the 3.9V supply and PB3.
- Flash an image that has PB3 is set to input and with no pullup. I think this is the default.
- Measure voltage at the pin. If it is about 2.5V you are seeing the same thing as me. If it is about 3.9V then you are not.

 

PB3 has ADC8, OC1A, and PCINT11. Perhaps one of these systems can affect things? I do have timer 1 running, but OC1A on PB3 should be disabled. I'm not using ADC on the pin and I don't think I set ADMUX incorrectly. I don't use PCINT11.

 

The current setup is on a breadboard using a 1634 attached via a soldered breakout. I can't rule out a soldering mistake, breadboard issue, defective IC, IC damage, or a software problem. I am, however, curious if anyone knows if it is a wider issue, or is happy to try this with a minimal setup and confirm whether they see the same thing.

 

This topic has a solution.
Last Edited: Fri. Nov 3, 2017 - 03:56 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If it were being driven with close to a 50% duty cycle square wave, it MIGHT look something like what you describe. Try turning OFF Timer1.

 

Jim

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

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

ka7ehk wrote:

If it were being driven with close to a 50% duty cycle square wave, it MIGHT look something like what you describe. Try turning OFF Timer1.

 

Thankyou for the suggestion. :) When I first saw 2.5V I thought something similar. However: Measuring using the Hz setting on a multimeter showed no regular signal. I tried a pulldown instead, and it consistently measured 0V. Reducing the pullup resistor value increased the voltage, and increasing it reduced the voltage. For example: A 10k gave me about 1.9V, and a 1k gave me about 3.5V. Everything observed is consistent with some kind of leak to ground.

 

However, turning off timer 1 is an interesting idea. I won't be able to do that easily with the current code as it controls the system timer, but it's something I can include in a minimal example if I put one together. It would raise some interesting questions if it changed the result though.

 

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Possibly:

Edit: also applies to Revs A & C

David (aka frog_jr)

Last Edited: Fri. Nov 3, 2017 - 03:02 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

frog_jr wrote:

Possibly:

Edit: also applies to Revs A & C

 

Nice find. :) I think you just found the cause. This matches and explains every symptom I have seen.

 

I'm not currently using the watchdog timer, though I plan to. I was using the pin as an open drain output, which means when it is high, it is set to input with no pull. So the conditions for the errata are there.

 

I'm not sure why I didn't find the mention in the datasheet myself. I think it was because I wasn't expecting pulldowns on pins in a device that only provides configurable pullups, and I probably searched for "pullup" rather than "pulled up". Also, I was sure I'd searched for every instance of "PB3" in the datasheet, but clearly I did not.

 

This is a bit concerning for power-down mode if you don't want to run the watchdog and have an external pullup on that line. I can confirm it leaks current if you use this pin. Current usage goes from 0.1uA to 9uA with a 470k pullup.

 

I've switched the pin with another that has an external pulldown instead. Looks like my workaround will be permanent.

 

I'm a little glad that it wasn't a fault in my software, but also a bit disappointed because if it was my bug, at least I could fix it.

 

Thankyou for taking the time to track things down, and nailing it in just one post. That's seriously impressive.

 

Last Edited: Fri. Nov 3, 2017 - 03:25 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When something "just isn't right," check the errata!

 

I make it a practice to read the errata carefully before using a chip I haven't used previously...

David (aka frog_jr)

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

frog_jr wrote:

When something "just isn't right," check the errata!

I make it a practice to read the errata carefully before using a chip I haven't used previously...

 

Lesson learned! :D Actually, I think I did this, but the significance did not sink in at the time. What I should have done is gone back and reread it once I was a bit more familiar with the chip. Good on Atmel for directly acknowledging and detailing the limitation in the datasheet though.