06/21/2021 at 23:44 •
I'm adding the use of OpenGL shaders to mimic a CRT. This includes effects such as characters built from smooth scanlines, a soft glow around text, and a subtle curvature as a CRT should have.
This stuff looks great! When I began using some of this new code I started seeing the dreaded temperature icon popping up.
Using the GPU based shaders does increase the thermal load on the Pi, but this is no reflection on the code that Lars is writing. It does however show what a poor job that I did managing heat dissipation. I should have known better given the Raspberry Pi 4's reputation for running hot.
So I did a few things to mitigate this issue. First of all I added heat sinks to the major components.
More importantly I redesigned the "caddy" I use to hold the Pi 4 in place to be more open and added a small 30 mm x 30 mm x 10 mm blower fan for good measure.
The original in the upper left was trapping the heat in especially with the RS-232 hat attached. The fan on the new design is attached directly to +5V and GND GPIO pins on the Pi. It runs pretty quietly especially when the top panel is in place on the terminal body.
I have not seen the thermometer pop up since I have made these changes.
I have added the STL file for the Pi holder to GitHub. The fan I used is from Amazon: GDSTIME 3cm 30mm x 10mm 5V DC Brushless Small Blower Cooling Fan, with Dual Ball Bearings
05/29/2021 at 19:48 •
Most terminal emulators like xterm and PuTTY take raw text and formatting instructions and interpret them to display formatted text on the screen like the original hardware did. However they are software only constructs that are derived from the documentation supplied with say an actual VT100 terminal, hence the "emulator" moniker. So in the previous log I used one of these documentation based emulators, minicom, to test my RS-232 connection. It works pretty well and is probably a reasonably accurate reproduction of the original VT100 terminal behavior.
This is a software simulation of the VT100 hardware. The original firmware ROM is built in and executed by an 8080 emulator. Other components include video display with character generator ROM, settings NVRAM, Intel 8251 USART, and a keyboard matrix scanner.
This is a relatively new project, still under active development, but I can tell you from personal experience it works quite well. While this is still a software construct, by running the code from the actual VT100 ROMs you are going to achieve much more accurate experience.
Running the Simulator
I downloaded the code from the terminal-simulator repository and unpacked it onto the Pi in my VT100 reproduction. I ran a make from within the vt100 folder. I was then able to run the following command from the same vt100 folder:
This resulted in a blank screen with a blinking box cursor in the upper left corner. I immediately pressed F9 which put me in the SET-UP screen.
Wow. when you see the SET-UP screen pop up you really know that this is the real deal. The one change you want to make here is to set the SCROLL option to JUMP. SMOOTH scrolling isn't quite ready yet.
From the VT100 User Guide you would do this by:
- Press 5 to switch to the SET-UP B screen.
- Move the cursor to be on top of the first number in the first block of 4 options.
- Press 6 to change the value from 1 (SMOOTH) to 0 (JUMP).
- Press F9 to exit SET-UP.
Now at this point you should be able to press Enter to get the login prompt for the PiDP-8/I machine. Log in and run the emulator just as you did with minicom.
You can exit the simulator by pressing Ctrl-F11.
When I saw these screens I commented to Lars:
I am loving the look of the screen! With our modern smooth looking anti-aliased typefaces we forget the blocky pixelated letters of terminals past. I really want this look for my VT100.
This makes the whole VT100 experience so much more authentic. Thank you Lars for making this happen.
05/27/2021 at 15:50 •
The original incentive for this project was to have a cool looking front end to Oscarv's (https://hackaday.io/obsolescence) wonderful PiDP-8/I (https://hackaday.io/project/4434-pidp-8i) kit. This was accomplished by using the VT100 reproduction as a simple monitor and connecting it to the Raspberry Pi running the PiDP-8/I via HDMI. For fun I then added a Raspberry Pi to the reproduction and created arcade and desktop versions. What I didn't do is configure the VT100 as a terminal, which of course is it's original purpose. Well I'm going to fix that now.
The key to making this work is an RS-232 hat for the Pi.
I purchase this and when it arrived realized that the Raspberry Pi I had been using was an older model with the 28 pin GPIO connector. So I ordered a Raspberry Pi 4 which has the added benefit of being able to run a much wider range of RetroPie games, and is a more capable desktop machine.
So when I put it all together the hardware looks like this:
So here's what's going on:
- It's a little hard to see but I printed a "caddy" for the Pi (with hat) and glued it to the bottom of reproduction. I then secured the Pi into this holder with double sided tape.
- I chopped a short micro USB cable and added wires with female headers for the power and ground line. I plugged the micro USB connecter into the display's power jack and attached the wires to +5V and GND on the Raspberry Pi GPIO pins.
- Similarly the HDMI from the display is connected to one of the micro HDMI connectors on the Pi.
- The rightmost black cable coming in is the USB C power cable attached to the Pi.
- The silver cable with the blue plug is the RS-232 cable. More on this in a bit.
- The white USB dongle is for the wireless mouse. Of course a wired mouse would be OK too.
- And finally the remaining two USB cables are for the keyboard and arcade controls.
So not only does this add RS-232 capability to the build but consolidates and improves the other features as well.
As I did what I described in previous sections, I first setup my new Pi 4 with the latest RetroPie image. There is great documentation on how to do this at RetroPie Docs.
To install the Pixel desktop, go to the RetroPie configuration page and select 'RetroPie Setup'. Then select 'Configuration/Tools' from the setup menu. From the displayed options menu select 'Raspbian related tools', then select 'Install Pixel Desktop environment'. Once done you should be able to switch to the desktop by selecting Ports/DESKTOP from the RetroPie menus.
Before we can get the RS-232 working we have to tweak the Raspbian image a bit. Switch to the Pixel desktop and open a terminal window. If you'd like to communicate with a serial device then we need to edit the boot cmdline.txt file. Before we edit this file its a good idea to take a backup of it:
sudo cp /boot/cmdline.txt /boot/cmdline.txt.backup
Now we can edit the original:
sudo nano /boot/cmdline.txt
You then need to remove the following text:
Save the changed file. Before this change will take effect you will have to reboot the system.
Now that we have stopped the Pi from using the serial to output its console data, we can use the serial port with our own software. I tested the serial port with minicom. From a command window install minicom.
sudo apt-get install minicom
Then to run minicom enter the command:
minicom -b 9600 -D /dev/serial0
You can of course change the baud rate to whatever is appropriate.
So how can you make sure that the RS-232 serial port is working correctly? Well you have to attach it to something. Now I don't have another device with an RS-232 port, and none of my computers have one. But I do have a lot of available USB ports so the simplest thing to do is invest in a USB to RS-232 adapter cable. Here is the one that I purchased on Amazon (DTECH 6 Feet USB 2.0 to RS232 DB9 Female Serial Adapter Cable).
I attached the DB9 connector to my RS-232 hat and the other end to a free USB port on my laptop. Make a note of the COM port that the cable attaches to. Then I needed to run a terminal program on my laptop. Fortunately I have Putty which supports serial.
Here I selected the Serial radio button and entered the COM7 port the cable was using and the baud rate to use. When I clicked open I was able to type into the terminal window and see the characters appear on the VT100, and likewise type into minicom and see the characters appear in Putty. Serial working!
Connecting to the PiDP-8/I
I'm kind of coming full circle here. I now want to establish a serial connection to the PiDP-8/I. My first thought was to get another RS-232 hat for the Pi running the PiDP-8/I. Unfortunately the PiDP-8/I software uses practically all of GPIO pins including the ones used for serial connection. Oscar's suggestion in the PiDP-8/I documentation is for: "a real VT-100, VT-220 or similar serial terminal. Use a USB-RS-232 adapter cable. They cost $5 or so (search on Aliexpress and similar sites)." Just like the one I purchased. How fortunate ;-)
Before you can use the cable as Oscar puts it " Some Linux-foo is required to set up the [PiDP-8/I] Pi so that it has a console port assigned to the USB-Serial port.". Here is what to do (reproduced from this link for your convenience).
1. Copy the file 'serial-getty@.service' from '/lib/systemd/system' to
- '/etc/systemd/system' (for standard Raspbian)
- '/etc/systemd/system/xyz' - where xyz is a 'wants' subdirectory whose exact name I forgot, but it'll be obvious.
This file is a generic template for setting up a serial terminal with a log-in prompt.
2. The file must be renamed, so that it points to your serial terminal which will be ttyUSB0. The filename becomes:
3. The file may need to be edited with the parameters of your serial terminal, or the default setting may work. In my case I changed the first line in the [Service] section to read:
ExecStart=-/sbin/agetty ttyUSB0 9600 vt100
4. Now, enable the service with:
'sudo systemctl enable serial-getty@ttyUSB0.service'
You should get a 'Creating sim link ....' message. The service will now start up at every boot.
Once done, connect the cable to the USB port on the PiDP-8/I and the RS-232 DB9 port on the VT100. From the minicom terminal on the VT100 you should now be able to press Enter and see a login prompt for the PiDP-8/I.
One other thing I did on the VT100's Raspberry Pi was to change the font for terminal window to be something more appropriate for the era (and save eyestrain). This involves editing a system file called “console-setup”. You just need to load it into your preferred text editor and tweak a few lines :
sudo nano /etc/default/console-setup
Change the FONTFACE and FONTSIZE lines to :
Save this file and reboot. This will set the terminal window on the VT100 to be 72 characters x 25 lines which looks really good IMHO.
Running the Applications
When you power up the VT100 reproduction it will boot into RetroPie for your arcade pleasure.
If you want to use the Pixel desktop you can use the RetroPie menus to select Ports then DESKTOP. To get back to RetroPie select the Shutdown... menu item then select Exit to command line.
To connect to the PiDP-8/I bring up the RetroPie Main Menu and select QUIT then select QUIT EMULATIONSTATION. This will bring you to a full screen command prompt. From here fire up minicom:
minicom -b 9600 -D /dev/serial0
then login to the PiDP-8/I and follow the Obsolescence Guaranteed instructions to get to the OS/8 prompt. If you exit minicom you will be able to get back to RetroPie by running the emulationstation command.
Wrapping Up Again
I feel better now with my VT100 reproduction fully supporting RS-232. The terminal, arcade, and desktop functions are now much more integrated. It's just a tidier more polished project now. Well worth the effort.
- 03/05/2021 at 14:05 • 0 comments
03/01/2021 at 22:39 •
When I found the perfect screen for this project, and I saw the following in the product's description:
The display's 4:3 aspect ratio makes it a great upgrade for retro gaming builds.
I knew I was going to try and prove them right. I'll let you be the judge if I succeeded or not.
I purchased an arcade controls kit from Amazon.
I modified the VT100 keyboard model and designed a new front face to accept the controls.
I mounted the joystick in a frame printed on the bottom of the front face and held it in place with some printed "tabs". The longer tabs also join the two front frame pieces together. Wiring is pretty straight forward as the kit comes with a USB interface board and all the cables necessary to build a working arcade console.
I had an Raspberry Pi B laying around which should be OK for the older classic arcade games that I like. I added it to the terminal body and connected it to the display with a short HDMI cable.
The black cable is the USB connection to the arcade controls, and the two grey cables are power to the Pi and the display.
I flashed an SD card with the RetroPie image and booted everything up. It all works really well. A scaled VT100 reproduction makes for a pretty funky and unique arcade cabinet.
02/26/2021 at 19:54 •
My new screen finally arrived. I prepared the display the same way as I did the 16:9 aspect ratio panel.
I printed a carrier for the driver board and used two sided tape to hold the PCB in place. Then I attached the carrier and board to the back of the display also with two sided tape. I redesigned the front panel to accommodate the larger screen and mounted the display with painters tape as the was no room to use tabs like I did with the smaller screen. Also note that I added a 90 degree HDMI “elbow “ so that the cable would go straight out the back. Finally I snapped the front panel into the terminal frame.
And voila. My finished VT100 2:3 Scale Reproduction. To me this looks so much better than with the smaller screen. I adjusted the font to get as close to an 80 x 24 character layout as I could. Here is a photo of the reproduction and Oscarv's PiDP-8/I.
I think they look great together.
02/24/2021 at 00:27 •
My 3D printer has been going non-stop for the past ten days or so. I finally finished printing and installing last piece of the main terminal body so I thought I would share.
Unfortunately the join lines are clearly visible. Fortunately I was able to confine the worst of the misalignments to the back of the terminal. Some were due to the print pulling off the bed slightly despite my best efforts to mitigate. The rest are not so bad that I'm tempted to go the bondo and sanding route.
I attached front and top panels. This version still has the seven inch 16:9 display. The eight inch 4:3 display that I ordered is still stuck in Fargo ND due to weather (update Memphis TN). Sigh.
02/19/2021 at 17:19 •
I wasn't happy with the way the 7 inch 16:9 display looked.
For one thing it was mounted too low. That could easily be fixed by adjusting and reprinting the black frame. But even then I'm not sure it would look right. So I started searching for an alternative and found a display that I had missed on my first go around that is practically perfect.
This is a PIM372 (Digi-Key part number 1778-1225-ND), an 8 inch 1024x768 XGA display. From the description:
The display's 4:3 aspect ratio makes it a great upgrade for retro gaming builds.
Or retro terminal builds. I had mentioned that the optimal size for a scaled down display to be 168 x 126 mm. Well the viewing area for this display is 165 x 124 mm. It doesn't get much better than that. I reworked the display panel model with the dimensions from the data sheet (outside dimensions 174 x 136 x 3 mm) and found that it will just fit.
So I have one on order. Unfortunately it is delayed in transit at the FedEx Fargo ND facility due to the weather situation down there. I guess I'll just have to be patient.
Update: The display arrived and I was happy to see that it is not in fact monochrome as the Digi-Key description implied.
02/15/2021 at 18:05 •
As with the keyboard I determined the optimal size for the scaled down display to be 168 x 126 mm, aligning with the common 4:3 screen ratio of the day. Well you can imagine how hard it is to find a small 4:3 display today. However 7 inch LCD screens a very common, fairly cheap, and their width at around 165 mm is practically perfect for my needs. The 16:9 screen ratio though does shrink the screen height from optimal, but there is not much that can be done about that.
I eventually decided to purchase a GeeekPi 7 inch 1024 x 600 HDMI Screen LCD Display with Driver Board from Amazon.
I prepared the screen for mounting by printing a shallow container to hold the driver board used a Velcro strip to secure the PCB in place. Then I used additional Velcro strips to attach the driver board and caddy to the back of the display.
I had already sliced off the front 25% or so of the terminal model and printed it out as four pieces that I glued together with a CA based gel adhesive (LePage ULTRA-GEL). I couldn't resist adding the Logo that I had printed earlier.
I also designed and printed the front piece to mount the display as well as some tabs to hold it in place.
Mount the display on the back of this piece into the frame provided and secure it in place with the tabs.
Finally insert the display frame and the curved piece at the top into the terminal model and secure it with glue.
And that's it for now. When I was positioning the actual display in the model, I centered it onto the frame that was holding it. Looking at the integrated unit above with the top curved piece in place it feels a little low to me now. Not sure yet if it's enough for me to spend another nine hours plus filament costs to change it though.
It occurred to me at this point that I could almost stop here having achieved most of what I set out to do. With a nice back piece and heavy base holding everything upright, I wouldn't be missing much sitting in front of and using this terminal Façade. I'm going to push on and print the rest but it feels like a viable and even kind of cool option.
02/15/2021 at 16:37 •
According to Wikipedia, the PDP-8/I was launched in 1968, while the VT100 wasn't available until August of 1978. While it is conceivable that an old PDP-8/I at some point was connected with a brand new VT100, it far more likely that early PDP-8/I's were connected to some brand of teletype machine like the Teletype Model 37. By 1970 early VDUs like the Datapoint 3300 or DEC's own VT05 (I love the Jetson's futuristic look) were probably used.
If anyone in the Hackaday community has actual first hand knowledge of terminal usage I would be very curious to know.
At any rate, I guess I get low marks for historical accuracy matching a VT100 with Oscar's PiDP-8/I reproduction. On the other hand, the DEC VT100 is probably one of the most iconic VDUs of all time, both in terms of its look, and the protocols (the emerging ANSI X3.64 standard) that it supported, to the point where VT100 emulators are ubiquitous even today.
Jim Beatty was kind enough to share his experience with PDP-8 machines.
I cut my teeth on PDP-8s from about 1968-78. Early on an ASR-33 teletype was the terminal of choice, at 110 baud. Later there was a terminal called a Decwriter (I believe it was dot matrix). Video terminals were a rarity until the mid-to late 70s.
ASR-33 on the left and Decwriter on the right.