I made a little bit of progress today. I thought pretty hard about how to make a linear address generator and couldn't come up with anything simple. I'm reluctant to go back to the 6845 for various reasons (one of which is that I just don't like to give up on something until I've figured it out). So, I decided to use row / column addressing. That makes the counting problem considerably more simple to solve, at the expense of some wasted RAM.
So I started building some timer circuits. The first one was easy; I need a 0 - 15 scan line counter to tell the character ROM which line of a 16-pixel tall character we're on. It will count 0 - 15 one time for each line of characters, 30 times for a whole frame. I can use a 74HC163. It, by nature, counts from 0 to 15 over and over again.
To get the row part of the RAM address I need to count from 0 - 29. That takes 5 bits, which is more than a '163 can do without cascading, but I have some more '590s. I used a few AND gates and a NAND gate to detect "29" and issue a reset signal. I set up some LEDs to test it, and it worked fine.
Then I moved on to the column part of the RAM address: 0 - 79. I made exactly the same circuit as for the row counter, except that I needed to gate 7 bits to generate the reset instead of 5. This one didn't work. I did a lot of troubleshooting. I added a bunch of LEDs, used a slow clock, etc. No matter what I tried, it would reset as soon as bit 6 went high. I thought maybe it was crosstalk, or ground bounce, or parasitic capacitance, so I added a bunch of bypass caps and ground return loops. No change. It would reset, even though the LED on the reset pin never went out! So, I added a flip-flop to latch the reset signal, and that fixed it.
I'm not sure what to make of this. The row counter is identical, except for gating two extra bits to detect the reset condition. Maybe I should add a latch to that one too, just in case...
Attachment:
20221206_220955.jpg [ 3.8 MiB | Viewed 969 times ]
On the left:
74HC163, 74HC590, 74HC00, 74LS08, 74LS08.
On the right, my trouble lights, 74HC590, 74HC74.
All those loopy jumpers must be pretty noisy. I wonder if I could get by without the flip-flop if I replaced them all with nice flat wiring.