This design allows controlling a few FPGA pins from your PC (through your PC's serial port).
The GP outputs can be used to control anything remotely from your PC, might be LEDs or a coffee machine...
module serialGPIO( input clk, input RxD, output TxD, output reg [7:0] GPout, // general purpose outputs input [7:0] GPin // general purpose inputs ); wire RxD_data_ready; wire [7:0] RxD_data; async_receiver RX(.clk(clk), .RxD(RxD), .RxD_data_ready(RxD_data_ready), .RxD_data(RxD_data)); always @(posedge clk) if(RxD_data_ready) GPout <= RxD_data; async_transmitter TX(.clk(clk), .TxD(TxD), .TxD_start(RxD_data_ready), .TxD_data(GPin)); endmodule
Remember to grab the async_receiver and async_transmitter modules here, and to update the clock frequency values inside.