FPGA-USB-Device
FPGA-USB-Device copied to clipboard
Great code, one question
Thanks for making this repo, I'm interested in using the usb_serial(2) port in my homebrew 8 bit retro computer project I've one doubt though:
While the serial code can signal to can accept the byte I want to send from the device to the host ( send_ready ) I don't see any way to signal whether the device can accept received bytes, as my 8 bit computer is slower than the USB connection and is not always polling the port, if there a way to implement a input wire to flag the host it's allowed to send?
Maybe https://github.com/ulixxe/usb_cdc is what you are looking for. It has data control flow for both IN and OUT. Furthermore you can choose how many channels to use.
A simple way is to add the backpressure signal around line 239 of usbfs_transaction.v. If your SOC side is unable to accept the data, return PID_NAK instead of PID_ACK.