unclouded wrote:
Is it OK to use a crystal (or crystal oscillator) other than 1.8432 MHz for the 6551 baud rate generator?
I just wired up my first ACIA (a W65C51N) and sent and received my first characters. I had to wire CTSB and DCDB to GND as noted elsewhere. I used a discrete crystal with 30pF load capacitors and the 1 MΩ resistor across the crystal. I used $8b in the Command register (No parity, echo or TX interrupt, RTS and DTR low) and $1f (1 Stop bit, 8 bit word, internal baud rate with a divisor of 96 for 19,200 baud) in the Control register. Interestingly, TDRE (the stuck bit) did go to 0 when TDR was written if CTS was left high (my chip is A6A749.1 1016G015, which is reported as having the bug).
Per the data sheet (which also highlights the stuck TDRE bit) the TDRE bit should go inactive (0) when CTSB goes high. In normal mode, CTSB is active (low) which enables transmitter operation. In this case, writing a character to the transmitter should result in the bit going to zero (meaning the TDR is not empty, i.e., it's transmitting a character). Once the character is transmitted, the bit should go active (normal operation), meaning it completed transmitting the character and is ready for another. The bad chip always shows the TDRE bit as active, meaning the chip is ready to send another character. This IS the problem. All existing software that controls the 6551 uses this bit to determine when another character can be transmitted. The stuck bit will force code to write the next character before the existing one is sent, which results in corrupted output from the 6551.