I can see how that would work for the first 8 rows, but then what happens when you get to row 9 of 64 and you have an address of -1 when you want 1031?
OK, so you may also need a “every 8 rows, increment by 1032” or something.
Or actually if you don’t do the subtraction it should already be perfectly lined up, no? So in that case you’d just check for every 8th row and do nothing at all.
Basically you want to use math to write “for every row, do this” and “for every 8 rows, do this”. So then you describe only 2 conditions, not 64.
What’s great about FPGAs though is that those extra 62 conditions aren’t going to slow you down any… because the comparisons are all happening simultaneously, not sequentially!
Getting close to having boards available for sale now, and I look forward to seeing how far the community will optimise / ‘bum’ down my imperfect / ‘не слишком изящным’ Verilog!
I hope you’ll break out unused GPIO’s too for future additions (Kind of thinking (S)NES controller to parallel buttons? push button for mode selection? )
Also got this crazy idea for my pro micro that serves as (S)NES controller:
Compress the VGA1306 firmware and store it in the pro micro so it can uploaded (and be updated) to the VGA1306 board. One more project on the heap
(Note: Regarding the RESET and DONE pins on their separate two-pin header. RESET has a pull-up resistor attached, so you don’t need to drive it high - you can just release it. And DONE has an internal “weak pull-up resistor”, but you may be able to disregard the DONE pin anyway - I don’t pay any attention to it when using that Raspberry Pi script and have not had any problems…)
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!