PAL Video Generation
This project is presented as an experiment, not a final product.
As a hardware experiment, I do not accept any responsibility for damage caused to your calculator, television, self or related items as a direct or indirect result of using the software, source, circuit diagrams or any other item from this package.
DownloadSource, binaries and documentation.
The composite video input expects a signal between 0V and 1V. 0V is used to represent a synchronisation signal, 0.3V represents black, 1V represents white and values between 0.3V and 1V represent shades of grey.
The composite input can be seen as having a 75Ω resistance between it and ground. We can use this fact to construct a 2-bit DAC (digital to analogue converter) that can be driven by the calculator.
In its default state, the calculator's output lines float high, and can be pulled low in software. Whilst the calculator can sink a lot of current in the low state, it can't source very much before you end up pulling the data lines low. For this reason, I use the following circuit.
The values on the resistors are the ideal values. The values in parentheses above the resistors work well, though, and are more easy to come by (being part of the E12 series).
One one TV I tested with, leaving the transistors out (and just directly connecting the outputs from the calculator to the resistors) worked pretty well, but had very low contrast. Using the transistor circuit provides a much more reliable signal (with better contrast) with a lower response time (a white→transition between pixels is quite blurry, more of a gradient than the sharp-edged transition I got without the amplifier).
You could easily build a "proper" 2-bit DAC that didn't draw much current based around an op-amp, but I don't have the parts for testing. I leave the design as an exercise to the reader.
To build the software you will need Brass.
It should hopefully be pretty easy to follow, just a lot of cycle counting. It is rather inefficient, blowing up the displayed image to a "full" 18×304 resolution and storing each pixel as a single byte. The script PalImage.cs adds a directive .incpalimage that loads an image file and creates the required data for you.
The generated PAL signal is very inaccurate and probably doesn't work on any televisions outside of my home, so apologies in advance. I don't have an oscilloscope, so I've just fudged the numbers around until it works on my hardware. Not only is the timing rather ropey, the only vsync signal generated is the top of field 1. I tried adding at least the end of field 1's vsync pattern, but I ended up with a distorted, rolling display.
According to my back-of-an-envelope calculations, a calculator running at 15MHz could get 48 pixels horizontal resolution.