Skip to content

Commit

Permalink
implement ftdi fast opto serial mode
Browse files Browse the repository at this point in the history
the ftdi fast opto serial mode is much faster than uart.
it supports up to 50mhz clock.
  • Loading branch information
lynxis committed Nov 5, 2017
1 parent 6ab5602 commit be6dc41
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

NAME=top
DEPS=buffer.v bufferdomain.v lpc.v mem2serial.v ringbuffer.v uart_tx.v power_on_reset.v trigger_led.v pll.v
DEPS=buffer.v bufferdomain.v lpc.v mem2serial.v ringbuffer.v uart_tx.v power_on_reset.v trigger_led.v pll.v ftdi.v

$(NAME).bin: $(NAME).pcf $(NAME).v $(DEPS)
yosys -p "synth_ice40 -blif $(NAME).blif" $(NAME).v $(DEPS)
Expand Down
5 changes: 4 additions & 1 deletion top.pcf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ set_io lpc_ad[3] 116
set_io lpc_frame 117
set_io lpc_reset 118
set_io ext_clock 21
set_io uart_tx_pin 8
set_io fsdi 9
set_io fsclk 8
set_io fscts 4
set_io fsdo 7
set_io lpc_clock_led 99
set_io lpc_frame_led 98
set_io lpc_reset_led 97
Expand Down
25 changes: 15 additions & 10 deletions top.v
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ module top #(parameter CLOCK_FREQ = 33_000_000, parameter BAUD_RATE = 921600)
input lpc_frame,
input lpc_reset,
input ext_clock,
output uart_tx_pin,
input fscts,
input fsdo,
output fsdi,
output fsclk,
output lpc_clock_led,
output lpc_frame_led,
output lpc_reset_led,
Expand Down Expand Up @@ -107,15 +110,17 @@ module top #(parameter CLOCK_FREQ = 33_000_000, parameter BAUD_RATE = 921600)
.uart_ready(uart_ready),
.uart_data(uart_data));

uart_tx #(.CLOCK_FREQ(CLOCK_FREQ), .BAUD_RATE(BAUD_RATE))
SERIAL (
.read_data(uart_data),
.read_clock_enable(uart_clock_enable),
.reset(reset),
.ready(uart_ready),
.tx(uart_tx_pin),
.clock(main_clock),
.uart_clock(uart_clock));
wire [1:0] state;
ftdi SERIAL (
.read_data(uart_data),
.read_clock_enable(uart_clock_enable),
.reset(reset),
.ready(uart_ready),
.fsdi(fsdi),
.fscts(fscts),
.state(state),
.clock(main_clock));
assign fsclk = main_clock;

trigger_led TRIGGERLPC(
.reset(reset),
Expand Down

0 comments on commit be6dc41

Please sign in to comment.