AVR 따라하기 > 032 - Electrical Characteristics - Absolute Maximum Ratings

TODAY696 TOTAL2,230,378
사이트 이용안내
Login▼/회원가입
최신글보기 질문게시판 기술자료 동영상강좌

아두이노 센서 ATMEGA128 PWM LED 초음파 AVR 블루투스 LCD UART 모터 적외선


BASIC4MCU | AVR 따라하기 | 2015년 강좌 | 032 - Electrical Characteristics - Absolute Maximum Ratings

페이지 정보

작성자 키트 작성일2017-08-23 14:44 조회2,566회 댓글0건

본문

3660040649_MaQdvbYr_25C125A625B825F1_25BE25F825C025BD.PNG3Ftype3Dw740

Absolute Maximum Ratings은 고장과 관련된 항목입니다.

각각의 항목은 조건을 벗어나면 고장 날 수 있다는 의미입니다.

DC Current per I/O Pin............................................... 40.0 mA
포트핀 전류 경우에 최대 40mA를 넘지 말라고 되어 있습니다.
• I/O and Packages
– 53 Programmable I/O Lines
ATmega128경우에는 53개의 입출력핀이 있습니다.
모든 핀에 40mA씩 흘린다면 53*40mA=2120mA가 되겠죠?
모터 드라이버도 아니고 MCU에서 이렇게 많은 전류를 드라이브 하지 못합니다.
DC Current VCC and GND Pins..................... 200.0 - 400.0mA
따라서 그 아래 항목에 보면 MCU 내부로 흐르는 전류는 200~400mA를 넘지 말라고 적고 있습니다.

전압 스펙 중 리셋 전압은 13V까지 가능하다고 적혀있는 것이 눈에 띄는군요 
여지껏 저 항목을 유심히 본 적이 없었던 것 같습니다.^^
3660040649_4Ts1kCbH_25C125A625B825F1_25BE25F825C025BD.PNG3Ftype3Dw740
SPIKE FILTER 회로에서 완충 역활을 하기 때문에 13V까지 가능한 것 같습니다.
또, 리셋핀에는 과전압 보호용 다이오드가 설치 되어 있지 않아야합니다.
3660040649_OVMP2t3g_25C125A625B825F1_25BE25F825C025BD.PNG3Ftype3Dw740
다이오드는 SPIKE FILTER 회로는 뒷쪽에 있어야 합니다.
SPIKE FILTER 회로는 앞쪽에 있으면 Vcc+0.5V로 제한 됩니다.
스펙중 Vcc+0.5V
왜 0.5V 일까요?
0.5V까지는 과전압 보호용 다이오드로 전류가 흐르지 않으니 다이오드가 고장나지 않는 전압이죠
다이오드로 전류가 흐를 수 있는 높은 전압이 유입되는 경우
임펄스성의 짧은 시간동안만 노이즈가 튀는 경우에는 시간이 짧아서 다이오드에 데미지가 적지만
높은 전압을 장시간 계속 걸어두면 다이오드 고장납니다.
다이오드의 역활은 정전기나 임펄스성 노이즈를 제거하기 위한 용도입니다.
MCU 내부에 넣은 다이오드는 일반 다이오드에 비해서 아주 작은 크기이므로 처리 가능한 전류도 작을 수 밖에 없습니다.
1N4004처럼 1A정도까지 연속적으로 처리 가능하다고 생각하시면 절대 안됩니다.^^
3660040649_zJVsXTpl_25C125A625B825F1_25BE25F825C025BD.PNG3Ftype3Dw740
SPIKE FILTER 회로는 개념적으로는 LPF일테고
3660040649_QPecq38y_25C125A625B825F1_25BE25F825C025BD.PNG3Ftype3Dw740
리셋 신호를 일정시간 이상 걸어줘야하는 이유도 LPF 방전에 시간이 걸리기 때문일 것으로 추정합니다.
시간이 길지 않은 것을보면 C 용량이 작습니다. (구조상 큰 용량의 C를 IC에 넣지 못합니다.)
3660040649_O3CShz5L_25C125A625B825F1_25BE25F825C025BD.PNG3Ftype3Dw740
13V가 핀에 걸리면 전류는 두곳으로 흐릅니다.
풀업저항의 크기는 앞의 글에서 보셨을테고
SPIKE FILTER 회로의 R과 다이오드로 전류가 흐르게 됩니다.
Vcc를 5V로 적었지만 더 낮은 전압으로도 구동하니 이 때는 전류가 더 많이 흐르게 됩니다.
어쨋거나 13V까지는 저항과 다이오드로 전류가 흐르더라도 문제(고장)되지 않는다...로 생각 하시면 되겠습니다.^^
실제로 SPIKE FILTER 회로가 어떤식으로 구성 되었을지는 모르겠고 
아래에 구글 검색결과 추가합니다.

Protecting Inputs in Digital Electronics

By Solutions Cubed

Contributed By Digi-Key Corporation


Introduction 


In a generic electronic system there are some inputs that are controlled by the end user. These inputs are read by electronics and acted upon by using outputs. The inputs can come from a myriad of sources: buttons, switches, sensors, relays, and communication devices, to name a few. In certain environments and situations, these input signals can pose a threat to the electronics reading them – especially if those electronics are designed without thought of protection. One such environment is the world of industrial electronics. 

An important aspect of designs for this environment is interfacing sensitive electronics with inputs coming from the harsh conditions of a factory floor. Usually, inputs are read by some sort of intelligent processor such as a microcontroller, FPGA, or state machine. In cases like these, it is imperative to protect the processor from the inputs, while still providing a usable signal for the processor to read. 

Problem definition 

In a typical factory system there may be buttons on a control panel located remotely from the central processing unit. The buttons are connected to central processing via long wires. Unfortunately this can lead to inadvertent electronic failure. Long wires can act as an inductor and when a button is opened or closed, large voltage spikes can show up on the electronic paths. Figure 1 shows a simplified diagram of this situation. 

Simplified electronic system

Figure 1: Simplified electronic system.

In order to discuss approaches to overcoming this problem, a more specific example will be used. Typical microcontrollers have input impedance on the order of 20 MΩ. In addition, system voltages range from 1.2 V to 5.0 V. In this case, we will assume a 5 V system. Figure 2 shows Figure 1 reconfigured as a simplified electronic model.

Input model into a simplified electronic model

Figure 2: Input model into a simplified electronic model.

Using this model, it is easy to see the problems with unprotected inputs. Any large voltage that shows up on input pin is presented directly to the interior electronics (microcontroller). Regardless of how this voltage is produced (ESD, induced EMI, switch closure, user error), this can damage the microcontroller, and perhaps cause the entire system to fail. Because of this, different protection strategies must be implemented to create a robust system. 

In order to discuss the problem in detail, a simple system will be set up as shown in Figure 3. It is a simple switch that is connected to a microcontroller with a 25 foot wire connection. Note the switch is a 2-pole switch and it switches between open and ground. A pull-up resistor on the microcontroller causes the open position to be read as ‘high’ by the microcontroller.

Simple switch circuit

Figure 3: Simple switch circuit.

When the position of the switch is changed, a large voltage is induced over the 25 feet of wire, and it appears at the microcontroller. This is demonstrated in Figure 4. Note the minimum voltage caused by the inductive ringing is -5.88V. This is more than large enough to cause serious problems within an electronic system. 

With this circuit and the simple scope captures, the large voltage problem can be seen. Now it is time to look at approaches to fixing this problem.

Switch from open to ground

Figure 4: Switch from open to ground.

Protection approaches 

An important aspect of microcontroller inputs (and the vast majority of any logic ICs) that was left out of the simple model shown in Figure 3 is that they have internal protection diodes that are used to protect the inputs, as shown in Figure 5. These normally forward bias at 0.7 V. 

Under ideal circumstances, this can protect the microcontroller. However, if the voltage is large enough or lasts for a long enough time, it can destroy the internal diodes in a shorted position, thereby ‘breaking’ the input pin. Even worse, the input pin is now directly connected to a power rail, so, when the next large voltage shows up on the input pin, it is shunted directly to the power bus, wreaking havoc throughout the microcontroller and most-likely damaging it further.

Enhanced microcontroller input model

Figure 5: Enhanced microcontroller input model.

Even if the diodes are not destroyed, a large ESD spike can induce a current surge through the microcontroller’s power bus, which can corrupt internal registers and settings leading to unpredictable behavior. With all of this in mind, the first attempt to protect the input pin is found within current limiting. 

Current limiting 

The simplest protection mechanism is a current limiting resistor, as shown in Figure 6. The input resistor is sized so that the voltage drop across it does not affect the voltage at the microcontroller input. As this is a simple voltage divider, and the input resistance in the controller is about 20 MΩ, this resistor can be fairly big. For most digital inputs, a good value is between 100 Ω and 10 kΩ. For our system, a value of 1 kΩ is used.

Current limit protection for an input

Figure 6: Current limit protection for an input.

 This type of protection works well for short wire connection lengths and enclosed wire runs (little chance of EMI, etc.). Figure 7 shows how this circuit works to implement the protection. In Figure 7, the ringing edges from the induced voltage are clipped at -0.810 V.

Current limit circuit results

Figure 7: Current limit circuit results.

Filtering 

Figure 6 showed a simple current limit circuit. However, with the addition of a capacitor, more protection can be added by turning the current limit circuit into a simple low-pass filter as shown in Figure 8.

Low pass filter protection for an input

Figure 8: Low pass filter protection for an input.

With this type of circuit, a little more thought must be applied to component selection. Because of the frequency limiting characteristics of the circuit in Figure 8, the value of the resistor and the capacitor must be sized so that the microcontroller does not miss any signals. The simple equation shown in Figure 9 can be used to determine the value of the resistor and the capacitor.

Equation for determining the resistor and capacitor values

Figure 9: Equation for determining the resistor and capacitor values in a low pass filter circuit used for a digital input.

To calculate the value of R and C, use the following steps:

  • Find the fastest edge of the incoming signal – or determine the fastest frequency of the incoming signal and assume an edge speed of 1/100th of the input period (a 1 kHz input frequency has an edge of 10 µs).
  • Select ‘R’. Usually this can be selected to a common value already in the system, such as 1 kΩ.
  • Use the equation in Figure 9 to determine the value of ‘C’.
  • In some cases, the input signal is a very slow moving signal (button press, switch closure, etc.), so the value of ‘C’ can be then changed to match a common value on the board, as long as the order of magnitude is maintained.
As shown in Figure 8, the values for R and C are 1 kΩ and 0.01 µF (assumed a maximum input frequency of 1 kHz). Figure 10 shows how this circuit works with the input switch circuit. Note how the overshoot edges are now gone compared to Figure 7. This is the effect of the capacitor. 

RC filter performance

Figure 10: RC filter performance.

One added advantage to the RC filter circuit for a digital input is that it also rejects spurious/fast inputs that could cause false readings on the microcontroller. Unfortunately, for large ESD events and long wire runs, there can still be voltage spikes in the microcontroller because the circuit is relying on the clipping action of the internal diodes. This leads to the next approach. 

External clipping diodes 

To eliminate the use of the microcontroller’s internal diodes, external Schottky clipping diodes can be used. This is shown in Figure 11. Schottky diodes are implemented because they conduct before the internal diodes of the microcontroller (Schottky diodes forward bias at about 0.2 V as opposed to the 0.7 V of the internal diodes). Note that a small series resistor is used to protect the Schottky diodes from overcurrent. As these diodes are only on for a short time, a small resistor works well; something on the order of 10 Ω usually works fine. Alternatively, the 10 Ω resistor can be omitted if the Schottky diodes are beefy enough to handle short-duration, high current pulses.

External clipping diode circuit

Figure 11: External clipping diode circuit.

Figure 12 shows the results of this circuit with the input switch circuit. The yellow trace is the positive side of the capacitor, while the green trace is where the resistor meets the Schottky diodes. Note the negative spike is -0.650 V, which is below the forward bias voltage of the microcontroller. A voltage of this level on a well-designed PCB should not cause any problems.

External diode protection results

Figure 12: External diode protection results.

So for the most ruggedized digital input protection, a combination of external resistors, capacitors, and diodes should be used. 

Other ideas 

These basic ideas can be further expanded for known high voltage inputs. For example, if the input signal was changed to switching a high voltage instead of ground, a circuit like the one shown in Figure 13 can be used.


Reading high voltage inputs

Figure 13: Reading high voltage inputs.

The input clipping diode to ground is to protect from less than zero volt spikes. The input clipping diode to the positive bus is removed in favor of the zener diode after the current limiting resistor. This provides a known voltage for the input pin and reduces the amount of current shunted to the power bus. In addition, all of the connections on the input are now to ground, which can ease PCB routing. Note, in this case, the current limiting resistor must be sized small enough to provide enough current to allow zener breakdown at the correct voltage (about 1 mA minimum). Figure 14 shows the operation of this circuit, using a switched 12 V input.

Reading large input voltage digital inputs

Figure 14: Reading large input voltage digital inputs.

Conclusion 

When interfacing digital circuitry with the outside world, care must be taken to protect the sensitive electronics. However, the circuitry required to provide the protection is small, inexpensive, and easy to understand. If a little bit of forethought is used when designing the system, many difficulties can be avoided once the system is deployed. 

Solutions Cubed and the Digi-Key Design Partner Program: 

Digi-Key, a world leader in high volume electronic component distribution, has included Solutions Cubed, LLC as a design resource. This allows our company to secure competitive pricing for registered designs belonging to our clients. As a Digi-Key design resource, Solutions Cubed, LLC and Digi-Key work as a team to streamline the design-to-manufacturing phases of product development and work with you to get the best possible solution with pricing as competitive as possible.

Solutions Cubed is an innovative electronic design firm. We have created successful designs for a myriad of industries including mass produced consumer products, deep-sea robotic components, and encrypted decoders for the banking industry. We love meeting new customers and are interested in hearing about your design.





Using current limiting resistors on AVR I/O pins


Today I want to talk about protecting digital Inputs of AVR or any other microcontroller from over-voltages. When you look at majority microcontroller circuits found on internet shared by hobbyists you don’t find any input protection. Some argue that in most cases this is not needed, or simply don’t understand how it works. Lets see how simple resistor can save a day.

Lets see at simplified version of digital input of AVR microcontroller.

avr_io_protection

We can see there that input uses CMOS logic where transistor is switched by voltage. According to AVR datasheet, gate control voltage should stay within -0.5V to VCC+0.5V range. If we power our device with 5V supply, we need to make sure that pin input voltage stays in range -0.5 to 5.5V. When input voltage source is taken from same power supply, then we don’t have to worry much about it. But what if AVR is accepting digital signals from other sources like sensors, other devices that are powered with their own power supplies. Can we be sure that voltage will always be within safe limits. This is why there are two clamping diodes (sometimes called ESD protection diodes) used. They are here to protect logic from over-voltages and under-voltages. Actually they do their work pretty well… until they die. Lets take situation when voltage at pin is 7V what happens here. D1 Anode voltage is 7V while cathode is VCC=5V. Then we get 7-5 = 2V on diode. But diode forward voltage drop is about 0.7V. Diode becomes unprotected and high current flows through diode until it fails. And so logic becomes unprotected. Same is with under-voltage. If we apply -2V at input pin then diode D2 starts conducting forward from GND to PIN with 2V across. Again voltage drop at diode is 0.7V and so current grows until diode fails. And so if we expect that input voltage may be off limits we need to add current limiting resistor.

avr_io_current_limiting_resistor

Now when we added resistor, we have a place where voltage can be dropped. Like we had 7V on input pin and diode forward voltage drop is 0.7V resistor takes the rest of 1.3V. What about current? It is not recommended to exceed 1mA on clamping diodes. Having this data we can model worst case scenario. Lets say we expect that input voltage spikes will never exceed 10V. Then we can calculate the current limiting resistor value:

R = (10V – 5V-0.7V)/1mA = 4.3kΩ

We can simulate this on Ltspice:

io_protection_simulate

DC simulation results:

io_protection_simulate_results


As we can see current on diode D1 is about 1mA and voltage to CMOS Vout=5.65V.

Going even further there can be also a capacitor included which with current limiting resistor makes RC filter. Resistor part serves as current limiting resistor while capacitor adds filtering of glitches and debounces input signals.

avr_io_protection_with_RC

You may need to calculate or model RC circuit individually.

What if you are designing critical device and do not want to rely on clamping diodes inside AVR or other micro. In this case you may add external clamping diodes. Even better – use Schottky diodes.

avr_io_protection_with_schottky

Schottky diode forward voltage drop is lower that standard diode. It varies from 0.28V to 4.3V. So if over-voltage or under-voltage occurs they will protect the circuit and internal diodes won’t conduct at all. So you get double defense in case any of diodes fail.

Can there be more protection added? Of course. If you are likely to work with high voltages – like building microcontroller based HV zapper or there is a chance to catch high voltage on input, then first line of defense should be transcient voltage protection circuit. These can be based on varistor, gas discharge tube. But probably most reliable in such situation would be using transcient voltage suppression diode (TVS). They can handle high peak currents and clamps really fast. This is how heavily protected pin would look like:

avr_io_protection_with_schottky_TVS

You can use ferrite bead L1 before TVS diode which slows down rise time of voltage giving enough time TVS diode to turn on. Probably you are not likely to build such protection as this is really overkill and quite expensive per pin. But in some industrial applications you can find such solutions.

Generally speaking if you are designing hobby circuit that will be battery operated, then probably input voltage will never exceed limits and so you can omit resistor. And this is how most hobby circuits are built. Nothing wrong with this. But if you are designing device for market and there is any risk of over-voltage then you must include current limiting resistor. Resistors are cheap, so adding them won’t hurt anyway.

http://www.scienceprog.com/using-current-limiting-resistors-on-avr-io-pins/


댓글 0

조회수 2,566

등록된 댓글이 없습니다.

AVR 따라하기HOME > AVR 따라하기 > 전체 목록

게시물 검색

2022년 1월 2월 3월 4월 5월 6월 7월 8월 9월 10월 11월 12월
2021년 1월 2월 3월 4월 5월 6월 7월 8월 9월 10월 11월 12월
2020년 1월 2월 3월 4월 5월 6월 7월 8월 9월 10월 11월 12월
2019년 1월 2월 3월 4월 5월 6월 7월 8월 9월 10월 11월 12월
2018년 1월 2월 3월 4월 5월 6월 7월 8월 9월 10월 11월 12월
Privacy Policy
MCU BASIC ⓒ 2020
모바일버전으로보기