Giter VIP home page Giter VIP logo

ajcasado / ardvga Goto Github PK

View Code? Open in Web Editor NEW
9.0 6.0 1.0 4.23 MB

vga output for arduino boards using sinclair zx spectrum video model

License: GNU General Public License v3.0

C++ 37.41% Objective-C 61.09% C 1.50%
arduino vga zxspectrum sinclair-zx-spectrum sinclair spectrum avr avr-microcontroller avr-programming arduino-library arduino-uno arduino-nano arduino-platform retrocomputing atmega atmega328p atmega1284p zx-spectrum

ardvga's Introduction

ardvga

vga output for arduino boards using sinclair zx spectrum video model

This can output 16 color vga with 128x96px resolution from an arduino with an atmega328p at 16MHz (using ~1.5KB of sram).

With an atmega1284 at ~>26MHz you can obtain at least 256x192px with 16 colors as in the unforgettable ZX Spectrum from Sinclair Research Ltd.

Two different colors in every 8x8 pixel square, as used to be in the ZXSpectrum. (Yes, you can recreate the attribute clash!!!!).

The pixels are driven out by the serial port (USART) in MSPI mode (thanks to Nick Gammon). http://gammon.com.au/forum/?id=11608

The Vsync and Hsync signals are timed using Timer2 and dejittered using the sleep trick from Nick Gammon/Michael Rosen.http://forum.arduino.cc/index.php?topic=102181.msg1971465#msg1971465

The pixel output is used as the S input to a 74xx298 multiplexer to select the four bits of the paper/ink color. (Inspired in the Harlequin ZX Clone). http://www.zxdesign.info/colourselect.shtml

The flash bit of the ZX attribute byte format is not used, instead i use one bright bit for paper and other bright bit for ink.

A 6 resistor DAC is used to recreate the 1bit per channel RGB+BRIGHT color pallette of the ZX.(in the Harlequin clone transistors are used for a more ZX-accurate output of 15 colors).

Other modes can easily be achieved (8x4, 8x2 and 8x1 attribute modes).

This is a personal project, the code is ugly and incomplete and bad commented.

There are tested schematics for uno and nano boards based on atmega328p in the schematics folder.

See in youtube : https://www.youtube.com/watch?v=gy4r95XHz44 https://www.youtube.com/watch?v=BLAV3MRPJYY

Last update, 1284p branch:

-Running on ATmega1284p with MCUdude MightyCore for Arduino loaded. To use this chip on a breadboard see https://maniacbug.wordpress.com/2011/11/27/arduino-on-atmega1284p-4/

-Clock is a four pin oscillator at 27Mhz.

-Example runs at 256x192px. Can run at 328x240.

-Set resolution in begin() call in chars (8x8px).

-Define MODE_720 or MODE_640 in ardvga.h to select vga mode 720x400 or 640x480

-Define EFFECT_SCANLINE or NO_EFFECT_SCANLINE in ardvga.h to configure the scanline effect. With scanline activated runs faster.

VIDEO: https://youtu.be/EQStUlc8NUM

ardvga's People

Contributors

ajcasado avatar per1234 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

m4k3r-org

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.