My current set up uses 11 pins for the LCD interface. Inevitably, in Ben Eater circles, people want to free up some pins by switching the LCD into 4-bit mode, which is an unholy pain. I was thinking that I have a whole unused shift register right there on the 6522, and I ought to be able to spit out data from the CB2 pin, latch it with a 74HC595, and have the LCD read from that, thus gaining 7 pins at the cost of one logic chip. (I still need a few pins for control signals). However, it's not working. At all.
Maybe it's my relative inexperience, but I find the 6522 VIA data sheet to be unhelpfully laconic when it comes to using the shift register. Before doing any deeper troubleshooting, I just wanted to double-check that my understanding of how the 6522 works is correct.
Code:
VIA_SR = $900A
VIA_ACR = $900B
lda VIA_ACR
ora #%00011000 ; set Shift Register to Mode 6 - Shift out under control of phi2
sta VIA_ACR
lda #some_byte_or_other
sta VIA_SR
I think that's all I should need to do to start spewing bits out of CB2; Although the
data sheet says only - "In mode 6, the shift rate is controlled by the phi2 system clock (Figure 27)." - examining Figure 27 seems to indicate that I should also be getting a clock output on CB1 equal to phi2 * 1/2. My little multimeter has a clock setting that detects the system clock on the bus just fine, but when I attach it to CB1 it doesn't blink. What am I missing?