2025-10-26 11:14 AM
I'm building a little tester for 6821 PIA using a STM32F103.
I need to be able to write to the data bus of the PIA, and also read from it. (6821 has 4 registers that are addressed using 2-bits input RS0,RS1).
So 8 GPIO pins for the databus. And I use 3 more GPIO pins for RS0,RS1 and R/W pin.
For writing to the PIA:
I set the GPIO pins to output, set the output pins actual data and then make R/W low for writing.
For read from the PIA:
I set the GPIO pins to input, make R/W high for reading and then read the input pins..
Does that sound right? I'm concerned about the timing between the GPIO data bus pins switching from output to input (and back) and then toggling the R/W line to the PIA.
Is all this switching even needed?