Giter Site home page Giter Site logo

cry-d / vectron_vga_plus Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nickbild/vectron_vga_plus

0.0 0.0 0.0 29.04 MB

Vectron VGA Plus generates a 640x480@60Hz VGA signal and has an interface that works with retro computers or microcontrollers.

C++ 100.00%

vectron_vga_plus's Introduction

Vectron VGA Plus

Vectron VGA Plus generates a 640x480@60Hz VGA signal and has an interface that works with retro computers or microcontrollers.

Screenshot of Vectron VGA Plus running a demo:

How It Works

I previously built a massive 7400-logic based VGA generator called Vectron VGA. While it was a nice project to build, it is huge, and not very practical to keep around for use in lots of other projects. I built Vectron VGA Plus as a much smaller, simpler alternative.

The key change that simplified the design was to use more RAM and less logic. So, for example, instead of having counters and flip flops, etc. to time each horizontal sync, that logic is embedded in the data in memory. This new design was also used to create a PCB, and the KiCad files are here.

The general overview of the design goes like this: a 25.175 MHz pixel clock (divided in half by a flip flop) is used to trigger a chain of 4 bit counter chips. These counters form an address in memory, and bits from the data stored at that memory location represent red, green, blue, horizontal sync, and vertical sync. When the end of a frame is reached, magnitude comparators reset the counters, and it all starts over for the next frame.

Of course you also need to get data in to the RAM, so there are some buffer chips and mode selection signals to allow an external device (e.g. retro computer or microcontroller) to take over bus control and write RAM as needed.

As I mentioned, the 25.175 MHz clock has been divided by 2, which yields a viewable resolution of 320 horizontal pixels. To keep logic simple, the vertical resolution is kept at 480 lines, technically giving an odd resolution of 320x480, but it is expected that in actual use, the external device is going to double up horizontal lines, giving a standard resolution of 320x240. 3-bit color was implemented, yielding a palette of 8 colors.

Since even non-visible screen regions need to be represented in the RAM (for blanking periods and V-sync/H-sync timings), RAM usage is higher -- 320x480 requires 210KB of video RAM (I used a 512KB chip that I had on hand, but a 256KB chip would be sufficient). That's a bit extravagant for the 80s-esque 6502-based retro computers that I build, but it's also, I think, within bounds for a pure retro device (as opposed to using a microcontroller or FPGA). In addition to the reduction in chip count, this design also pays off in flexibility; timings can be tweaked by adjusting the contents of memory, even after the PCB has been finalized.

Media

An Arduino Mega 2560 sending images to Vectron VGA Plus:

Oops! I picked the wrong footprint for my oscillator! Fortunately, I could still solder the pins to the pads.

Schematic:

Breadboard prototype of circuit:

Bill of Materials

  • 1 x 25.175 MHz oscillator
  • 1 x 74LS74AN
  • 5 x 74LS161
  • 2 x SN74LS682N
  • 1 x SN74HC32N
  • 1 x 74LS04N
  • 2 x SN74LS245N
  • 4 x SN74LS244N
  • 1 x AS6C4008-55PCN
  • 1 x 74LS273
  • 3 x 200 ohm resistors
  • 3 x 100 ohm resistors
  • 2 x 200 uF electrolytic capacitors
  • 1 x VGA connector
  • 36 x female header pins

About the Author

Nick A. Bild, MS

vectron_vga_plus's People

Contributors

nickbild avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.