Dr Jefyll wrote:
Yes, and the read clock and the write clock don't need to be synchronized in any way.
A FIFO is a Dual Port RAM... that doesn't require any address lines!
I could see a FIFO being used to turn #6 "latch and wait" into just "latch", as long as the CPU doesn't fill the FIFO it would never need to be stalled.
but that rasies the question... where does the data go? you would also need to put the address the CPU is outputting into a seperate FIFO so the Video Circuit knows where to write the byte.
AndrewP wrote:
This is all in theory, the simulation of the 6502 is not accurate (I really only use the 65816) and the screen size is WAY to big for Logisim to simulate in reasonable time.
The six multiplexers allow either the address from the 6502 or the counter's address to be sent through to the 1K video memory. The bus transceivers keep the data that's being output to the shift register off the 6502's data line and also allow data to be written into video memory.
what fork of Logisim are you're using? in the HC Edition you have an RGB screen component. it would be enough for testing at a somewhat reasonable speed.
sadly i didn't finish my 65C02 for Digital otherwise i could use that for testing. Digital is an alternative to logisim, it runs much much faster and has a VGA output Component and allows export to Verilog/VHDL, it's what i'm using to design my ATF1508 based VGA Controller.
on a different note, would there be any differences between using Multiplexers or Tri-state buffers for this?
sburrow wrote:
ojanhk wrote:
This will allow read/write from the CPU at any time and still be able to run at any frequency.
Obviously the downsides will be that it will take multiple frames to populate the video memory and copy circuit will need to be adjusted depending on the speed ratio between cpu clock and video clock.
That definitely is my thoughts too. Still, I think we might be on #13 now? Correct me if I'm wrong.
13) Copy while Black. While the video is not being displayed, have something automatically copy from the CPU RAM side to the video RAM side.
Advantages: You can write at any time. You even get a frame buffer for no additional cost!
Disadvantages: You need to copy all the memory from one RAM chip to another in a short time. That might not be fully possible within a single frame, so tearing could occur at lower speeds or higher resolutions.
I'm sure if you use the Double Duty method it will definitely work better, but it might still not be fast enough to copy all of the contents in the time of a single frame.
Thanks! Cool idea. It's like an auto-race-the-beam kindof. I like it!
Chad
interesting idea, but i don't see why the speed of the copying would rely on the difference between the CPU and Video Clock.
I'm imaging it like this:
RAM0 is the Chip the CPU has access to, it's directly connected to the Video Controller and connected to the CPU through a bunch of Tri-state buffers.
during normal operation the CPU can access RAM0 like any other Memory (with some slight latency due to the buffers).
but then either automatically (once a frame) or CPU controlled (via a CPU accessable Control Register) the Video Controller cuts the CPU's access to RAM0 and starts up an internal DMA Controller to rapidly copy from RAM0 to RAM1 (Video Memory).
And since the CPU is completely uneffected it can do other work in the meantime and the copying can be done at the highest speed possible.
once the copying is done the CPU's access to RAM0 is restored and an (optional) Interrupt is send to the CPU to let it know that it can work on the next frame.
I really like the idea of having the copying CPU controlled as otherwise the Video Controller could cut the CPU's access to RAM0 in the middle of a read/write cycle.
Obviously "CPU Controlled" doesn't mean that the moment the CPU sets the "go ahead" flag in the Video Controller that it will instantly start copying, rather the controller only checks that flag once every frame to avoid screen tearing.
Assuming standard 640x480 VGA timings there are a total of 36000 "Blank Pixels" between each frame. at the standard ~25MHz Pixel Clock that would be a total of ~1.44 milliseconds
The easiest copying mechanism would be to just copy 1 byte every pixel clock cycle. which allows for up to 36000 Bytes to be copied.
Which is sadly not enough for bitmap 640x480 * 2 colors (38400 Bytes), but it is enough for bitmap 320x240 * 4 colors (19200 Bytes) or even 640x400 * 2 colors (32000 Bytes).
If you use characters/tiles instead of bitmap graphics you can achieve larger resolutions and color depth with the same bandwidth.
Alternatively you can also increase the bandwidth by using a faster clock for the copying. but then you have to manually check if the amount of bytes you want to copy (assuming it's a constant amount) fits into the 1.44ms window without getting to close to the start of next frame, as it's not guaranteed that the copy clock is in sync with the Video Controller's Pixel clock.
this thread is dangerous, it's giving me too many project ideas and i don't have enough CPLDs for all of them!