Author Topic: ATTiny85 PB2 internal short to GND  (Read 1714 times)

0 Members and 1 Guest are viewing this topic.

Offline MarkMTopic starter

  • Regular Contributor
  • *
  • Posts: 64
  • Country: us
ATTiny85 PB2 internal short to GND
« on: June 19, 2016, 05:13:50 pm »
I designed this really basic board that sports an ATTiny85. This schematic is of the 84, but the setup is exactly the same. It's basically a PWM controller board with an on board MOSFET that uses a pot to adjust the duty cycle up and down(as well as for other functions), switch to activate functions, runs on battery power and has an LED for an indicator.  I added an on board 10k resistor (R7) so I only have two wires going to an external 10k pot(0-2.5v is OK here).

I've sold around 1,000pcs with the same setup in the past 7-8 months, and most of the time everything is OK.  I program and test them myself, so when they go out I know they're working correctly.  I'm using PB2(INT0) for the switch using the internal pullup(using sleep mode), so the switch is active low.  The issue is, once in awhile PB2 creates an internal short to GND somehow making the switch active all the time, as the internal pullup and the weird connection to GND causes a voltage divider.

I've seen it as low as 300ohm with the actual pin lifted off the board to confirm that's the issue and not a PCB issue. This is very odd to me.  Can anyone see anything wrong with my setup? It's pretty rare, but it happens and it's always after people add the external components(LED, POT, SWITCH). My fix so far has been to add an external 1k pullup, but it shouldn't be happening.   

No other pins have had any issue at all.  I'm thinking I could use an external pulldown resistor to make the pin active high, but I'm thinking the problem ones will waste some power when the fire switch is depressed.  Sleep mode is very important to me, or I would just use another pin.

I've used a similar setup to this with different AVR MCUs and haven't had an issue like this before.  Any help is greatly appreciated.     
« Last Edit: June 19, 2016, 05:42:23 pm by MarkM »
 

Offline Monkeh

  • Super Contributor
  • ***
  • Posts: 7990
  • Country: gb
Re: ATTiny85 PB2 internal short to GND
« Reply #1 on: June 19, 2016, 05:27:45 pm »
it's always after people add the external components(LED, POT, SWITCH).

There's your clue.

ESD happens.
 

Offline MarkMTopic starter

  • Regular Contributor
  • *
  • Posts: 64
  • Country: us
Re: ATTiny85 PB2 internal short to GND
« Reply #2 on: June 19, 2016, 05:38:33 pm »
Something is definitely happening there, but it's similar to an arduino board.  I can't find anyone with a similar issue online like this.
 

Offline MarkMTopic starter

  • Regular Contributor
  • *
  • Posts: 64
  • Country: us
Re: ATTiny85 PB2 internal short to GND
« Reply #3 on: June 19, 2016, 07:25:29 pm »
I went with an external pull down resistor, so the switch will be active high from now on, I suppose.  Any other ideas?
 

Offline wraper

  • Supporter
  • ****
  • Posts: 16805
  • Country: lv
Re: ATTiny85 PB2 internal short to GND
« Reply #4 on: June 19, 2016, 07:44:29 pm »
Either people abuse this pin or ESD. IMO at least add some series resistor to the pin. If this pin can be set as output probably people just connect the led directly without resistor or short the pin to Vdd for example Or connect it to even higher than Vdd/lower than GND voltage and destroy protection diode in the MCU by this.
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12807
Re: ATTiny85 PB2 internal short to GND
« Reply #5 on: June 19, 2016, 07:48:38 pm »
I agree with Wraper.  Without additional protection, the pin will still end up blowing due to ESD.   You probably need something like 1nF to ground at the off-board connector (which typically reduces the peak ESD voltage by an order of magnitude) and 1K between that and the pin to reduce the internal clamping diode current.  The resistor should be physically large so it doesn't flash over (no 0805 or smaller flyshit).
That's not enough for *robust* protection, but is about as good as you can do on the cheap* when using an internal pullup. 

* It wont reach the logic 0 threshold if you increase the resistor too much to decrease the peak clamping diode current,  you cant increase the capacitor significantly without reducing the switch life, and any sort of external semiconductor clamping that doesn't dump into the Vdd rail *costs*.
 

Offline wraper

  • Supporter
  • ****
  • Posts: 16805
  • Country: lv
Re: ATTiny85 PB2 internal short to GND
« Reply #6 on: June 19, 2016, 08:04:03 pm »
As an idea, maybe people are connecting it to something else what is mains powered. If at least one side have double insulated PSU, then discharge will happen to what get connected first. If it happens to be this pin, then it will be destroyed. This is the same as for example small spark when you connect DVD player to the TV.
 

Offline wraper

  • Supporter
  • ****
  • Posts: 16805
  • Country: lv
Re: ATTiny85 PB2 internal short to GND
« Reply #7 on: June 19, 2016, 08:10:08 pm »
The resistor should be physically large so it doesn't flash over (no 0805 or smaller flyshit).
No need for big resistors, just add say 0.2-0.3mm spark gap to GND before the resistor on PCB layout.
 

Offline MarkMTopic starter

  • Regular Contributor
  • *
  • Posts: 64
  • Country: us
Re: ATTiny85 PB2 internal short to GND
« Reply #8 on: June 25, 2016, 05:10:17 pm »
Thanks for the replies.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf