Has anyone seen a port bit fail?

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

I have a board that uses ATMega1284P's.  Dozens have been used in the field for years.  My systems live in a very harsh lightning environment but over a period of 10 years my survival rate has increased dramatically (If interested, see: Living With Lightning and The Viability of Solid-State Components for Signal Systems ).

 

Recently a customer returned a board to me for repair.  The board was fine except for PortB, pin 1 which always read as 0 even though a scope on the pin shows a solid 5v.  This pin goes directly to a 40-pin connector which mates with a "Base Board" (containing field connections).  On the Base Board it goes to a two-pin header with a jumper which is used to select an option setting (second pin is GND, normal setting is off/removed).  I re-flashed the firmware just to be sure it wasn't a firmware issue (I use the same firmware on all boards) so this is not code related.

 

This pin is not subject to any outside stress - unlike the 8 ADC inputs which come in through a GDT & TVS suppression circuit and then to an RC conditioning circuit and then to the ADC pin.  These ADC inputs are connected to 100's of feet of aluminum rail on the ground and are routinely subject to both inductive and ground differential lightning-induced surges/spikes.

 

Has anyone experienced an unexplained failure of a port pin after being installed in the field (i.e.: not an 'out of the box' failure)?

 

Regards,

 

Chuck Hackett

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

Hi Chuck -

 

When you write 

PortB, pin 1 which always read as 0 even though a scope on the pin shows a solid 5v

Where are you observing "solid 5v"? Is it on the IC package or somewhere out on the board?

 

When you write

 always read as 0

How are you "reading" it?

 

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:
Where are you observing "solid 5v"? Is it on the IC package or somewhere out on the board?

 

On pin 41 of a TQFP package using a 10x scope probe (pointy end smiley ).

 

ka7ehk wrote:
How are you "reading" it?

 

 

//
//  Typical definition of the bits, this was
//  the bit that was failing on the one board
//  in question.
//
#define SW5_PORT     PORTB
#define SW5_PIN      PINB
#define SW5_DDR      DDRB
#define SW5_Bit      PB1

    //
    //    Initialize Switches
    //
    SW5_DDR &= ~_BV( SW5_Bit );            //    Set as input
    SW5_PORT |= _BV( SW5_Bit );            //    Enable pull up
    .... similar code for the 4 other bits ....

    //
    //    Pickup NodeID from Switches
    //
    delay_ms( 1 );	//	Allow settling time for input
    CAN_NodeID = ((((~SW5_PIN) >> SW5_Bit) & 0x01) << 4) |
                 ((((~SW1_PIN) >> SW1_Bit) & 0x01) << 3) |
                 ((((~SW2_PIN) >> SW2_Bit) & 0x01) << 2) |
                 ((((~SW3_PIN) >> SW3_Bit) & 0x01) << 1) |
                 ((((~SW4_PIN) >> SW4_Bit) & 0x01) << 0);

I added the "delay_ms( 1 );" very early on after noticing that the bits needed some settling time.  Don't know if this is usual but it has worked for years on dozens of identical boards so I have left it in.

 

Chuck

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

One simple test you can do to check a pin on a cmos device is measuring the diodes. You should ‘see’ a diode between the pin and gnd, pin and vcc. If a pin has been zapped it will usually measure differently to a good pin. I also use this technique to determine if i’ve soldered all pins on a QFN packaged device.

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

The fact that the connection to that pin passes through a connector to a header and jumper on another board tends to up the failure odds a bit. It MIGHT have been damaged during initial assembly, accelerating the actual internal failure. Do assemblers wear antistatic gear (e.g. grounded wrist straps) and do the assembly in static-safe conditions?  BUT, that is only so much uninformed conjecture.

 

Jim

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

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

Kartman wrote:

One simple test you can do to check a pin on a cmos device is measuring the diodes. You should ‘see’ a diode between the pin and gnd, pin and vcc. If a pin has been zapped it will usually measure differently to a good pin. I also use this technique to determine if i’ve soldered all pins on a QFN packaged device.

 

Thanks for that pointer.  I'll check.  Luckily, with the board pulled from the base, there is nothing else connected to that pin so it will be easy to check. 

 

Unfortunately, at the moment I'm chest deep in updating BOMs, part selection and figuring out how many I should order which is the part of all this that I hate ... BTW just how many 0805 1k resistors does the world need? Picking 1k, thick film, 0805 at Mouser gets you 110 parts .. yikes

 

ka7ehk wrote:

The fact that the connection to that pin passes through a connector to a header and jumper on another board tends to up the failure odds a bit. It MIGHT have been damaged during initial assembly, accelerating the actual internal failure. Do assemblers wear antistatic gear (e.g. grounded wrist straps) and do the assembly in static-safe conditions?  BUT, that is only so much uninformed conjecture.

 

Jim

 

The "assembers" (me) do take static precautions, but, you bring up a good point that I had not considered: The fact that this pin has nothing connected to it except the 40-pin connector which would be exposed to customer handling/whatever.  Assuming that a pin is only used as a digital input, would an external pull-up resistor be appropriate? 10k?

 

Regards,

 

Chuck

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

ChuckH wrote:
BTW just how many 0805 1k resistors does the world need?

All 0805 parts are getting hard to find these days....  

ChuckH wrote:

would an external pull-up resistor be appropriate? 10k?

I would think the internal pull up would be fine, I'm not sure if a series resistor placed close to the pin would be helpful or not (esd?)

 

Jim

 

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

share.robinhood.com/jamesc3274
stack gold/silver https://www.onegold.com/join/713...

 

 

 

 

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

For now make sure that the internal resistor is enabled in the FW :)

 

100k should be fine, unless it's a long wire, but if the driver (from the outside) can pull 10k low that would also work. 

 

Add 

But if you fear for the pin put a 1k in serial, then the clamp diodes should take care of the rest.

Last Edited: Mon. Jul 15, 2019 - 01:55 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ki0bk wrote:

I would think the internal pull up would be fine, I'm not sure if a series resistor placed close to the pin would be helpful or not (esd?)

 

The firmware does enable the internal pull-up but, as far as I know, this does not help when the controller board turned off, is in storage, customer handling, etc. 

 

I will never know for sure, but I think the damage we are talking about here was caused by handling, not being exposed to surges in the field because there is extensive surge protection on all lines coming to the base card (where the jumper is) and the jumper is immediately next to the connector that the controller card plugs into so very low probability of inductive pickup. 

 

This is why, in retrospect, I think an external (on the processor card) pull-up might be a good idea.

 

... but also, this is the first case like this in 10 years of running in the Lightning Capitol of The World (Florida) ...

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

The fact that this pin has nothing connected to it except the 40-pin connector which would be exposed to customer handling/whatever

 

For highest reliability, any pin exposed to the customer, should be protected against ESD & other faults.  We'd often design them so pins could be accidentally hooked to a wall outlet, with no damage.   That is somewhat easy to do with CMOS, since it requires so little normal pin current.   A bit of series resistance & cap or TVS diode can be 10 cent insurance.

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:

A bit of series resistance & cap or TVS diode can be 10 cent insurance.

 

I'll look into that.  I already use lots of TVSs and GDTs.

 

When I get some time I'd like to post my CAN bus protection scheme over in the 'General Electronics' forum and get some feedback on that.  My track and power inputs are now resilient to all but very close lightning strikes but the CAN bus is proving to be the weak link.  On that I currently use GDT followed by Bourns TBU followed by 8.5v uni-directional TVS on each of the two (differential) bus lines (data is 0 to +5, 2.5 nominal).  I had a recent case where the TBU was damaged so still need work there.  I'm not worried about capacitance because I only run the bus at about 20k bps but the bus can be up to about 1,500 to 2,000 feet.  In the past I tried TVS arrays designed for CAN bus but blew the tops off several of those :-) 

 

Regards,

 

Chuck

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

Very interesting articles...quite a group of dedicated enthusiasts

 

Maybe some optical fiber isolation? Allow no bus wire to get within a foot of the main electronics box.   Of course, that might only allow 1/2 of the system to survive...the portion taking a direct hit will probably be toast, no mater what you do.

 

Perhaps a daisychain wireless setup would yield some benefit?   Then of course, powering the remote nodes might be done using batteries/solar.

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

ChuckH wrote:
I'll look into that.  I already use lots of TVSs and GDTs.
AVR don't have a stated ESD spec.

AofE has methods for improving the ESD tolerance of digital logic :

  • inherent protection (AVR's ESD suppressors and AVR's VCC clamp)
  • rail clamp (two orders of magnitude improvement, R-TVS-R, jellybean switching diodes or a TVS, current division between TVS and AVR)
  • decrease dv/dt (approx one order of magnitude improvement, R-C-R)
  • current division (one order of magnitude improvement, R-R)

For low leakage analog circuits, there are SCR rail clamps (due to a post on AVR Freaks)

 

Art electronics 3rd edition | Electronics for physicists | Cambridge University Press

The Art of Electronics

3rd Edition

(page 804, 12.1.5 Input protection)

SP725 Series - General Purpose ESD Protection from TVS Diode Arrays - Littelfuse

 

"Dare to be naïve." - Buckminster Fuller

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

avrcandies wrote:
... the portion taking a direct hit will probably be toast, no mater what you do.
Opto-isolation is in AofE with the opto input protection being current limiting (resistor) and a switching diode (limit reverse voltage)

avrcandies wrote:
Perhaps a daisychain wireless setup would yield some benefit?
System reliability is the product of each part's reliability.

Wireless' RF amp inputs have max power absolute limits that may be exceeded by EMP (nearby lightning strike, close (approx few meters) air discharge (non-contact) ESD)

 

"Dare to be naïve." - Buckminster Fuller

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

avrcandies wrote:

Maybe some optical fiber isolation? Allow no bus wire to get within a foot of the main electronics box.

 

I looked into fiber but:

  1. the cable is much more expensive than CAT-5 and
  2. you need expensive transceivers and
  3. every node would have to forward all messages (in some installations 50 messages/second) in addition to it's other work.

 

CAN is inherently multi-master with collision detection & recovery and a node only needs to deal with the messages that it cares about.  I give the message to the CAN controller and it deals with bus contention, etc.

 

avrcandies wrote:

...the portion taking a direct hit will probably be toast, no mater what you do.

 

Not worried about that ... direct hit, all bets are off ...

 

avrcandies wrote:

Perhaps a daisychain wireless setup would yield some benefit?

 

These installations are installed and maintained by volunteers, sometimes with very little electrical knowledge.  A 500'-1,000' piece of cat-5 can be 'rung out' by just about anyone but, if you have RF interference (wayward baby monitor, microwave oven, 2-way radio, yada, yada) you need a spectrum analyzer to track it down.

 

I do support XBee radios in both transparent and API mode but they have very limited range in wooded areas (a lot of tracks are in the woods) and they have a much lower 'effective message rate' than CAN over CAT-5 - even running, as I do, at about 20 kbps.

 

avrcandies wrote:

Then of course, powering the remote nodes might be done using batteries/solar.

I hate batteries (maintenance nightmare) and solar is problematic in the woods ... and batteries would again be required because the signals have to run at night too smiley

 

I may have to go to isolated CAN bus transceivers but I would like to avoid the added cost if I can to keep the price of things as low as possible.

 

My test site has 19 controller nodes, about 60 signal heads, 100 sensed tracks & switch positions, and about 4,000 feet of power and data bus.  The system draws about 1.7A @ 24v from a single power supply.  The status of all signals, tracks, etc. is available at any point on the railroad, including dispatcher display in the tower.

 

Regards,

 

Chuck

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
  1. the cable is much more expensive than CAT-5 and

Note that you can get some really cheapo plastic fiber, that would prob work good at low uart data rates  (doubt you are sending 100Mb/sec), and use some cheapo photo transistors /leds to do the talking.  Might work for can as well.   Of course, this would still leave the power issue to deal with.

 

In lieu of optical or RF, you'll probably have to beef up your protection in any unprotected area.  Maybe the customer touched this jumper input while wearing his polyester leisure suit & zapped it.   If the jumper was super-critical, you could instead jumper the pin to outputs "A" or "B"  and output hi/low pulses on those.  In normal operation, you'd read these levels to see which (A/B) was a match.  A fault/short would match neither & you could sound the Klaxon.  

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