TEDdigitizer (for C16 and Plus4) - c0pperdragon/LumaCode GitHub Wiki
The TEDdigitizer is a small modification board for the C16 and Plus/4 home computers. It can be installed by putting it between the TED chip and its socket and connecting the output to the existing RF jack. Using a compatible upscaler (the RGBtoHDMI for example), you get pixel-perfect HDMI.
Mod kit contents
The kit contains the FPGA board and a cable with clips for solderless installation.
Theory of operation
The TEDdigitizer listens to the digital signals that run between the TED and the rest of the system. From this information it can extrapolate what the TED intends to show on the screen and it creates a lumacode signal that encodes all pixels in a form that then be losslessly upscaled to HDMI. This signal is similar to a standard video signal but color is encoded in a different way. For checking if the TEDdigiitzer itself works, you can feed this lumacode signal into any TV with a standard composite video input. The picture will be black&white with fine vertical stripes that encode the colors.
Installation in a C16
For this computer an installation is possible without soldering.
- First remove the TED from the socket and insert the TEDdigitzer instead.
- Connect the provided clip leads to the 2-pin header denoted GND and LUM.
- Open the metal can of the RF modulator
- Cut the metal strip that connects the inner part of the RF socket with the modulator. This may require a side-cutter as the metal may be quite sturdy. Make sure it is really disconnected.
- Use the clips to connect to the metal shielding (from GND) and to the inner contact of the RF output jack (from LUM). This connection may be a bit unreliable. For proper installation it would be better to use soldering if possible.
- Put the TED chip into the TEDdigitizer
- When you don't use the clips but can solder the wires instead you can also put back the top of the RF modulator can.
Installation in a Plus/4
This machine is much more crampted and installation is more complicated and requires soldering and desoldering equipment.
- Take the mainboard out of the machine.
- Take the lid off the can where the TED is located.
- Remove the TED chip. Be careful to remember the correct orientation of the chip.
- Check if the TEDdigitizer can fit in its place. There may be a component (an inductor?) that also needs to be relocated. The LUM/GND output pins of the TEDdigitizer also need to be removed or bent upwards as they will not fit inside the metal shielding.
- Put the TEDdigitzer into the socket.
- Prepare the RF output jack like for the installation in the C16.
- Solder wires from the GND/LUM holes to the RF output jack. If you want to close the lid of the RF can later, bring the wires through one of the holes.
- Put the TED into the TEDdigitizer.
- In order to be able to put back the lid of the metal can (also for purposes of heat dissipation) you will need to bend the metal strip that is in contact with the TED.
Details on color encoding
The TED has a color palette of 16 different hues, each with 8 possible luminance levels. The total number of colors is not 128 as you would expect, but 121 as all colors with the hue "black" are just black regardless of what luminance is selected. To encode this colors, 7 bits are needed per pixel (4 for hue, 3 for luminance).
The way lumacode works, 2 bits are transfered with each sample. So in order to transfer 7 bits, 4 samples would be needed, wasting one bit. Because the necessary transfer rate is already too high to work reliably, I designed an encoding that combines two pixels into 7 samples without waste.
The color for each pixel can be defined as a 7-bit vector B0-B6 with B0-B3 containing the hue and B4-B6 containing the luminance. The data for each pixel pair X,Y is transfered in the following order.
sample | most significant bit | least significant bit |
---|---|---|
0 | X6 | Y6 |
1 | X5 | X4 |
2 | X3 | X2 |
3 | X1 | X0 |
4 | Y5 | Y4 |
5 | Y3 | Y2 |
6 | Y1 | Y0 |
In addition to compacting the bits in this way, the time duration in each scan line to transfer this data is also stretched by a factor of 7:6. This is possible by using the time span normally allocated to the color burst to transfer useful screen data. Using this method, the data transfer rate is reduced to 3 samples for every tick of the TED pixel clock. This incidentially is exactly the sample rate used for lumacode on the Atari 8-bit machines (both PAL and NTSC respectively) which does work but seems to be right at the edge of what can reliably be done with this solution.