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 can then be losslessly upscaled to HDMI.
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.
RGBtoHDMI profiles
Currently the RGBtoHDMI does not yet support the TEDdigitizer out of the box. After installing the latest software (Beta66), you need to add a few extra files to the micro SDcard:
Just copy the contents of this archive on top of the existing installation.
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 are needed, wasting one bit. But because there is the possibility to create additional colors on PAL machines with a very sophisticated hack, this spare bit comes just handy to encode these additional colors. On NTSC machines, this bit is indeed unused.
To keep data transfer speed just low enough for the lumacode specification (21.5 samples/second maximum), more time in each scanline is dedicated to data transfer than usual. This reduces the length of the sync pulses and it is also only possible to transfer the color of only a very small strip of border.
Conclusion: Every pixel is transfered as 4 samples, with the first 2 samples specifying the Hue (higher two bits come in the first sample). The other two samples specify the luminance as a value of 0 to 7. Values 8 to 15 are not used, with the exception of the "PAL color inversion" hack, where additional colors can be created. I do not yet know the RGB values of those extra colors, but may include them here in the future.
PAL RGB values used by the RGBtoHDMI
| Hue | Lum:0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
|---|---|---|---|---|---|---|---|---|
| 0 | 000000 | 000000 | 000000 | 000000 | 000000 | 000000 | 000000 | 000000 |
| 1 | 202020 | 404040 | 606060 | 808080 | 9f9f9f | bfbfbf | dfdfdf | ffffff |
| 2 | 651517 | 722224 | 7c2c2e | 8b3b3d | ad5d5f | d18183 | e79799 | ffcdcf |
| 3 | 004643 | 045350 | 0c5d5a | 1b6c69 | 3d8e8b | 61b2af | 77c8c5 | adf2f0 |
| 4 | 5b0a6a | 681777 | 722181 | 813090 | a352b2 | c776d6 | dd8cec | fcc2ff |
| 5 | 005101 | 085e09 | 126813 | 217722 | 439944 | 67bd68 | 7dd37e | b3f7b4 |
| 6 | 202190 | 2d2e9d | 3738a7 | 4647b6 | 6869d8 | 8c8df5 | a2a3ff | d8d9ff |
| 7 | 3a3a00 | 474700 | 515100 | 606000 | 828212 | a6a636 | bcbc4c | ecec82 |
| 8 | 592300 | 663000 | 703a05 | 804912 | a16b34 | c58f58 | dba56e | fbdba4 |
| 9 | 4c2f00 | 593c00 | 634600 | 725503 | 94771e | b89b42 | ceb158 | f5e68e |
| 10 | 1e4800 | 2b5500 | 355f00 | 446e00 | 669012 | 8ab436 | a0ca4c | d6f382 |
| 11 | 661031 | 731d3e | 7d2748 | 8c3657 | ae5879 | d27c9d | e892b3 | ffc8e7 |
| 12 | 004b2d | 04583a | 0b6244 | 1a7153 | 3c9375 | 60b799 | 76cdaf | acf4e5 |
| 13 | 0b2f7e | 183c8b | 224695 | 3155a4 | 5377c6 | 779bea | 8db1f6 | c3e6ff |
| 14 | 2d1995 | 3a26a2 | 4430ac | 533fbb | 7561dd | 9985f7 | af9bff | e5d1ff |
| 15 | 0e4e00 | 1b5b00 | 256500 | 347404 | 569620 | 7aba44 | 90d05a | c6f690 |
NTSC RGB values used by the RGBtoHDMI
| Hue | Lum:0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |
|---|---|---|---|---|---|---|---|---|
| 0 | 000000 | 000000 | 000000 | 000000 | 000000 | 000000 | 000000 | 000000 |
| 1 | 202020 | 404040 | 606060 | 808080 | 9f9f9f | bfbfbf | dfdfdf | ffffff |
| 2 | 580902 | 782922 | 984942 | b86962 | d88882 | f7a8a2 | ffc8c2 | ffe8e2 |
| 3 | 00373d | 08575d | 27777d | 47969d | 67b6bd | 87d6dd | a7f6fd | c7ffff |
| 4 | 4b0056 | 6b1f76 | 8b3f96 | aa5fb6 | ca7fd6 | ea9ff6 | ffbfff | ffdfff |
| 5 | 004000 | 156009 | 358029 | 55a049 | 74c069 | 94e089 | b4ffa9 | d4ffc9 |
| 6 | 20116d | 40318d | 6051ac | 8071cc | 9f90ec | bfb0ff | dfd0ff | fff0ff |
| 7 | 202f00 | 404f00 | 606f13 | 808e33 | 9fae53 | bfce72 | dfee92 | ffffb2 |
| 8 | 4b1500 | 6b3409 | 8b5429 | aa7449 | ca9469 | eab489 | ffd4a9 | fff4c9 |
| 9 | 372200 | 574200 | 776219 | 978139 | b7a158 | d7c178 | f6e198 | ffffb8 |
| 10 | 093a00 | 285900 | 487919 | 689939 | 88b958 | a8d978 | c8f998 | e8ffb8 |
| 11 | 5d0120 | 7d2140 | 9c4160 | bc6180 | dc809f | fca0bf | ffc0df | ffe0ff |
| 12 | 003f20 | 035f40 | 237f60 | 439e80 | 63be9f | 82debf | a2fedf | c2ffff |
| 13 | 002b56 | 154b76 | 356b96 | 558bb6 | 74abd6 | 94cbf6 | b4eaff | d4ffff |
| 14 | 370667 | 572687 | 7746a7 | 9766c6 | b786e6 | d7a6ff | f6c5ff | ffe5ff |
| 15 | 004202 | 086222 | 278242 | 47a262 | 67c282 | 87e2a2 | a7ffc2 | c7ffe2 |