320x200 VGA Timings for 74HC-Series Computer

Thread Starter

devereaux

Joined Jan 21, 2019
3
Hi. I'm designing an 8-bit computer using 74HC series logic, and rather than outputting a single number to a 7-segment display I want to output to a monitor. I'd like the resolution to be 320x200, like the C64, having a 40x25 character array (1,000 bytes in RAM) that my display circuit can read and output to the monitor.

Taking a good deal of inspiration from the Masochist's Video Card, the logic circuitry for generating the sync pulses seems pretty straightforward, as long as you have the correct timings. Their example uses the 800x600 60Hz standard, but divides the horizontal timings by 4, leaving the vertical as is, therefore reducing the clock speed required from 40MHz to 10MHz - a restriction based on the speed of their 74LS series chips.

Is it possible to divide BOTH the horizontal and vertical timings?

Using the 640x480 timings, I can halve both to 320x240, which would (in theory as far as I can figure out) quarter the required clock speed. Problem is that the vertical timings aren't divisible by two:

480 Lines / 2 = 240 - OK
11 Front Porch / 2 = 5.5 - Round up or down?
2 Sync Pulse / 2 = 1 - OK
31 Back Porch / 2 = 15.5 - Round up or down?

So the logical thing to do would be to run 320x480 at 12.585MHz (25.17MHz / 2), and just double up pixel data every two lines, with black areas for the extra 80 pixels, giving an effective 320x200 pixels.

Next problem is that I can't seem to source a 25.17MHz crystal or oscillator. I've got a 25MHz crystal, so can divide by two to make a 12.5MHz pixel clock, or by four to make a 6.25MHz pixel clock. (The reason I mention that last value is the Gigatron computer uses a 6.25MHz clock, which also drives the VGA output).

How does the deficit 0.085MHz affect the timings (12.585 - 12.5)? Or will modern LCD monitors (which I'll be using) cope with the discrepancy and lock onto the signal regardless?

Thanks in advance!
 

Papabravo

Joined Feb 24, 2006
22,058
I wouldn't bet very much on rounding when it comes to video timing. You can modify your circuit much easier than you can modify a monitor. Monitors are notoriously picky when it comes to timing in my experience. Sloppiness in timing usually results in sloppy video. If you have a custom timing requirement you can always get a crystal oscillator to meet your needs. What you are really saying is that you cannot find a cheap, readily available standard part. Checkout Don Lancaster's TV Typwriter Cookbook for alternate solutions.

https://www.amazon.com/TV-Typewriter-Cookbook-Don-Lancaster/dp/0672213133
 

MrChips

Joined Oct 2, 2009
34,628
I believe that you are going about it the wrong way.
Don't worry about xtal frequency and divisor numbers at this stage.

1) Define your standard scan format for your area. If you are in the UK you will be using PAL.
2) Choose your monitor and find the scan format for that monitor.
3) Choose your hardware design. I can see three choices:
(a) DIY with discrete logic chips or FPGA
(b) video controller chip
(c) high speed MCU.

Choose your medicine.

Do you want text only or text and graphics?
Monochrome or colour?
 
Top