Hello
I have just only started with MCUs and have been experimenting with a Arduino Nano which is a ATmega328P chip.
I have done this simple experiment. I set an output pin of the MCU to go on and off 5 times a second. It drives an LED drawing around 3mA. The MCU is powered by 5V.
I also have a simplistic op-amp circuit with Vcc=12V and Av=10 which drives a LED drawing also 3-5mA. The op-amp is driven by the same MCU pin that drives the LED.
I connect the scope on the MCU output pin and also the op-amp's output pin. Both show a perfect square wave in perfect unison.
Looking closer however the MCU's output pin has a rise time of around 30-40ns. The op-amp has a hysteresis of around 100ns and a rise time of around 1200ns (including the hysteresis).
Obviously this may be considered too slow, so I changed the op-amp for a fast one (LM6172/LT1361) and tried the same experiment. Now the op-amp's rise time is around 90ns, which is very much nearer the MCU.
I am therefore quite satisfied that this simple op-amp circuit works quite well, and I can use it to marry the MCU's digital voltages from 0V to 5V to my analogue circuit, in this case 0V to 12V. To make sure I get real 0V from the op-amp I feed it a negative supply, and I do not much care if I do not reach the 12V perfectly.
Now it appears that this is not the way to do it. Apparently a comparator is a much better choice, and op-amps, apparently, make for very poor comparators.
I am not sure, because the LM293 which I happen to have in my drawer, has an open collector output. How is it supposed to source current? Just does not make sense. Secondly, would the LM293 be faster than my super-fast slew rate op-amp? I also doubt it.
Could someone please explain to me why my op-amp solution is a poor choice and why I would need Schmitt triggers, comparators, hex inverters and so on?
Many thanks!
I have just only started with MCUs and have been experimenting with a Arduino Nano which is a ATmega328P chip.
I have done this simple experiment. I set an output pin of the MCU to go on and off 5 times a second. It drives an LED drawing around 3mA. The MCU is powered by 5V.
I also have a simplistic op-amp circuit with Vcc=12V and Av=10 which drives a LED drawing also 3-5mA. The op-amp is driven by the same MCU pin that drives the LED.
I connect the scope on the MCU output pin and also the op-amp's output pin. Both show a perfect square wave in perfect unison.
Looking closer however the MCU's output pin has a rise time of around 30-40ns. The op-amp has a hysteresis of around 100ns and a rise time of around 1200ns (including the hysteresis).
Obviously this may be considered too slow, so I changed the op-amp for a fast one (LM6172/LT1361) and tried the same experiment. Now the op-amp's rise time is around 90ns, which is very much nearer the MCU.
I am therefore quite satisfied that this simple op-amp circuit works quite well, and I can use it to marry the MCU's digital voltages from 0V to 5V to my analogue circuit, in this case 0V to 12V. To make sure I get real 0V from the op-amp I feed it a negative supply, and I do not much care if I do not reach the 12V perfectly.
Now it appears that this is not the way to do it. Apparently a comparator is a much better choice, and op-amps, apparently, make for very poor comparators.
I am not sure, because the LM293 which I happen to have in my drawer, has an open collector output. How is it supposed to source current? Just does not make sense. Secondly, would the LM293 be faster than my super-fast slew rate op-amp? I also doubt it.
Could someone please explain to me why my op-amp solution is a poor choice and why I would need Schmitt triggers, comparators, hex inverters and so on?
Many thanks!