Close

Fixing Handshakes

A project log for Retro 68000 CPU in an FPGA

Making a Retrocomputer with a 68000 CPU in an FPGA

land-boardscomland-boards.com 02/21/2022 at 12:040 Comments

Tried loading from the serial port and had issues again.

Found the problem is related to the inability of the n_rts line to respond early enough to slow the USB (FPGA to Host) handshake in time. The bufferedUART.vhd code was set to turn off RTS when there are > 8 chars in the receive buffer. The FT230X part doesn't react that fast. Changing the threshold to 4 fixed the problem.

    -- RTS with hysteresis
    -- enable flow if less than 2 characters in buffer
    -- stop flow if greater that 4 chars in buffer (to allow 12 byte overflow)
    -- USB-Serial is fast, but not fast enough to make this larger
    process (clk)
    begin
        if rising_edge(clk) then
            if rxBuffCount<2 then
                n_rts <= '0';
            end if;
            if rxBuffCount>4 then
                n_rts <= '1';
            end if;
        end if;
    end process;

I can now download code again.

Download Code Procedure

Discussions