VGA1306 (VGA-out for DIY Arduboys implemented on an FPGA!)


#103

Did some more experimenting with different applications of the VGA1306 board over the long weekend… took an Arduino-based VT100 terminal emulator from here, and refactored from 32 columns by 10 rows up to 80 columns by 60 rows. Then had it feed the character buffer into the VGA1306 running VGA ‘character-mode’ firmware adapted from here / here! The Arduino sketch is running on an old Duemilanove board with a ATmega1284-based ‘UNO*Pro’ expansion plugged in…

So from there, with the Arduino plugged into my laptop’s USB port, I can just run a Linux command like:

ping 0 | tee /dev/ttyUSB0

for example, and have the ping command’s output automatically redirected to the VGA1306 ‘terminal’! :grinning:

Here’s all the code:


VT100 serial terminal as a secondary display?
Arduboy_VT100
#104

Very happy to finally announce that boards are now up for sale :smiley: at:

…manufactured, assembled and tested on-site by matt of kitsch bent, and branded as ‘easy_VGA’.

Note: to order a board with the SSD1306 to VGA firmware, and the 6-pin header soldered on, you need to add three separate items to your shopping cart:

  • main board
  • IC for SSD1306 VGA
  • header assembly service

#105

PS. Just as a heads-up to those who are in possession of the ‘prototype’ version of the board (@filmote @Mr.Blinky @Keyboard_Camper @eried @JayGarcia @sjm4306 @CRImier) take note that the pinout for the 6-pin header is flipped / inverted on this revised design, if you end up buying one! :wink:


#106

Digging further down the rabbit-hole of VGA1306 as a sort of ‘80x60 character mode’ video card, I have made a fork of ArduinoBASIC:

BASIC

(brought over a separate 5V supply for the keyboard - sticker on the back of this keyboard says 200mA, so I didn’t want to overload the Arduino)

Happily, there were not a lot of modifications necessary to refactor the code for 80x60 characters at 640x480 resolution! I added in a COLOR command for selectable foreground / background colours (all 8 glorious colours of the 3-bit RGB rainbow! :rainbow: ) and also added a #define to optionally use Serial for keyboard input (instead of a physical PS/2 keyboard) if desired…

(I am using the ‘serial keyboard’ in this video for the sake of easily cutting & pasting the program listing)


(Simon) #107

Now that is pretty cool!


#108

Have been working on a version using NTSC composite video (yes, the little yellow RCA jack :smile:) outputting 4-level greyscale! Loving the way it looks on my TV:


(Shawn) #109

Dude, making a consolized composite video output gameboy would be awesome! Pretty please release the code and schematic for this once you are done!!!


#110

…have been playing with this some more on a giant 68cm CRT! :tv: :upside_down_face:


(luis) #111

this is a really cool project excellent job on this, I had just bought an easy_VGA off of Kitsch-bent about a month ago and installed it on a DMG that had a broken LCD. this thing works really well. Would love to see a version of this device that can swap color palettes. Also, I think the current color palette is somewhat inverted, I think it would look better if the colors were rearranged. (black should be cyan) (blue should be black) (green should be blue) (cyan should be green).

Current color scheme
Title_Screen_(Super_Mario_Land_2_-_Six_Golden_Coins)%20(3)


(luis) #112

rearraged color scheme
Title_Screen_(Super_Mario_Land_2_-_Six_Golden_Coins)


(luis) #113

although replacing cyan with white might be more ideal

Title_Screen_(Super_Mario_Land_2_-_Six_Golden_Coins)%20(2)
I’ll be testing this out for my self, I ordered a programmer so I will be attempting to edit the code a bit and re-imaging the eeprom.


#114

I like your thinking - I just recently assisted another user in customising the colour scheme to their own liking:

The 3-bit RGB palette gives you 8 colours to choose from, so don’t feel like you need to stick to the lower four that I chose either:

Changing the colours in the source code is pretty straight-forward - here is the part you will need to edit (around line 187 in the code):

        if(dout == 3) begin //check pixel buffer data
          vga_r_r <= 0;
          vga_g_r <= 0;
          vga_b_r <= 1; // BLUE
        end
        else if(dout == 2) begin
          vga_r_r <= 0;
          vga_g_r <= 1; // GREEN
          vga_b_r <= 0;
        end
        else if(dout == 1) begin
          vga_r_r <= 0;
          vga_g_r <= 1; //  GREEN
          vga_b_r <= 1; // + BLUE = CYAN
        end
        else begin
          vga_r_r <= 0; // BLACK
          vga_g_r <= 0;
          vga_b_r <= 0;
        end

The process for then compiling the firmware is not too difficult - just means installing ‘apio’ using the ‘pip’ Python package manager, at the command line (assuming Windows) type:

pip install apio

and then, to download all the apio packages:

apio install -a

Afterwards, from the working directory (where you have both the DMG1306.v & DMG1306.pcf files) the command to compile is:

apio build --size 1k --type hx --pack vq100

This will produce a ‘hardware.bin’ file, which is only around 32K in size - so depending on your IC programmer you may or may not need to pad this file out to fill the whole 1MB chip (and be careful to take note of the orientation for the IC in its socket when removing from / inserting in to the easy_VGA board!), good luck! :slight_smile:

EDIT: I quietly love the idea that this kind of customisation encourages others to enthusiastically start digging down the same rabbit-hole of FPGAs that I fell in to! :smile:


(luis) #115

the code seems pretty straight forward, I appreciate the notes too. I will probably struggle most with getting it all working and onto the IC , but I’m not too worried about it. As far as changing the code, Im guessing the values for VGA RGB can only be either 1 or 0, so no blending with float values, regardless its good knowing that I still have other color choices, thanks again for the the help I appreciate it.

EDIT: I am heading into unfamiliar territory being that my coding experience has only really been software based, javascript and C# so I am definitely heading into a crazy rabbit-hole


(Shawn) #116

For those who want the cyan changed to white as luribe88 posted an example pic of I’ve compiled the change and uploaded the new ‘hardware.bin’ file here:
https://mega.nz/#F!vV4wDaAB!RK3aY3tXVSEwb14miNKbFg

Ordered a usb ic flasher so I’ll update when I can burn this change to a chip and test. I’m also gonna try to cut some traces on the board, tie red/blue of the vga to ground, and bodge an r2r ladder to repurpose the red/blue lines from the fpga so I can do multiple shades of green instead for that legit retro gameboy feel.


(luis) #117

Cool, Seems like that will work for changing the cyan, but I think all the colors need change too if you want it to look like my last example.
Might be something like this I think.

if(dout == 3) begin //check pixel buffer data
vga_r_r <= 0;
vga_g_r <= 0;
vga_b_r <= 0; // blue change to black
end
else if(dout == 2) begin
vga_r_r <= 0;
vga_g_r <= 0; // GREEN change to blue
vga_b_r <= 1;
end
else if(dout == 1) begin
vga_r_r <= 0;
vga_g_r <= 1; // GREEN
vga_b_r <= 0; // + BLUE = CYAN change to green
end
else begin
vga_r_r <= 1;// Black change to white
vga_g_r <= 1;
vga_b_r <= 1;
end

Awesome that you already have it complied, I’m waiting until I get my programmer in.


(Shawn) #118

Oops, didn’t know the other grayscale value states needed to change as well. I’ve recompiled with your changes and the files are updated in the mega folder I linked.


(luis) #119

Hopefully I have the colors right. I’m interested to see how it turns out for you. I’ll post some screen and the project files when I get it working too


#120

…if you have a spare Raspberry Pi around (who doesn’t? :smile:) you can use that as a chip programmer:

https://www.flashrom.org/RaspberryPi

(haven’t played with this myself, but I know it worked for @Keyboard_Camper)

Another possibility, which I have played with, is to use a Raspberry Pi with this script to upload firmware directly to the FPGA (you remove the IC from the socket altogether and wire the Pi into the socket’s pins), I discussed the method a little further up in this thread, when @Mr.Blinky was playing with the idea of using a 3.3V microcontroller instead to upload the firmware:


#121

Here’s @sjm4306’s hardware.bin in action:


(luis) #122

nice! looks pretty good. I do have a Raspberry Pi I could use then again I already order the programmer I might as well use that. @uXe dude! you are awesome you come through with answers everytime :smile: @sjm4306 I appreciate you getting those files update quickly and looks like they work no problem :+1: