Video Trigger for Retrocomputers Using TMS9928/29/128/129 VDP

by dmcintyre in Circuits > Electronics

3543 Views, 25 Favorites, 0 Comments

Video Trigger for Retrocomputers Using TMS9928/29/128/129 VDP

IMG_0760.JPG

My oscilloscope wouldn't trigger relibly on the video signal from my TMS9128 VDP, so I made this to help me work on my VDPtoTFT project.

Builders (and possessors) of retro-computers have many options for generating video. One of the chips used in computers in the early 80's was the TMS9918 family of Video Display Processors. This chip was designed to drive TVs, so the signals it produces cannot be used directly with things like small TFT displays. In order to design a converter circuit I needed something which would reliably trigger my oscilloscope on any given line. Thus was born the VideoTrigger.

If you have an old computer (or are building a new one), then this project may be of some use to you if you find the "Video" trigger option on your oscilloscope doesn't work with your video circuit.

The complete project is available in github.

Supplies

The parts list is:

1 piece of protoboard. I used a piece which was 18 x 24 pads

Resistors:

1 x 620R

1 x 680K

3 x 1K

3 x 10K

Capacitors:

1 x 510p (or 470p is close enough)

3 x 22p

5 x 100n

Transistors:

2 x 2N3904

Diodes:

3 x 1N914 (or 1N4148)

1 x 3mm LED (whatever colour you like :-) )

ICs:

1 x 74HC109

1 x LM1881

1 x Atmega 328P

Pin Headers:

1 x 01x04 Female (optional - this is for the I2C display)

1 x 02x03 Male (for the ICSP connector)

BNC Connectors:

2 connectors, PCB mounting

IC Sockets:

1 x 8 pin DIL

1 x 16 pin DIL

1 x 28 pin DIL

Crystal:

1 x 16MHz (this often comes in a little kit, with caps, reset button etc)

Reset button:

1 x PCB tactile click switch (e.g. Diptronics DTS-6 series)

Board Layout

IMG_0900.JPG

Start by laying all the components out on your chosen piece of board in a way which works for you and will allow you space to solder all the connections. Think about where you want the sockets, encoder and display to be. You can see from the picture how I laid my board out.

Once you are happy (and think about space for wires!) you can drill any hole you will need. In this case the PCB mounted BNC sockets I used needed some small holes drilled for their pins.

Note that this is how the board looked before I added R8, R9, C9 and Q2 to buffer the input.

Soldering

IMG_0901.JPG

Once you are happy with the layout, start soldering the components in place. In the picture you can see the little white plastic combs which I use to help guide the wiring. These are part of the Verowire wiring system which I use in conjunction with the Roadrunner wiring pens. I prefer the Roadrunner pens because the metal tip allows me to cut the wire in place by pushing it against the PCB.

Whatever your preferred method, make sure any supporting materials are in place before you start soldering.

Once the combs are in place (glued with Araldite) I then tack the IC sockets with a little bit of solder before starting to wire up the other components.

For this build I connected all the signal wires first and finished with the power and ground. You can see from the picture that I brought all the powers and grounds to the same place in order to minimize noise.

Rather than bringing power to the board through a header (which is show on the schematic, but optional), I just soldered the power wires from a short piece of USB cable straight to the board. This allows me to plug the board into my oscilloscope and keep trailing wires to a minimum.

You should get in the habit of checking your connections with a multimeter after you finish each one. This will allow you to catch wrong connections or bad connections at the time, and can save hours of debugging frustration and avoid any "oh you numpty" moments.

Programming

There are several options for how to program the Atmega, which can be found on the web. Although there is an ICSP header on the board, in fact I programmed the chip in-place in an Arduino board, removed it and plugged it in to the VideoTrigger. If you do this with a fresh Atmega, remember that you will need to install a bootloader first.

Download or clone the project from Github, then open the sketch in your ArduinoIDE. You will also need to install the required libraries using the library manager.

  • EncoderButton
  • SPI
  • Wire
  • Adafruit_GFX
  • Adafruit_SSD1306

Provided you have used a similar display to mine (with 128x32 resolution) there should be only one thing to modify in the code:

#define SCREEN_ADDRESS 0x3c

sets the address of the screen on the I2C bus.

If you want to use different pins there are some constraints:

  • The I2C pins are fixed SCL/SDA on pins PC4 and PC5
  • The horizontal and vertical sync signals from the LM1881 must go to PD2 and PD3 because these are the interrupt pins


Using the VideoTrigger

PositiveTrigger.png
NegativeTrigger.png
VideoTrigger.JPG
IMG_0761.JPG

Using the VideoTrigger is easy. Connect the input to your video source. This must be a signal containing both horizontal and vertical sync pulses. So either composite video or composite sync. In my case the signal I used was the "Y" luminance output from the TMS9128 VDP chip. Then connect the VideoTrigger's output to your oscilloscope. My Hantek oscilloscope has an external trigger input, so I connect the VideoTrigger's output to that. Other scopes may not have a trigger input and instead you'll have to use a spare input channel.

Set the scope to trigger off the appropriate input, on negative edges. Set the trigger threshold to around 0.5V.

Now you should be able to see a stable video signal. The VideoTrigger's display indicates the edge which is being triggered on

  • risingedge "_/"
  • falling edge "\_"

The current line being triggered on, and the total number of lines seen per frame. E.g. triggering on the rising edge of hsync for line 28 out of 260:

_/28/260

You can toggle between rising and falling edge by a short push on the encoder.

A long push resets the trigger line to zero.

Turning the encoder increments or decrements the trigger line.


And that's it! If you make it, please let me know and I hope it helps you.

Update: PCB Layout

I now have a PCB layout in the Git repo. I haven't actually used this myself yet, but will give it a go next time I have another board to make and can panelize it. If you choose to use it, it's designed so that the BNC sockets sit on the back with the display and encoder, that way it can be mounted directly on the front panel of a small box - e.g. Hammond 1598BBK