1
\$\begingroup\$

I´m designing a simple 800x600 pixel VGA card, based on this example (but I don´t reduce the image size). I also want to use a display RAM, so a microprocessor can write a new image. For this I need to look for a two port display RAM (or?), so the VGA controller can read the image while the processor is writing the image data - I want to use this video card for some kind of retro PC later.

Does this thought sounds like a good idea? Or is does a better solution exist? And finally I´m looking for a good (cheap) SRAM which can be used as video RAM (dual port if this idea isn´t the wrong way).

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

If you don't have access to dual-port RAMs, you can also make it so only either the display-driving circuitry or the CPU can access the RAM at a time. There are quite large vertical/horizontal blanking intervals in which you can let the CPU draw into the memory.

Another alternative would be double-buffering, where you'd have two entire framebuffers. One can be accessed by the CPU without the display-driver getting in the way, just 'swap' the two buffers when you're done drawing (ideally during the blanking interval). This also requires single-port RAM, just twice the amount. It may be worth it for the extra performance.

I'm not sure if you want to do color or not, just know that you need 480 kbits of memory per bit of color depth. Also, you'd need a fairly fast RAM. When you look at these VGA timing tables, you'd see you'd have to be spitting out the pixels at 36 MHz, meaning you'd have 27.78 ns for the entire read cycle. You could also try pixel doubling (quadrupling, octupling) to reduce both the capacity and speed requirements for the RAM.


As an aside, the old 486 motherboards often had quite fast SRAM cache chips socketed on board in ~256kB capacity, which should be enough for 4 bits per color! Of course you can then use more of those to get to 8 or more bpc. You could recycle those if you have such things still lying around unused.

If you end up going with just one of those, you'd also need a mux then on the output as you'd be storing two 4-bit words per byte, and at that point you'd be clocking the RAM at half the pixel rate (~18 MHz, 55.56 ns). Finding muxes that are fast enough (still the 36 MHz) should not be as difficult.

\$\endgroup\$
4
  • \$\begingroup\$ Yeah the idea with the double buffering is quite good. I don´t know (at the current moment) if I should do a single character driver or with graphics and with color or without color. My current design use a 40 MHz clock for the VGA. My first idea was to use a as6c62256 asynch RAM, but I think this one is quite too slow. Anyway your hints helping me to get a better view of what I´m looking for :). Thank you. \$\endgroup\$
    – Kampi
    Commented Oct 10, 2019 at 12:15
  • 1
    \$\begingroup\$ Fast parallel SRAMs are still available, such as at GSI. gsitechnology.com These types are often used for video framebuffers. \$\endgroup\$ Commented Oct 10, 2019 at 12:41
  • \$\begingroup\$ @PeterSmith Thank you, I wasn't aware of those being around. I only remember not seeing that many the last time I looked for those. Although I might've also been looking for DIP only at the time... I'll remove the statement about them being hard to source; a quick search has shown that getting < 15ns SRAMs is still quite easy, even for fairly reasonable prices. The SOJ or TSOP packages should still be quite easy to solder too. \$\endgroup\$ Commented Oct 10, 2019 at 12:59
  • \$\begingroup\$ I think I will use two of this SRAMs. So I have a memory with a size of 64x8 for 40 MHz pixel clock. I split the screen into squares of 8x8 pixel.s. So I can display monochrome alphanumerical characters or colored squares with 1 byte color resolution. Maybe I make some kind of a switch to choose between color mode or character mode. And I use 2x64k for double buffering... \$\endgroup\$
    – Kampi
    Commented Oct 10, 2019 at 14:53

Not the answer you're looking for? Browse other questions tagged or ask your own question.