Protecting ARM micro pin, Zener vs Resistor ladder? - Page 1
Forum section: electronics / beginners

author: jnz
author_rank: Frequent Contributor
timestamp: April 09, 2016, 04:47:59 pm
content: 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!

author: rstofer
author_rank: Super Contributor
timestamp: April 09, 2016, 11:44:21 pm
content: 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: microcontrollerinputprotectiontechniquesThese 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-theSo, it's time to read the datasheet for the actual diode.

author: Ian.M
author_rank: Super Contributor
timestamp: April 10, 2016, 01:20:30 am
content: 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.

author: rstofer
author_rank: Super Contributor
timestamp: April 10, 2016, 03:50:44 am
content: 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.

author: jnz
author_rank: Frequent Contributor
timestamp: April 10, 2016, 05:05:38 am
content: Quote from: Ian.M on April 10, 2016, 01:20:30 amCan you elaborate on this any? I'm trying to follow, but not there yet.

author: jnz
author_rank: Frequent Contributor
timestamp: April 10, 2016, 05:12:09 am
content: 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.

author: rstofer
author_rank: Super Contributor
timestamp: April 10, 2016, 07:28:03 am
content: Quote from: jnz on April 10, 2016, 05:12:09 amInteresting 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.pdfThey'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?

author: danadak
author_rank: Super Contributor
timestamp: April 10, 2016, 11:37:41 am
content: 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 inputstructure draws current between the rails and spends too much time in no mans land, egVinh >= Vin >= Vinl, This can cause potential false triggers due to noise and effective Gof the input CMOS buffer. Schmidt trigger configured inputs take care of this.Regards, Dana.