Generating three voltages with a MCU

microcontrollervideovoltage divider

I'm going to try and generate black and white NTSC video, using a micro-controller. According to this:

https://instruct1.cit.cornell.edu/courses/ee476/video/

It is possible to do it using two pins of Atmel Mega644. I looked at the datasheet and noted that the IO is 1.8 V. For NTSC you just need three voltages sent at the correct time, 0V, 0.3V, and 1V.

What I don't understand is how does this circuit generate the 0, .3 and 1V. When I do the calculations it doesn't really add up.

enter image description here

I simulated this using TI TINA simulator, 2 batteries and switches inplace of the IO ports, and trying all four combinations of the IO, I can get 0, .3V but not 1V.

Can someone using math explain how you can get 0 V, .3 V, and 1 V using the circuit shown in the link above. I also, I guess what I don't understand is the uC IO equivalent circuit for simulating in a SPICE program, is it just a battery set to the IO voltage? Or maybe an OP AMP with the output set to the IO voltage can someone please explain this.

Any help is appreciated.

Best Answer

Your calculations are then incorrect.

The ATmega644 works fine with 5 V (which is also close enough to the output voltage of the microcontroller which itself is rated at minimal 4.2 V on page 316 of the datasheet) and at that voltage using a \$ 330 \mbox{ } \Omega \$ and \$ 75 \mbox{ } \Omega\$ voltage divider, you get 0.926 V which is close enough to 1 V for most purposes.

Using the \$1 \mbox{ } k\Omega\$ and \$ 75 \mbox{ } \Omega\$ voltage divider, you get around 0.349 V which is for most purposes close enough to 0.3 V. And when both pins are off, you get 0 V.