Here's what I would like to try. It's the same approach as using the PB6 counter on a VIA, but without the VIA: I use a 74HC590 binary counter cascading into a 74HC191 binary counter, with a 74HC74 flip-flop driving DSRB high ("not ready") whenever the CPU writes to the data transmit register (register 0). The same signal that sets the flip-flop also resets both counters. The 74HC191, the "high order" counter, is LOADed with whatever countdown value has been entered into jumper blocks, and the inverse output from the flip flop enables both counters. The high order countdown value should be the number of bits per transmitted byte, e.g. 0x1010 == 10 for N,8,1 line discipline.
A jumper block is provided to allow setting of the bit pattern on the low order counter which will result in a cascade to the high order counter, and a reset of the low order counter. This should be set to the ratio of the crystal frequency to the baud rate, i.e. 0x01100000 == 96 for a 1.8432 MHz crystal and a baud rate setting of 19200. Finally, when the high order counter hits zero, its ripple carry output goes low. This resets the flip-flop, which brings DSRB low again ("ready").
The 6551 datasheet doesn't indicate any role for DSRB other than to appear in the status register (unlike, say, CTSB) so I think manipulating DSRB shouldn't cause any interference with the actual serial transmission.
On the software side, the CPU need only poll the status register to check DSR. As soon as DSR goes low again, it's safe to send the next character.
Same approach as using the PB6 counter, but no VIA, and no interrupts.
An RC network on the clock pulse input on the high order counter, ensures the cascade pulse from the low order counter is long enough to provide a decent clock pulse to the high order counter (25 ns for the part I chose) when the 8-input NAND gate decodes the cascade pattern on the binary counter. I just need that to last no longer than the time required to send one bit.
A drawback of this circuit is that you have to set the counter values with jumpers, but it would be pretty easy to trap commands to the ACIA and adjust latches that would adjust the delay to be appropriate to whatever values the programmer pushed to the ACIA command/control registers.
What do you think?
Attachment:
Vega816-System Devices.png [ 183.09 KiB | Viewed 13162 times ]