For those that don't know, the NES controllers essentially have a simple shift register in them. You set the latch pin, then clock it 8 times and you will get the 8-bit value of the buttons.
Since I want to drive two of them, I was thinking that I could use PA0 for CLOCK on both controllers (clock them at the same time). And PA1 for the latch on both controllers (latch them at the same time).
But each controller has a D0 (data) output pin. As I am clocking them, I need to capture two bits at the same time but split them out into two separate bytes. I hope that makes sense.
It would seem using the shift register of the VIA would be a good fit but I would need two of them.
So in theory, I should just need four pins.
Code: Select all
CLK
LATCH
D0
D1
Thanks!