I'm trying to implement hardware handshaking on an R65C51P2 on a 1MHz 65C02 SBC. My ACIA has been working fine with no hardware handshaking, although it drops characters if the CPU is busy and not polling the ACIA, as expected. I've been playing with bringing the RTS line high (connected to CTS line of FTDI cable) to get the computer to pause transmission. I've already discovered that the FTDI adapter will transmit up to 3 more characters after it sees it's CTS line go high (datasheet says 0-3 extra characters, but I've always seen three), and I plan to add a software receive buffer to deal with that, but I've run into this issue first:
After bringing the ACIA's RTS line high, the
ACIA stops transmitting after a little while, and the "tx buffer empty" bit in the status register never goes high. Sometimes I can transmit for a little while longer and sometimes it stops immediately after bringing the RTS line high.
I've o'scoped out my address and data lines, and I find that I'm stuck in my code that waits for the TX buffer to be empty, but that bit stays a zero (the entire status register is all zeroes for that read). Please note this is not the same as the WDC bug where that bit is stuck high. In my case, the bit stays low. I've checked the CTS input to the ACIA (hooked up to the RTS line on the FTDI adapter) and it stays low the entire time. I've checked the ACIA oscillator and it stays stable the entire time. I have Pin 11 (DTR) floating (although it stays low after initialization). Pins 16 and 17 (DSR and DCD) are tied to GND, and my chip select comes from a GAL (25ns).
Here is the code I get stuck in:
Code:
Send_Char:
pha ;Save A (required for ehbasic)
sta ACIA_DATA
wait_tx: ; Wait for the TX buffer to be free.
lda ACIA_STATUS
and #$10
beq wait_tx ; TRDE is not set - byte still being sent.
pla
rts
I'm stuck in the tight loop at wait_tx. I probed the address lines to see what code I was running, and probing the data lines shows that this code gets a $00 into A every time.
I happen to have an RCA CDP65C51E2. When I swapped this in, I discovered that this IC needed the 1Meg resistor across the crystal and a little capacitance (10nF) on the XTLO pin as well to get it to oscillate. Once I made the oscillator happy, this chip works fine! Putting the Rockwell R65C51P2 back in displays this same funny behavior.
I tried a 4MHz clock on my SBC to see if that made a difference (even though both ACIAs are 2MHz parts) and I get the same behavior. Both ACIAs work when not using the handshaking. The Rockwell part stops transmitting a short time after bringing it's RTS output high, but the RCA part works fine.
I know some of the folks on this forum use the Rockwell parts - has anyone else seen this behavior? I'll be leaving the RCA part in my 65C02 computer for the time being, but I would like to figure out what's wrong when using the Rockwell part.