![]() |
This design allows to control a few FPGA pins from your PC (through your PC's serial port).
In more details, the design:
The GP outputs can be used to control anything remotely from your PC, might be LEDs on your FPGA board, or a coffee machine with the help of a relay.
|
module serialfun(clk, RxD, TxD, GPout, GPin); input clk; input RxD; output TxD; output [7:0] GPout; input [7:0] GPin; /////////////////////////////////////////////////// wire RxD_data_ready; wire [7:0] RxD_data; async_receiver deserializer(.clk(clk), .RxD(RxD), .RxD_data_ready(RxD_data_ready), .RxD_data(RxD_data)); reg [7:0] GPout; always @(posedge clk) if(RxD_data_ready) GPout <= RxD_data; /////////////////////////////////////////////////// async_transmitter serializer(.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.