Accidentally blew a 328n as i forgot the output from my magnetic sensor was at the supply voltage of 12v - oops
so whats the best way of simply making the 12v inout OK for the 328 - can i simply use a series resistor or should i use a resistor divider ?
Simple is good here as space is very limited !
Best way to reduce a 12v pulse for input to a 328
Re: Best way to reduce a 12v pulse for input to a 328
A series resistor will work in a pinch since the AVR chip has clamping diodes on all inputs. You compute the size of the resistor so as to limit the current to 10mA or less, e.g. (12V-5V)/10mA =700. A 1K resistor would be fine.FFMan wrote:can i simply use a series resistor or should i use a resistor divider ?
A better solution, I think is to add your own external clamping diodes or a transistor and two resistors. The latter solution will give you an inversion, of course.
- Don Kinzer
No. A clamping diode serves to limit the excursion of a signal to a fixed voltage level, i.e. it "clamps" the voltage level. Consider the image below, excerpted from AN213 External Device Interfacing. If the input signal rises above about 5.6 volts (assuming a typical silicon diode) the input to the ZX will be clamped at the 5.6V level with the resistor dropping the remaining voltage. A similar thing happens when the signal tries to go negative.FFMan wrote:electronics not my strong point - when you say clamping diodes to you mean a 5v zener ?
You can use Schottky diodes for clamping purposes as well. The advantage of this type of diode is that it has a smaller forward voltage drop, on the order of 0.3V compared to 0.6V for a small signal silicon diode.
- Attachments
-
- ClampingDiodes.jpg (12.47 KiB) Viewed 3682 times
- Don Kinzer