Fixed SIO Receiver Overrun

A project log for 3-Chip Z80 Design

Combining a Z80 retro design with a modern PSoC CPU. 10/15/2019 at 10:480 Comments

Grant's code uses RTS to stop the host from sending serial data to the card until it is done processing the current characters.

I was ignoring the RTS line. Added in code to factor in the RTS when determining if the Z80 was ready for more SIO data and there are no more overruns on the SIO receiver (to the Z80).

This was a fairly easy change. Added a single condition to check RTS and return busy if the RTS indicated that the Z80 wasn't ready for more data:

uint8 checkSIOReceiverBusy(void)
    if ((SIO_A_Ctrl2 & SIO_RTS) != SIO_RTS)
    return (SIO_A_RD0 & SIOA_CHAR_RDY);

 I can now drop programs into the PuTTY window and they are properly uploaded to the card.

Here's the BASIC code to write and read the front panel.

10 PRINT INP(24)
20 FOR I = 1 TO 1000
40 GOTO 10
100 FOR I = 1 TO 255
110 OUT 24,I
120 FOR J = 1 TO 1000
130 NEXT J
140 NEXT I

 Lines 10-40 read the bottom row of switches. Lines 100-140 write the bottom row of LEDs. This is described in a previous log.