JuanGg wrote:
Looks great, I may give it a try.
beware though, the VGA component has no chill, if your timing is off by a single cycle it will not work, but luckly it tells you exactly how it got the signals, so you can compare it to online to see the correct values.
http://tinyvga.com/vga-timing/800x600@60HzJuanGg wrote:
Keep in mind that:
a) My schematics could use some accompanying text for clarification.
b) I have only done brain-level simulation (which often misses quite a few things)
c) I've got no idea of what I'm doing.
a) true but i assume it was just quickly made to write down what you had in your mind before you forgot it overnight.
b) hope i helped with the "finished" circuit
c) well i got sort of an idea on how video output works. thanks to me having worked on my own multi-color, tile based video chip. which i think you could try to do as well once you "finished" this first video output thingy.
JuanGg wrote:
Originally this was meant to be asynchronous, the video card (VC from now on) would work on clock unrelated to the CPU clock, thus the extra RAM. I'm now working on deriving the CPU clock from the VC (for peace of mind), but reading from system RAM would require a way of tri-stating the CPU's address bus (data bus is floating on phi2 low). My CPU currently has no Bus Enable, so that would require additional bus transceivers on the CPU side, which I have no room for (without doing some ugly stuff that is). It just seemed simpler to have a local VRAM.
ok i had to look through the entire thread to get a better idea of what you're working with here. as far as i understood it, you made a 6502 in Logisim, and used that understanding to rebuild it in RL using individual ICs? amazing project my dude.
anyways, i think i'm getting it finally how your system is planned to work. looking at the notes i assumed the Video card would write into itself from System Memory, but it seems it reads both an address and data from whatever is in those 74373's at the top of the note to write a single byte into VRAM. and what that data and address is, is set by the CPU manually...
which is kinda genius but i'd imagine also really slow, especailly since you need 8 bytes of data per 8x8 "tile", plus you need to manually update the address everytime.
one thing i would change is to replace the 2 registers holding the address with a few counters, and everytime the CPU finishes a write it increments the counter. which would make data transfer a bit easier for the CPU.
another thing that would make life easier is some Interrupts. at least i would add 1 interrupt when the Video chip is about to start drawing the next frame, and one when it just finished drawing a complete frame. i'll add a bit more detail to this at the end of the post.*
JuanGg wrote:
Horizontal counter is running at 10 MHz, which is also the pixel clock, 1/4 of the 40 MHz pixel clock of the SVGA standard I'm implementing. So yes, my target resolution is 800/4 by 600/4, so 200 by 150. The bottom 3 bits of the horizontal counter dictate when the RAM is read and written to. Each 8 pixels, a new byte is read from VRAM into the shift register. Note that the horizontal counter runs 8 pixels ahead of the actual pixel index (see sync signals diagram on the first sheet), this is to have the VRAM address ready ahead of time to meet the RAM timing requirements.
oh i see so you just run the Horizontal counter at the divided speed so you don't have to throw away bits. i guess it works. I always like to use the full resolution counters for the sync signals and such. just like how i don't like to use shift registers and instead just use a normal 8 bit register with an 8:1 multiplexer connected to it so i can select bits 0 to 7 off it.
then again i don't have to worry about breadboard/perfboard space on a digital design...
JuanGg wrote:
You are correct. I should have clarified that on the schematics (these are just me scribbling ideas on a sheet of paper, don't expect much). Pixels are 4x4 regular pixels, as you state.
i was just confused because of how it looked on your test monitor.
JuanGg wrote:
Thanks for spending the time. I hope it was a learning experience for you too. I see that you have gone for the full horizontal resolution, as discussed above. That should be easy to change if needed. The image is pretty clear, thanks.
I am planning into getting into programable logic, and this seems a suitable project. But I'm keeping this using discrete ICs, if I manage to get it working. Good thing is that I can change cards easily in my system, so I could make a more powerful VC later on.
Juan
yea it was weird to learn, i'm used to the standard 640x480 resolution because my FPGA dev board has a 50MHz clock, so getting a 25MHz clock for that resolution is easier than the 40MHz for 800x600...
yep, good luck with the programmable logic stuff, it is really worth it. you could probably fit the whole 6502 in like 3-5 cheap CPLDs.
also sorry, but what is VC? only thing i know with that name is "Virtual Console".
*to continue from above
This image is a Pixel perfect representation of a 800x600 VGA screen, it shows the visible area in white, and the various sync and porches in other colors.
Attachment:
VGA_800x600.png [ 2.54 MiB | Viewed 2307 times ]
This image is based, again, on your notes. they said that the screen is offset by 8 pixels, since your horizontal counter is already divided by 4 it should mean the whole screen is offset by 32 actual pixels. which you can see here. the top left corner is where both counters are 0.
you may also notice 2 black lines near the bottom, those are the places where i would let the Video chip cause an Interrupt, or around that area atleast. if you have vector interrupt it would make this a lot easier.
one interrupt tells the CPU that a frame has just been finished, so the CPU should be able to write into the VRAM in rapid pace as the video chip itself no longer needs to access it.
and the other warns the CPU that it is about to start drawing the next frame so it should probably stop writting into VRAM.
anyways, interrupts are not really important at the time, but just food for thought for the future. :p
also in case you want the colors:
Attachment:
chrome_2020-04-02_00-04-26.png [ 736.74 KiB | Viewed 2307 times ]