From 006d41e1dd05e0cf21b3af5fec3f54863f01330c Mon Sep 17 00:00:00 2001 From: Jan Michel Date: Thu, 7 Jan 2016 16:59:18 +0100 Subject: [PATCH] flexible clock speed for UART interface --- source/uart_sctrl.vhd | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/uart_sctrl.vhd b/source/uart_sctrl.vhd index d4ef19b..48eb2c5 100644 --- a/source/uart_sctrl.vhd +++ b/source/uart_sctrl.vhd @@ -11,6 +11,9 @@ use machxo2.all; entity uart_sctrl is + generic( + CLOCK_SPEED : integer := 133000000 + ); port( CLK : in std_logic; RESET : in std_logic; @@ -31,7 +34,7 @@ end entity; architecture uart_sctrl_arch of uart_sctrl is -constant CLK_DIV : integer := 133000000/115200; +constant CLK_DIV : integer := CLOCK_SPEED/115200; signal rx_data : std_logic_vector(7 downto 0); signal tx_data : std_logic_vector(7 downto 0); -- 2.43.0