It’s now 2pm on Saturday and I’m a little closer to understanding how to plot a pixel, although only a little.

The first attempt to generate a video signal resulted in, well see for yourself, detune a tv channel and look at the white noise, that is pretty close to what I’m looking at right now and unless you happen to be Eleanor Arroway1 it’s not all that useful.

White noise is not unexpected, I’ve yet to setup any kind of timing for generating the video signal but at least I’m outputting to the correct port to generate a signal. After a little digging through the XGS docs I’ve got the information on the PAL signal specs, the main bits of interest are:

  • Front Porch 1.5µs
  • Active Video 53.1µs
  • Sync 0V
  • Black 0.3V
  • White 1.0V

Horizontal Sync

Based on this we can calculate the number of pixels a PAL tv can cope with. At 5.5Mhz we can change the signal at a rate of 15.5Mhz = 182ns which gives us 53.1µs / 182ns = 292 pixels per scanline (best case; although I think my tv will do 720 due to extra bandwidth, but we’ll go for a conservative value)

So in order to get a pixel (assuming no colour) on the screen I need to generate a video signal to display 312 scanlines, each comprised of at most 292 pixels. I’m ignoring colour burst for now. The pal reference signal look as followings (image from Haagan’s website)

PAL Reference Signal

PAL Reference Signal

Vertical Sync

Once the horizontal signal is up and running the vertical signal should be a snap. It’s nothing more than another timing signal, so we’ll be sending a hsync signal for each line followed by 4-10 lines of vsync. I’m keeping this simple and going for 274 lines at 50Hz (50 frames per second) with 16 blank lines top/bottom to account for tv variations and the 6 lines of vsync giving a total of 312 lines.

The key to this is the timing. With the SX52 processor running at 80Mhz, 1 clock cycle = 12.5ns. I need to ensure that the number of cycles used to generate the signal matches the above timing diagram.

There is a whole lot more to the signal generation than the overview above, if you’re interested in the details either get the XGS and read the book (which in addition covers designing and building the actual video hardware).

The plan for the larger part of today is to get a suitable delay macro up working and outputting the appropriate voltages to generate a stable H/V signal. Initially using a fixed value for each pixel (I’ll get to plotting a single specific pixel later.. for now it’s a screen fill - Fingers crossed).


  1. Jodie Foster’s character in Contact. [return]