Hi all. I originally wrote this in another place, and it seems to me this is a good place to share it, of course to get comments and corrections from all of you. Thanks in advance.
6567 preliminary (it seems to be the only ones available everywhere) spec sheets says that an horizontal raster line takes always 520 clock cycles.
Attachment:
image.png [ 46.79 KiB | Viewed 2296 times ]
Those cycles are NOT CPU-clocked cycles for me, but VIC-clocked cycles. As you may know, the VIC draws 8 pixels by every CPU cycle. That's why the dot clock is eight times greater that the system clock. So if we divide 520 cycles by 8, we get 65 cycles, and that matches what the VIC timing specs says, that every horizontal raster line takes 63-65 cpu clock cycles.
Also, I've checked what's the duration of a line scan in both NTSC and PAL video signals standard. In NTSC, an horizontal line takes 63,5 microseconds to be drawn, and in PAL, 64 microseconds.
So, the VIC-II does access the memory 64 times minimum during every horizontal raster line, to read each one of the bytes that conforms a character or a bitmap. Additionally, access to sprite data and memory refreshing does requiere memory access (bad lines comes here) and there are also idle accesses that does 'nothing' but are part of the timing.
As you may know, the 65xx family of chips does use the high and low parts of a cycle to take turns accessing memory. So the memory actually gets accessed twice in every system clock cycle. It's like the memory running at 2mhz but actually stepping
twice when the rest of the system steps
once.
That said, the memory gets accessed 128 times a horizontal raster line. If an horizontal raster line takes ~64 microseconds, then every memory access takes 0,5 microseconds which is 500 nanoseconds.
The LH2464-12 memory chip that my '64 sports does an access time of 120 ns, so it does gracefully
serves whatever thing both the CPU and the VIC does they ask it to do (read or write).
So... If a read of write of the VIC or the CPU every 500 ns... but the memory itself
runs at 120ns, it could be said that there are 380ns of
spare or
idle time where the memory could be accessed to be read or written to, with neither the CPU or the VIC noticing it. And with 120ns of
speed, it would mean that at least two or even
very carefully timed three times it could be done.
What is the thing to be know? The actual amount of
time 65xx chips leave the memory chips alone.
Code:
<------ high phase -----><------ low phase ------> system clock cycle
0 1 2 3 4 5 6 7 8 9 \
02468024680246802468024680246802468024680246802468 > nanoseconds
00000000000000000000000000000000000000000000000000 |
-------------------------------------------------- /
CCCCCCC CCCCCCC 65xx chip memory access (VIC-II or CPU)
FFFFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFFFF Free? Idle? Spare? time of no memory access
That is the time chart I've thought. In theory, all those
F are when the system RAM could be accessed with no CPU or VIC-II involved. But even better: with the CPU disabled, the times where the VIC permits the 6510 to access the memory, could be got by an external CPU to write to the memory before the VIC does access to it again to fetch data.
But the question after all of this is:
Is the memory
actually free when one of the 65xx chip ends its turn of read/write to the memory chips?
Do any of this actually makes sense?