Author Topic: Protecting ARM micro pin, Zener vs Resistor ladder?  (Read 2013 times)

0 Members and 1 Guest are viewing this topic.

Offline jnzTopic starter

  • Frequent Contributor
  • **
  • Posts: 593
Protecting ARM micro pin, Zener vs Resistor ladder?
« on: April 09, 2016, 04:47:59 pm »
This is something I should remeber better, but can someone explain the practical difference in this for me?

I have a 3V micro. A 10-18V input signal, I only need high vs low state.

I could set up a resistor ladder but it's a fairly large input voltage spread. I haven't done the math to see what values might work.

Or I could use a 3V zener biased to ground with an inline resistor to the micro. As I remeber it, the zener needs a load to work properly. By being biased to ground the inline resistor should do this right? 1-5mA "waste" should be enough right?


So what's the effective difference if I couldn't fit the range of voltage for the ladder? Is the zener just a little more wasteful?

And kind of bonus question but how do I determine the input switching speed of the STM32? I know the gate has a charge/capacitance to register, but what would be considered too slow or low a value to reliably switch an input 0 to 1?

Basic stuff, but thanks!
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9890
  • Country: us
Re: Protecting ARM micro pin, Zener vs Resistor ladder?
« Reply #1 on: April 09, 2016, 11:44:21 pm »
The bonus question first:  Vil (Voltage Input Low) specifies how high a signal can get and still be a '0'.  Vih (Voltage Input High) specifies how low a signal can be and still be a '1'.  Those values are in the datasheet, not the user manual.

I like the idea of a zener because it will clamp the output to a value.  A resistive divider doesn't really do that.  If your incoming signal is DC, all is well.  If it is AC then you will still see excursions below zero as the zener won't clamp until it reaches its forward voltage spec. 

There's a discussion of a zener clamp here: microcontrollerinputprotectiontechniques
These is a link in the discussion to a simulation.  Note carefully the conditions under which you get negative excursions.

So, put a series resistor between the top of the zener and the input pin such that the internal clamp diodes can handle the negative current.  Only applies to AC...

Here's a discussion of zener current and which specs should be in the datasheet.
http://electronics.stackexchange.com/questions/80145/how-to-calculate-minimum-zener-current-if-it-is-not-explicitly-specified-in-the

So, it's time to read the datasheet for the actual diode.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12860
Re: Protecting ARM micro pin, Zener vs Resistor ladder?
« Reply #2 on: April 10, 2016, 01:20:30 am »
Other issues are the Zener and supply voltage tolerance.  If one is at the lower limit and the other at the upper limit, you may find that the clamping voltage is either below the Vih threshold, or too far above the supply voltag.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9890
  • Country: us
Re: Protecting ARM micro pin, Zener vs Resistor ladder?
« Reply #3 on: April 10, 2016, 03:50:44 am »
I would try a series resistor, at least 330 ohms, between the output of the zener and the pim.  I would want to limit pin current.
 

Offline jnzTopic starter

  • Frequent Contributor
  • **
  • Posts: 593
Re: Protecting ARM micro pin, Zener vs Resistor ladder?
« Reply #4 on: April 10, 2016, 05:05:38 am »
Other issues are the Zener and supply voltage tolerance.  If one is at the lower limit and the other at the upper limit, you may find that the clamping voltage is either below the Vih threshold, or too far above the supply voltag.

Can you elaborate on this any? I'm trying to follow, but not there yet.
 

Offline jnzTopic starter

  • Frequent Contributor
  • **
  • Posts: 593
Re: Protecting ARM micro pin, Zener vs Resistor ladder?
« Reply #5 on: April 10, 2016, 05:12:09 am »
Rstofer, thanks but I know the data sheet for the part has the vih/vil voltages but the bonus question is really about current, capacitance, and inductance.

How much current makes for a good gate read? How would I determine the speed of the input registering for X resistor on the signal?

For example, given the line capacitance and whatever the gate needs to change - a 330ohm resistor is going to probably "read faster" than a 1Mohm inline on the same single. Yes, the voltage on both is 3V, but the current to register is so much less. Or maybe I'm wrong and the gate is an entirely voltage driven deal and only a single electron at that pressure/resistance is enough to change the state, I suspect that's not the case.

 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9890
  • Country: us
Re: Protecting ARM micro pin, Zener vs Resistor ladder?
« Reply #6 on: April 10, 2016, 07:28:03 am »
Rstofer, thanks but I know the data sheet for the part has the vih/vil voltages but the bonus question is really about current, capacitance, and inductance.

How much current makes for a good gate read? How would I determine the speed of the input registering for X resistor on the signal?

For example, given the line capacitance and whatever the gate needs to change - a 330ohm resistor is going to probably "read faster" than a 1Mohm inline on the same single. Yes, the voltage on both is 3V, but the current to register is so much less. Or maybe I'm wrong and the gate is an entirely voltage driven deal and only a single electron at that pressure/resistance is enough to change the state, I suspect that's not the case.

Interesting question!  I had never seen the pin input capacitance specified nor have I ever looked for it.  I found a spec in an ST document:
http://www.st.com/web/en/resource/technical/document/datasheet/CD00161566.pdf

They're talking about 5 pf - see page 62  It's a pretty small number.  The 330 ohm resistor only adds a couple of nanoseconds to the rise time.  The series resistor feeding the zener will be somewhat larger, I suspect.

I don't know if the number is similar for any other chip.  I do know that some chips use a Schmitt Trigger arrangement for the input pins.  Input current is usually on the order of a microamp, so, for many purposes, the pin is voltage activated.

Which device are you using?


 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: Protecting ARM micro pin, Zener vs Resistor ladder?
« Reply #7 on: April 10, 2016, 11:37:41 am »
When interfacing an analog signal into a processor the following considerations apply -

1) Meeting noise margin.
2) Meeting logic levels.
3) Meeting pin allowed output drive / sink current.
4) Meeting port max allowed output drive / sink current.
5) Limiting injection current for pin driven outside supply rails.
6) Ramp rate.

1-4 are datasheet specs, 5 also usually specified.

6 is referring to problem where input rises very slowly so creates a situation where input
structure draws current between the rails and spends too much time in no mans land, eg
Vinh >= Vin >= Vinl, This can cause potential false triggers due to noise and effective G
of the input CMOS buffer. Schmidt trigger configured inputs take care of this.

Regards, Dana.

Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf