Another FPGA Gigatron implementation

Using, learning, programming and modding the Gigatron and anything related.
Forum rules
Be nice. No drama.
Post Reply
walter
Site Admin
Posts: 164
Joined: 13 May 2018, 08:00

Another FPGA Gigatron implementation

Post by walter »

As already stated on discord: there is somebody in Germany who made another FPGA implementation of the Gigatron, see https://www.youtube.com/watch?v=_SiCv_uo2bY

What is nice, is that is uses the simple and cheap Tang Nano 9K FPGA board. I bought one of these boards for under €18 including shipping. The creator of this all, "Doctor Volt", kindly provided me with a break-out board. The board is open source, see https://github.com/michalin so you can have them made yourself.
trontang.jpg
trontang.jpg (126.86 KiB) Viewed 5014 times
For some reason, I could not get an image out of the VGA connection. HSYNC/VSYNC work, as the controller also works. I haven't looked to see what causes this, Doctor Volt told me he has the same issue. The video output is also simultaneously output on the HDMI interface embedded on the FPGA board, so it's not a big issue. The whole thing is powered by the FPGA USB connection.

It's a nice addition to my "Gigatron shrine" with all the community efforts on the Gigatron!
Hans61
Posts: 104
Joined: 29 Dec 2020, 16:15
Location: Saxonia
Contact:

Re: Another FPGA Gigatron implementation

Post by Hans61 »

Congratulations, very nice. I'm still waiting for the voltage converters to be delivered, then I'll be able to finish mine too.
bmwtcu
Posts: 149
Joined: 01 Nov 2018, 12:02

Re: Another FPGA Gigatron implementation

Post by bmwtcu »

For some reason, I could not get an image out of the VGA connection. HSYNC/VSYNC work, as the controller also works.
I looked at his constraints file and both his and the tang nano 9k schematic. He assigned the outputs to a 1.8V bank of pins and is using a 2.2k/4k voltage divider to get the 3.3V switching power supply output from the tang nano down to ~1.815V with a 100nF bypass cap C7 on the level convertor VDDA pins. Without one of the boards to hook up a scope myself, I suspect the level convertor isn't giving you expected values. Do you see any image on your monitor at all? If not, it's likely there is something wrong with the syncs. You need 700mV on the analog R/G/B pins to get white, and while your LATCH and PULSE might be of sufficient voltage to register on the controller, probably isn't high enough voltage to register on the VSYNC/HSYNC pins on your monitor. A waveform capture comparing the level convertor input and output of the sync signals would be informative. If it's related to the resistor divider and bypass cap like I suspect, one possible fix might be to remove C7 and replace R11 with a 1.8V zener (https://www.pedalpcb.com/product/1n4678/) and short out R10, but honestly I would just do away with the voltage convertor altogether and just pick appropriate R12-R17 for 1.8V DAC if the required 1% tolerance standard resistor values exist. I'm driving the sync pulses on my Gametron handheld with 3.3V directly from my FPGA without issue, so if driving it at 1.8V doesn't work, remapping to 3.3V outputs on the FPGA should do the trick.
lb3361
Posts: 376
Joined: 17 Feb 2021, 23:07

Re: Another FPGA Gigatron implementation

Post by lb3361 »

This is a very cool project. Maybe the cheapest Gigatron implementation in fact (about $30 maybe).

A question for bmwtcu: I noticed that the adapter board uses level shifters that automatically sense the signal direction, something that I can understand if both ends have the kind of well defined loads one expects in a digital circuit. But in this case, the VGA backend uses both the known output property of the 74HCT377 to produce the analog VGA signal, possibly playing poorly with the level shifter direction sensing circuitry. Can this be correct? Are there other things that could be correct?

When Hans61 and I designed the gigatron512k board, we chose to latch the video signal into the genuine 5v 74HCT377 instead of directly using the outputs of the 3.3v CPLD. The reason was that I did not understand enough about the analog aspects of the gigatron VGA output, and we preferred to play it safe by using the same chip as the normal gigatron as a driver (but clocked twice as fast). Could this be a good strategy in this case?
bmwtcu
Posts: 149
Joined: 01 Nov 2018, 12:02

Re: Another FPGA Gigatron implementation

Post by bmwtcu »

I'm also leaning towards the level shifter messing with the VGA timing or levels. I question what that RC circuit he's introduced on the VDDA rail would do to output. A scope capture of the SYNC pulses comparing the input and output levels would be instructive.

TBH I really don't have a lot of experience with level shifters. Professionally, I usually deal with higher speed bi-directional interfaces that have standardized voltage levels and don't have to use level shifters. I work on cost sensitive consumer devices, so even for the odd lower speed single direction I/O, I've never been a fan of using level shifters if more appropriate component selection was an option. Basically I create a spreadsheet that lists Voh/Vol/Vih/Vil on both sides of the handful of signals that might have a mismatch and track that the operational requirements are met and absolute min/max are not exceeded.

Analog VGA isn't really rocket science. I don't have time for a deep dive (there are lots of Google results), but in a nutshell:-
* There are 3 analog signals corresponding to R/G/B that each go from 0V to 700mV.
* Intensity of each color scales with the voltage, so 0V on all 3 signals represents black and 700mV on all 3 signal represents white in RGB colorspace.
* In the Gigatron case, each color is represented by 2-bits and each of the 3 DACs would ideally output the following voltages
0b00 = 0V
0b01 = 233mV
0b10 = 467mV
0b11 = 700mV
* In modern computer graphics, each color is represented by 8-bits, so black is 0x000000 and white is 0xFFFFFF and each DAC would output the following voltages
0x00 = 0V
(too many to work out all 254 values but you get the idea)
0xFF = 700mV

For a hobby project, the level shifter that gets you to results quickly is totally worth it, and can work if you don't have extraordinary timing constraints, but in higher volumes where each dollar saved translates to millions in savings, it's probably worth more tradeoff analysis. I would argue that in the Gigatron case, a simple resistor DAC at your native voltage output would be "good enough" and is a simpler solution.

On a side note, I'd actually implemented a Gametron on a Tang Nano 9k during the pandemic, but was trying to figure out how to accommodate the full ROMvX0 so it never saw the light of day. Since then, more interesting options have become available that I just need to carve out some time to work on.
WhatsApp Image 2022-03-12 at 10.10.35 AM.jpeg
WhatsApp Image 2022-03-12 at 10.10.35 AM.jpeg (313.42 KiB) Viewed 4701 times
lb3361
Posts: 376
Joined: 17 Feb 2021, 23:07

Re: Another FPGA Gigatron implementation

Post by lb3361 »

bmwtcu: I remember your tang nano gigatron. The problem was the same: there is not enough memory in the Gowin 9K FPGA to have a full rom. As for the vga signal, I found a nice explanation https://chipnetics.com/tutorials/unders ... o-signals/ but I do not understand the pros and cons of having a diode in the circuit. Voltage protection?
bmwtcu
Posts: 149
Joined: 01 Nov 2018, 12:02

Re: Another FPGA Gigatron implementation

Post by bmwtcu »

I didn't even know they used diodes. The way I work out the resistor values to use is to write a series of equations based on the Thevenin equivalent circuit with the 75ohm load and solve for the resistor values needed to achieve the target voltages. I'd have to go dig up my circuit analysis textbooks with a diode in the mix!
Post Reply