Chibiterm Is A Tiny Low-Cost VGA Terminal

A common sight in the days before cheap PCs conquered the world was the dumb terminal. A keyboard and a monitor with a serial port on the back that was usually hooked up to a minicomputer or even a mainframe, these were simple devices. Anything that came into the serial port was rendered on the screen, anything typed on the keyboard was sent out through the serial port. They didn’t need to contain a microprocessor. If you are old enough, you may remember electronics magazines of the 1970s and early 1980s publishing terminal designs based entirely on 74 series logic.

The serial terminal might seem like a redundant historical footnote when viewed from 2016, but they can still find a use among those working with systems such as small embedded microcontrollers that only possess a serial port. To address this application, user [K.C.Lee] has created a low-cost terminal module for a VGA monitor and a PS/2 keyboard based around an inexpensive STM32F030F4 processor.

To squeeze VGA from such an inexpensive device without extra hardware, he’s made use of the device’s SPI port as a fast shift register. This was not as simple as it sounds. He had to work carefully with the clock frequencies to make it work at the VGA pixel rate. He goes into detail on the chip’s internals in how he achieved this, as well as the mechanics of character generation.

The resulting device is tiny enough, but his latest project log shows how it will eventually be fitted within a connector adaptor case. It’s all open-source, so if you want to take a closer look you can find everything you need in the Github repository.

We’ve featured dumb terminals before here of course, but they have more often been classic hardware. From the Hack42 computer museum in the Netherlands to an ADM-3A with a Raspberry Pi attached, we’re always up for some text-mode goodness. This project is also of interest because it’s yet another example of pushing the on-chip serial peripheral ports into something they weren’t quite intended to do. That technique has featured here with a Raspberry Pi ADC port, and of course the ESP8266 NTSC TV transmitter.

22 thoughts on “Chibiterm Is A Tiny Low-Cost VGA Terminal

  1. Dumb terminals were some of the most complicated circuits I’ve ever known. Without a microcontroller, it was very difficult to keep track of where the next incoming character needed to be put into memory, when to display the cursor (which I’ve been told (jokingly) is how the cursor got its name), and especially difficult to multiplex between writing characters from the UART input to memory and reading characters out of memory to serialize into pixels through a character generator ROM and shift register. Microprocessors (and later, microcontrollers) brought the cost of dumb terminals WAAAAY down. Imagine having to design a circuit that advances the address to store the next character in, which takes into account special characters like carriage return, line feed, and backspace, without software. Oh, and see if you can make it scroll automatically while you’re at it. DainBramage says he had an Altair 8800 with a dumb terminal. I would wager that the dumb terminal had more chips in it than the Altair!

    1. That’s why they were dumb terminals.

      Unless you built one, in the early days of small computers standalone terminals were expensive. A TTY machine at least gave you hardcopy, but unless you got one surplus, they were more expensive than the small computer.

      Don Lancaster’s original TV Typewriter was promoted as having so much potential, but it couldn’t be connected to anything. It needed later additions to be controlled over a serial connection.

      Which is why video boards came fairly early, theyweren’t cheap but generally cheaper than an external terminal. And you got smarts, via the CPU in the small computer. And it was faster and the software could directly work on the video memory, instead of sending control characters to the external terminal (assuming the terminal was smart enough to be controlled by characters). Until computers were cheap enough so everyone could have one, built in video wasn’t so useful, so their arrival was “revolutionary”. By 1977, you expected built in video.

      Let’s not forger that an early CPU was used in a terminal, or designed for the purpose, proving the value of replacing all that TTL with a CPU. Before there were small computers, the CPUs were promoted as “logic replacements”.

      I kept a Mac Classic around for some years because it was small and I thought I might need a terminal at some point. I never did, though I scrapped the Mac Plus when I found a used Mac Powerbook. I guess newer laptops may lack serial ports.


  2. under Linux I always compile “console on serial port”, long after X has crashed, can’t get back to a console and have no network connection, the serial port console will still be there!

    1. Should be doable. Seeing that he already has VGA compatible sync and color information he can just add one of the many DVI/HDMI output encoder chips and it will work automagically. Sending HDMI directly from the microcontroller is probably not possible, but with some FPGAs you can directly output DVI (altough maybe not at full 1080p resolution)

      1. The only issue with that is getting a good sampling clock for those chips. Even though the video signal is there and has a proper number of lines, it’s also fudged a bit because it’s analog. With those HDMI/DVI chips, you need a sample clock that always has the right number of clocks per line. It’s probably doable with some extra stuff, but they’ll need to be synchronous clocks, and you’d need to generate a synchronous data enable signal as well. It could probably be done with a $2 CPLD tacked on in addition to the HDMI/DVI TX chip.

      2. The dotclock is 25MHz. The Hsync signal is coming off the timer at 50MHz core clock and Vsync (non-critical) is from GPIO. You can probably sample these signals with a 25MHz clock source off a clock tree that can be fed to the oscillator. I have a MACRO for bypassing the oscillator as the initial prototype uses a 25MHz oscillator on a breadboard. There are no documented phase relationship between the input clock and outputs, but you can easily sync 3 signals even with double flip/flop inside an Octal 74xx574.

        There is no colour information because it is a single bit output from a SPI. Not much one can do on the cheapest ARM with DMA SPI. The firmware with much stripped down functionality uses less than 7kB of FLASH and 4kB RAM which is very similar to the days of limited resource in the old days. I would recommend upgrading the $0.42 ARM chip (5% off sale!) before feature creeping. You can get ARM chips with more RAM and Quad bit SPI/SDIO or LCD driver. That get you to more RAM, colours and higher res. etc

    2. Unlike the lucky few, I cannot walk into a store and get RPi 0 for $5 US in Canada, so I started this project as an entry for the contest.

      I want to see if it can be done on the cheapest ($0.44 US) low end ARM chip I can order from China (so far). The BOM for the proto breakout PCB was around $1. The rest of my parts – crystal, LDO, transistor and passives sourcing from Chinese alternatives arrived yesterday and it worked. So far, no flakes from Aliexpress. You can embed these 0.7″x 1″ modules and use them inside your Linux routers or use with your microcontroller projects with serial code you already familiar with. It boots up instantly so you can catch pre-boot messages. I also wrote a robust PS/2 driver that handles hot insertions.

      I looked at sn75lvds83 as a way to convert VGA to DVI when I tried/started building my FPGA board 3 years ago for HaD contest. I could have used that. Doing so pushes up the cost to RPi0 which sets a price ceiling. They sell $15 (Canadian) LCD monitors in Thrift store VGA only and no HDMI so far.

      1. Very nicely done and certainly a welcome low-cost alternative! BTW: in Dutch thrift stores you can find plenty LCD monitors with DVI and/or HDMI for about 5 euro or even free if you’re lucky and not averse to dumpster diving. I’m contemplating to set a couple aside for future arcade cabinet projects.

      2. My area has a higher minority (they don’t throw out things) and elderly community (less money to spend), so there aren’t as much of the modern electronics that can be found in dumpsters or Thrift shop. Sometimes I do read about people in the other affluent area e.g. the (SF) Bay area with their great finds.

        The only “big” find I had was the car DVD player/monitor + extra LCD monitor that has a broken power connector for $10. I am now working a new project “Low Cost NTSC Gaming with ARM Cortex M”. :)

        1. Here in Montreal, I think there’s less electronic junk. It’s subjective, but I think more is going to “ewaste recycling”, which I think gets it out of circulation.

          That said, I’ve found more lcd monitors than I need, of various sizes. And they are all VGA, with some having DVI. No sign of junked HDMI monitors.

          I did see an LCD monitor downtown last fall, some store tossing it out. Had a built in DVD player, so it could have been that at fault. I assume it had HDMI inputs. But it didn’t fit in knapsack, I couldn’t get the base off, and I was going somewhere that carrying it would be awkward, so I left it there. I didn’t see it coming back.


  3. I started way back in the late 80’s with VAX 320 terminals.
    A RPi Zero would make a great serial to HDMI widget. Apparently they about to begin shipping again, in volume this time. :)

  4. Dumb terminals are still very widely used. For instance in areas like health care providers, airlines, car rental and even banking. They’re safe, reliable and built to last. I used to work in a hospital where they used terminals that were over 30 years old without any problems.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.