Re: Text mode VGA for 6502
Posted: Tue Jul 04, 2023 9:15 am
Paganini wrote:
I have an old 200^H^H^H100Mhz 2-channel Tektronix analog scope. (I could have sworn it was a 200MHz one, but the evidence to the contrary is right there in the photos...
) The 25MHz dot clock is sort of just barely within its power, but it looks pretty spiky. It's not so bad that doing what you suggest wouldn't give some useful info though. I'll try to remember to do that tomorrow and take some comparison photos.
So what I'm seeing is kind of what I was worried about - the traces for the non-inverted version look a lot better. Here I've superposed the raw clock below the one with the inverted clock, and marked some points of interest:
I marked the rising edge of the raw clock in yellow, at maybe two thirds of the way up to its peak; and the rising edge of the inverted clock in red. This is approximately when the shift register will either shift or load, in each case. Then in blue I've marked the apparent delay from the rising edge of the raw clock to the changes in the shift register's shift-or-load input. This delay is likely due to the counter, AND gate, and inverter, along that path, and as I feared it looks like it adds up to about the same as the 20ns delay caused by inverting the clock. This means that in the inverted clock case, the shift register's clock edges (red) come extremely close to the edges in the shift-or-load signal. In the datasheet it probably has a setup time requirement and maybe a hold time requirement, which could be violated here.
In contrast when the shift register receives the raw clock, its rising edges (yellow) fall nicely in the middle of the "load notch" - you couldn't really ask for a better result unless you planned it. So I'd much prefer the uninverted clock.
Now the question is, why are there image artifacts. The artifacts you're seeing aren't what I'd expect to see due to this clock alignment issue - what I'd expect to see there would be either image instabilities (single-pixel shimmering of the characters left and right), or missing pixel columns at the right hand edges of characters, or doubled-up pixel columns at the left edges of the characters. These are artifacts of sometimes or always performing two loads and six shifts, instead of one load and seven shifts. I guess another possible artifact is characters being entirely missing, due to not performing the load at all (both clock pulses just missing the edges) but it seems less likely.
I don't think any of these are what you're seeing though. To really see these you need a special font that deliberately has pixels in both the left and right columns of the character cells - I'd probably use a diagonal line of pixels through the character cell, with a marker of some sort to show where the character boundaries are, e.g. a short line along the top of the character cell, but not intersecting the line because we need that to be a completely clean 45 degree line of pixels. Armed with that, you should then be able to see pixels being too fat, too thin, missing, unstable, etc.
Equally most fonts don't really need one of these columns of pixels except for W and M characters, so in fact you might be able to get away with them not working particularly well!
But then the question is, what are you actually seeing? And secondarily, how is it caused/resolved by inverting the clock? It is very odd that it repeats every 10 characters (not 8 or 16). It looks very much like the kind of effect you get when the monitor adjusts its pixel clock incorrectly due to e.g. you not outputting all 640 pixels in each row - or outputting too many. It looks like in that case you did only show 79 characters. So I wonder whether this is some kind of sampling artifact from stretching 632 pixels out to 640 pixels, and then eight times during the character row the monitor is sampling your RGB levels during a transition between pixels.
Quote:
gfoot wrote:
Great to see. Where do VSYNC, VBLANK, and BLANK come from? More counters based on the shift register load signal, maybe going through logic gates to compare against key values? Is BLANK just for horizontal blanking or combined blanking?