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’!
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!
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! ) 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)
Have been working on a version using NTSC composite video (yes, the little yellow RCA jack ) outputting 4-level greyscale! Loving the way it looks on my TV:
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).
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!
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!
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
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.
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.
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.
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
(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:
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 @sjm4306 I appreciate you getting those files update quickly and looks like they work no problem