完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
大家好,
我需要实现一个用vhdl编写的uart模块与另一个模块通信,我试图使用这个代码(源代码)与这个主要: 图书馆; 使用ieee.std_logic_1164.all; 使用ieee.numeric_std.all; 实体MESSAGE_GEN是 港口( - 一般 CLOCK_Y3:在std_logic中; USER_RESET:在std_logic中; 发送:STD_LOGIC; - UART USB_RS232_RXD:在std_logic中; USB_RS232_TXD:输出std_logic ); 结束MESSAGE_GEN; MESSAGE_GEN的架构RTL是 - 功能 - 类型定义 type hello_world_type是整数范围0到255的数组(0到4); - 你好世界类型的定义 signal hello_world:hello_world_type:=(10,101,108,108,79); 信号状态:整数范围0到299; - 组件声明 组件UART是 通用 ( BAUD_RATE:积极; CLOCK_FREQUENCY:积极; TX_FIFO_DEPTH:正面; RX_FIFO_DEPTH:正面 ); 港口 ( - 一般 时钟:在std_logic中; 重置:在std_logic中; TX_FIFO_DATA_IN:在std_logic_vector中(7 downto 0); TX_FIFO_DATA_IN_STB:在std_logic中; TX_FIFO_DATA_IN_ACK:out std_logic; RX_FIFO_DATA_OUT:输出std_logic_vector(7 downto 0); RX_FIFO_DATA_OUT_STB:输出std_logic; RX_FIFO_DATA_OUT_ACK:在std_logic中; RX:在std_logic中; TX:out std_logic ); 结束组件UART; 信号CLOCK:std_logic:='0'; signal send1:std_logic; signal reset_d0,reset:std_logic:='0'; signal uart_rxd_d0:std_logic:='0'; signal uart_rxd:std_logic:='0'; signal uart_txd_d0:std_logic:='0'; signal uart_txd:std_logic:='0'; 信号uart_tx_fifo_data_in:std_logic_vector(7 downto 0):=(其他=>'0'); signal uart_tx_fifo_data_in_stb:std_logic:='0'; signal uart_tx_fifo_data_in_ack:std_logic:='0'; 信号uart_rx_fifo_data_in:std_logic_vector(7 downto 0):=(其他=>'0'); signal uart_rx_fifo_data_in_stb:std_logic:='0'; signal uart_rx_fifo_data_in_ack:std_logic:='0'; - 消息 常量MSG_CONFIGURED:string:=“FPGA con”; 开始 时钟115200, CLOCK_FREQUENCY => 100000000, TX_FIFO_DEPTH => 1023, RX_FIFO_DEPTH => 1023 ) 港口地图 ( CLOCK =>时钟, RESET =>重置, TX_FIFO_DATA_IN => uart_tx_fifo_data_in, TX_FIFO_DATA_IN_STB => uart_tx_fifo_data_in_stb, TX_FIFO_DATA_IN_ACK => uart_tx_fifo_data_in_ack, RX_FIFO_DATA_OUT =>打开, RX_FIFO_DATA_OUT_STB =>打开, RX_FIFO_DATA_OUT_ACK =>'0', RX => uart_rxd, TX => uart_txd ); MESSAGE_SENDER:进程(CLOCK) 开始 如果rising_edge(CLOCK)那么 如果reset ='1'那么 uart_tx_fifo_data_in'0'); uart_tx_fifo_data_in_stb 使用此ucf约束文件: NET“CLOCK_Y3”LOC = AB13; NET“CLOCK_Y3”TNM_NET =“CLOCK_Y3”; tiMESPEC TS_CLOCK_Y3 = PERIOD“CLOCK_Y3”100000 KHz; NET“USER_RESET”LOC = C1; NET“发送”LOC = F3; U4上## 24 NET“USB_RS232_RXD”LOC = H17; U4ÿ上## 25 NET“USB_RS232_TXD”LOC = B21; 但结果是: ÀøÀøÀøÀøÀøÀøÀøÀøÀøÀøÀøÀøÀøÀøÀøÀ 我使用tera term:波特率:115200,8位数据,奇偶校验无,1个停止位和流量控制:无 我有spartan-6 sp605,我使用xilinx设计套件13.3 你能帮帮我吗? 谢谢伊万 以上来自于谷歌翻译 以下为原文 Hi all, I need to implement an uart module written in vhdl to comunicate with another module, I have tried to use this code (source) with this main: library ieee;use ieee.std_logic_1164.all;use ieee.numeric_std.all;entity MESSAGE_GEN is port ( -- General CLOCK_Y3 : in std_logic; USER_RESET : in std_logic; SEND : in STD_LOGIC; -- UART USB_RS232_RXD : in std_logic; USB_RS232_TXD : out std_logic );end MESSAGE_GEN;architecture RTL of MESSAGE_GEN is -- Functions --Type definition type hello_world_type is array (0 to 4) of integer range 0 to 255; --Hello world type definition signal hello_world : hello_world_type := (10,101,108,108,79); signal state : integer range 0 to 299; -- Component Declarations component UART is generic ( BAUD_RATE : positive; CLOCK_FREQUENCY : positive; TX_FIFO_DEPTH : positive; RX_FIFO_DEPTH : positive ); port ( -- General CLOCK : in std_logic; RESET : in std_logic; TX_FIFO_DATA_IN : in std_logic_vector(7 downto 0); TX_FIFO_DATA_IN_STB : in std_logic; TX_FIFO_DATA_IN_ACK : out std_logic; RX_FIFO_DATA_OUT : out std_logic_vector(7 downto 0); RX_FIFO_DATA_OUT_STB : out std_logic; RX_FIFO_DATA_OUT_ACK : in std_logic; RX : in std_logic; TX : out std_logic ); end component UART; signal CLOCK : std_logic := '0'; signal send1 : std_logic; signal reset_d0, reset : std_logic := '0'; signal uart_rxd_d0 : std_logic := '0'; signal uart_rxd : std_logic := '0'; signal uart_txd_d0 : std_logic := '0'; signal uart_txd : std_logic := '0'; signal uart_tx_fifo_data_in : std_logic_vector (7 downto 0) := (others => '0'); signal uart_tx_fifo_data_in_stb : std_logic := '0'; signal uart_tx_fifo_data_in_ack : std_logic := '0'; signal uart_rx_fifo_data_in : std_logic_vector (7 downto 0) := (others => '0'); signal uart_rx_fifo_data_in_stb : std_logic := '0'; signal uart_rx_fifo_data_in_ack : std_logic := '0'; -- Messages constant MSG_CONFIGURED : string := "FPGA con";begin CLOCK <= CLOCK_Y3; DEGLITCHER : process (CLOCK) begin if rising_edge(CLOCK) then reset_d0 <= USER_RESET; reset <= reset_d0; uart_rxd_d0 <= USB_RS232_RXD; uart_rxd <= uart_rxd_d0; uart_txd_d0 <= uart_txd; USB_RS232_TXD <= uart_txd_d0; end if; end process DEGLITCHER; UART_inst1 : UART generic map ( BAUD_RATE => 115200, CLOCK_FREQUENCY => 100000000, TX_FIFO_DEPTH => 1023, RX_FIFO_DEPTH => 1023 ) port map ( CLOCK => CLOCK, RESET => reset, TX_FIFO_DATA_IN => uart_tx_fifo_data_in, TX_FIFO_DATA_IN_STB => uart_tx_fifo_data_in_stb, TX_FIFO_DATA_IN_ACK => uart_tx_fifo_data_in_ack, RX_FIFO_DATA_OUT => open, RX_FIFO_DATA_OUT_STB => open, RX_FIFO_DATA_OUT_ACK => '0', RX => uart_rxd, TX => uart_txd ); MESSAGE_SENDER : process (CLOCK) begin if rising_edge(CLOCK) then if reset = '1' then uart_tx_fifo_data_in <= (others => '0'); uart_tx_fifo_data_in_stb <= '0'; state<= 0; else if uart_tx_fifo_data_in_ack = '1' then uart_tx_fifo_data_in_stb <= '0'; end if; if (send='1' and send1='0') thenif uart_tx_fifo_data_in_stb = '0' then-- Send new line character and go to next state.uart_tx_fifo_data_in_stb <= '1';uart_tx_fifo_data_in <= std_logic_vector(to_unsigned(hello_world(state),8));state <= state+1;end if; end if; send1 <= send; end if; end if; end process MESSAGE_SENDER;end RTL; with this ucf constrain file: NET "CLOCK_Y3" LOC = AB13;NET "CLOCK_Y3" TNM_NET = "CLOCK_Y3";TIMESPEC TS_CLOCK_Y3 = PERIOD "CLOCK_Y3" 100000 KHz;NET "USER_RESET" LOC = C1;NET "SEND" LOC = F3;## 24 on U4NET "USB_RS232_RXD" LOC = H17;## 25 on U4ÿNET "USB_RS232_TXD" LOC = B21; But the result is: ÀøÀøÀøÀøÀøÀøÀøÀøÀøÀøÀøÀøÀøÀøÀøÀ I use tera term with: Baud rate: 115200, 8 bit data,parity none,1 stop bit and flow control: none I have spartan-6 sp605 and i use xilinx design suite 13.3 Please can you help me? Thanks Ivan |
|
相关推荐
11个回答
|
|
模拟设计时信号会发生什么?
问候, 霍华德 ----------“我们必须学会做的事情,我们从实践中学习。” - 亚里士多德 以上来自于谷歌翻译 以下为原文 What happens with the signals when you simulate the design? Regards, Howard ---------- "That which we must learn to do, we learn by doing." - Aristotle |
|
|
|
我在这里附上模拟的波形。
这是代码: LIBRARY ieee; 使用ieee.std_logic_1164.ALL; ENTITY测试IS 结束测试; 测试IS的体系结构行为 组件消息_GEN 港口( CLOCK_Y3:IN std_logic; USER_RESET:IN std_logic; 发送:IN std_logic; USB_RS232_RXD:IN std_logic; USB_RS232_TXD:OUT std_logic ); 结束组成部分; 信号CLOCK_Y3:std_logic:='0'; 信号USER_RESET:std_logic:='0'; 信号SEND:std_logic:='0'; 信号USB_RS232_RXD:std_logic:='0'; 信号USB_RS232_TXD:std_logic; 常量CLOCK_Y3_period:时间:= 1 ps; 开始 uut:MESSAGE_GEN PORT MAP( CLOCK_Y3 => CLOCK_Y3, USER_RESET => USER_RESET, 发送=>发送, USB_RS232_RXD => USB_RS232_RXD, USB_RS232_TXD => USB_RS232_TXD ); CLOCK_Y3_process:进程 开始 CLOCK_Y3 wave.wcfg 7 KB 以上来自于谷歌翻译 以下为原文 I attach here the waform of the simulation. This is the code: LIBRARY ieee;USE ieee.std_logic_1164.ALL; ENTITY Test ISEND Test; ARCHITECTURE behavior OF Test IS COMPONENT MESSAGE_GEN PORT( CLOCK_Y3 : IN std_logic; USER_RESET : IN std_logic; SEND : IN std_logic; USB_RS232_RXD : IN std_logic; USB_RS232_TXD : OUT std_logic ); END COMPONENT; signal CLOCK_Y3 : std_logic := '0'; signal USER_RESET : std_logic := '0'; signal SEND : std_logic := '0'; signal USB_RS232_RXD : std_logic := '0'; signal USB_RS232_TXD : std_logic; constant CLOCK_Y3_period : time := 1 ps; BEGIN uut: MESSAGE_GEN PORT MAP ( CLOCK_Y3 => CLOCK_Y3, USER_RESET => USER_RESET, SEND => SEND, USB_RS232_RXD => USB_RS232_RXD, USB_RS232_TXD => USB_RS232_TXD ); CLOCK_Y3_process :process beginCLOCK_Y3 <= '0';wait for CLOCK_Y3_period/2;CLOCK_Y3 <= '1';wait for CLOCK_Y3_period/2; end process; stim_proc: process beginUSER_RESET <='1';wait for 1 ns;USER_RESET <='0';wait for 2 ns;SEND <= '1';wait for 2 ns;SEND <= '0'; wait for 100 ns; wait; end process;END; wave.wcfg 7 KB |
|
|
|
我无法打开该文件。
请使用屏幕截图或转换为JPEG格式。 关键是:你认为它运作正常吗? 模拟波形告诉您有关您的设计的信息是什么? ----------“我们必须学会做的事情,我们从实践中学习。” - 亚里士多德 以上来自于谷歌翻译 以下为原文 I can't open that file. Use a screenshot or convert to a JPEG, please. The point is: do YOU think that it is operating correctly? What do the simulation waveforms tell YOU about YOUR design? ---------- "That which we must learn to do, we learn by doing." - Aristotle |
|
|
|
它似乎第一次工作,但在15ns uart tx引脚变为1并且没有改变并且fifo寄存器不加载向量的其他值。
以上来自于谷歌翻译 以下为原文 It seems that the first time it works, but after the 15ns uart tx pin becomes 1 and doesn't change and the fifo register does not load the other values of the vector. |
|
|
|
我很欣赏这只是模拟,但你的时钟周期为1ps。
为什么这么高的频率? 这似乎与您的UART组件的100MHz通用时钟频率不一致。 无论如何,在你的模拟中,我看不到SEND信号振荡以保持你的消息发送者进程滴答作响。 问候, 霍华德 ----------“我们必须学会做的事情,我们从实践中学习。” - 亚里士多德 以上来自于谷歌翻译 以下为原文 I appreciate that this is just simulation but you have a period of 1ps on your clock. Why so high frequency? This seems to be at odds with your generic clock frequency of 100MHz that is fed into your UART component. Anyway, in your simulation, I can't see the SEND signal oscillating to keep your message sender process ticking over. Regards, Howard ---------- "That which we must learn to do, we learn by doing." - Aristotle |
|
|
|
好的,我将模拟时间设置为10ns 50%,结果就是......
我注意到UART_SEND_DATA的fsm被阻塞到“wait_for_tick”并等待一个baud_tick所以我认为这可能是TX_CLOCK_DIVIDER的问题! 你怎么看? 这是Uart_core的代码: 图书馆; 使用ieee.std_logic_1164.all; 使用ieee.numeric_std.all; 实体UART_core是 通用( BAUD_RATE:积极; CLOCK_FREQUENCY:积极的 ); 港口( - 一般 CLOCK100M:在std_logic中; 重置:在std_logic中; DATA_STREAM_IN:在std_logic_vector中(7 downto 0); DATA_STREAM_IN_STB:在std_logic中; DATA_STREAM_IN_ACK:out std_logic:='0'; DATA_STREAM_OUT:输出std_logic_vector(7 downto 0); DATA_STREAM_OUT_STB:out std_logic; DATA_STREAM_OUT_ACK:在std_logic中; TX:out std_logic; RX:在std_logic中 ); 结束UART_core; UART_core的架构RTL是 - 波特率生成 常量c_tx_divider_val:integer:= CLOCK_FREQUENCY / BAUD_RATE; 常量c_rx_divider_val:integer:= CLOCK_FREQUENCY /(BAUD_RATE * 16); signal baud_counter:integer; signal baud_tick:std_logic:='0'; signal oversample_baud_counter:integer; signal oversample_baud_tick:std_logic:='0'; - 发射器信号 type uart_tx_states是(idle,wait_for_tick,send_start_bit,transmit_data,send_stop_bit); signal uart_tx_state:uart_tx_states:= idle; signal uart_tx_data_block:std_logic_vector(7 downto 0):=(其他=>'0'); 信号uart_tx_data&amp;冒号; std_logic:='1'; signal uart_tx_count:integer:= 0; signal uart_rx_data_in_ack:std_logic:='0'; - 接收者信号 type uart_rx_states是(rx_wait_start_synchronise,rx_get_start_bit,rx_get_data,rx_get_stop_bit,rx_send_block); signal uart_rx_state:uart_rx_states:= rx_get_start_bit; signal uart_rx_bit:std_logic:='0'; signal uart_rx_data_block:std_logic_vector(7 downto 0):=(others =>'0'); signal uart_rx_data_vec:std_logic_vector(1 downto 0):=(其他=>'0'); signal uart_rx_filter:unsigned(1 downto 0):=(others =>'0'); signal uart_rx_count:integer:= 0; signal uart_rx_data_out_stb:std_logic:='0'; 信号uart_rx_bit_spacing:unsigned(3 downto 0):=(其他=>'0'); signal uart_rx_bit_tick:std_logic:='0'; 开始 DATA_STREAM_IN_ACK 以上来自于谷歌翻译 以下为原文 Ok, i set the time of simulation at 10ns 50% up, the result is that... I noticed that the fsm of UART_SEND_DATA is blocked into "wait_for_tick" and it wait a baud_tick so I thought it might be the TX_CLOCK_DIVIDER the problem! What do you think? This the code of Uart_core: library ieee;use ieee.std_logic_1164.all;use ieee.numeric_std.all;entity UART_core is Generic ( BAUD_RATE : positive; CLOCK_FREQUENCY : positive ); Port ( -- General CLOCK100M : in std_logic; RESET : in std_logic; DATA_STREAM_IN : in std_logic_vector(7 downto 0); DATA_STREAM_IN_STB : in std_logic; DATA_STREAM_IN_ACK : out std_logic := '0'; DATA_STREAM_OUT : out std_logic_vector(7 downto 0); DATA_STREAM_OUT_STB : out std_logic; DATA_STREAM_OUT_ACK : in std_logic; TX : out std_logic; RX : in std_logic );end UART_core;architecture RTL of UART_core is -- Baud Rate Generation constant c_tx_divider_val : integer := CLOCK_FREQUENCY / BAUD_RATE; constant c_rx_divider_val : integer := CLOCK_FREQUENCY / (BAUD_RATE * 16); signal baud_counter : integer; signal baud_tick : std_logic := '0'; signal oversample_baud_counter : integer; signal oversample_baud_tick : std_logic := '0'; -- Transmitter Signals type uart_tx_states is (idle, wait_for_tick, send_start_bit, transmit_data, send_stop_bit); signal uart_tx_state : uart_tx_states := idle; signal uart_tx_data_block : std_logic_vector(7 downto 0) := (others => '0'); signal uart_tx_data : std_logic := '1'; signal uart_tx_count : integer := 0; signal uart_rx_data_in_ack : std_logic := '0'; -- Receiver Signals type uart_rx_states is (rx_wait_start_synchronise, rx_get_start_bit, rx_get_data, rx_get_stop_bit, rx_send_block); signal uart_rx_state : uart_rx_states := rx_get_start_bit; signal uart_rx_bit : std_logic := '0'; signal uart_rx_data_block : std_logic_vector(7 downto 0) := (others => '0'); signal uart_rx_data_vec : std_logic_vector(1 downto 0) := (others => '0'); signal uart_rx_filter : unsigned(1 downto 0) := (others => '0'); signal uart_rx_count : integer := 0; signal uart_rx_data_out_stb: std_logic := '0'; signal uart_rx_bit_spacing : unsigned (3 downto 0) := (others => '0'); signal uart_rx_bit_tick : std_logic := '0';begin DATA_STREAM_IN_ACK <= uart_rx_data_in_ack; DATA_STREAM_OUT <= uart_rx_data_block; DATA_STREAM_OUT_STB <= uart_rx_data_out_stb; TX <= uart_tx_data; -- The input clock is 100Mhz, this needs to be divided down to the -- rate dictated by the BAUD_RATE. For example, if 115200 baud is selected -- (115200 baud = 115200 bps - 115.2kbps) a tick must be generated once every 1/115200 TX_CLOCK_DIVIDER : process (CLOCK100M) begin if rising_edge (CLOCK100M) then if RESET = '1' then baud_counter <= 0; baud_tick <= '0'; else if baud_counter = c_tx_divider_val then baud_counter <= 0; baud_tick <= '1'; else baud_counter <= baud_counter + 1; baud_tick <= '0'; end if; end if; end if; end process TX_CLOCK_DIVIDER; -- Get data from DATA_STREAM_IN and send it one bit at a time -- upon each BAUD tick. LSB first. -- Wait 1 tick, Send Start Bit (0), Send Data 0-7, Send Stop Bit (1) UART_SEND_DATA : process(CLOCK100M) begin if rising_edge(CLOCK100M) then if RESET = '1' then uart_tx_data <= '1'; uart_tx_data_block <= (others => '0'); uart_tx_count <= 0; uart_tx_state <= idle; uart_rx_data_in_ack <= '0'; else uart_rx_data_in_ack <= '0'; case uart_tx_state is when idle => if DATA_STREAM_IN_STB = '1' then uart_tx_data_block <= DATA_STREAM_IN; uart_rx_data_in_ack <= '1'; uart_tx_state <= wait_for_tick; end if; when wait_for_tick => if baud_tick = '1' then uart_tx_state <= send_start_bit; end if; when send_start_bit => if baud_tick = '1' then uart_tx_data <= '0'; uart_tx_state <= transmit_data; uart_tx_count <= 0; end if; when transmit_data => if baud_tick = '1' then if uart_tx_count < 7 then uart_tx_data <= uart_tx_data_block(uart_tx_count); uart_tx_count <= uart_tx_count + 1; else uart_tx_data <= uart_tx_data_block(7); uart_tx_count <= 0; uart_tx_state <= send_stop_bit; end if; end if; when send_stop_bit => if baud_tick = '1' then uart_tx_data <= '1'; uart_tx_state <= idle; end if; when others => uart_tx_data <= '1'; uart_tx_state <= idle; end case; end if; end if; end process UART_SEND_DATA; -- Generate an oversampled tick (BAUD * 16) OVERSAMPLE_CLOCK_DIVIDER : process (CLOCK100M) begin if rising_edge (CLOCK100M) then if RESET = '1' then oversample_baud_counter <= 0; oversample_baud_tick <= '0'; else if oversample_baud_counter = c_rx_divider_val then oversample_baud_counter <= 0; oversample_baud_tick <= '1'; else oversample_baud_counter <= oversample_baud_counter + 1; oversample_baud_tick <= '0'; end if; end if; end if; end process OVERSAMPLE_CLOCK_DIVIDER; -- Synchronise RXD to the oversampled BAUD RXD_SYNCHRONISE : process(CLOCK100M) begin if rising_edge(CLOCK100M) then if RESET = '1' then uart_rx_data_vec <= (others => '1'); else if oversample_baud_tick = '1' then uart_rx_data_vec(0) <= RX; uart_rx_data_vec(1) <= uart_rx_data_vec(0); end if; end if; end if; end process RXD_SYNCHRONISE; -- Filter RXD with a 2 bit counter. RXD_FILTER : process(CLOCK100M) begin if rising_edge(CLOCK100M) then if RESET = '1' then uart_rx_filter <= (others => '1'); uart_rx_bit <= '1'; else if oversample_baud_tick = '1' then -- Filter RXD. if uart_rx_data_vec(1) = '1' and uart_rx_filter < 3 then uart_rx_filter <= uart_rx_filter + 1; elsif uart_rx_data_vec(1) = '0' and uart_rx_filter > 0 then uart_rx_filter <= uart_rx_filter - 1; end if; -- Set the RX bit. if uart_rx_filter = 3 then uart_rx_bit <= '1'; elsif uart_rx_filter = 0 then uart_rx_bit <= '0'; end if; end if; end if; end if; end process RXD_FILTER; RX_BIT_SPACING : process (CLOCK100M) begin if rising_edge(CLOCK100M) then uart_rx_bit_tick <= '0'; if oversample_baud_tick = '1' then if uart_rx_bit_spacing = 15 then uart_rx_bit_tick <= '1'; uart_rx_bit_spacing <= (others => '0'); else uart_rx_bit_spacing <= uart_rx_bit_spacing + 1; end if; if uart_rx_state = rx_get_start_bit then uart_rx_bit_spacing <= (others => '0'); end if; end if; end if; end process RX_BIT_SPACING; UART_RECEIVE_DATA : process(CLOCK100M) begin if rising_edge(CLOCK100M) then if RESET = '1' then uart_rx_state <= rx_get_start_bit; uart_rx_data_block <= (others => '0'); uart_rx_count <= 0; uart_rx_data_out_stb <= '0'; else case uart_rx_state is when rx_get_start_bit => if oversample_baud_tick = '1' and uart_rx_bit = '0' then uart_rx_state <= rx_get_data; end if; when rx_get_data => if uart_rx_bit_tick = '1' then if uart_rx_count < 7 then uart_rx_data_block(uart_rx_count) <= uart_rx_bit; uart_rx_count <= uart_rx_count + 1; else uart_rx_data_block(7) <= uart_rx_bit; uart_rx_count <= 0; uart_rx_state <= rx_get_stop_bit; end if; end if; when rx_get_stop_bit => if uart_rx_bit_tick = '1' then if uart_rx_bit = '1' then uart_rx_state <= rx_send_block; uart_rx_data_out_stb <= '1'; end if; end if; when rx_send_block => if DATA_STREAM_OUT_ACK = '1' then uart_rx_data_out_stb <= '0'; uart_rx_data_block <= (others => '0'); uart_rx_state <= rx_get_start_bit; else uart_rx_data_out_stb <= '1'; end if; when others => uart_rx_state <= rx_get_start_bit; end case; end if; end if; end process UART_RECEIVE_DATA;end RTL; |
|
|
|
抱歉,
问题不在于fsm。 模拟时间太短了。我附上正确的波形结果...... 以上来自于谷歌翻译 以下为原文 sorry, the problem isn't the fsm. The simulation time was too short.. I attach the right result of waveform... |
|
|
|
如果您无法帮助我使用此代码,您可以在vhdl中为xilinx SP605建议uart型号吗?
谢谢伊万 以上来自于谷歌翻译 以下为原文 if you can not help me with this code can you advise an uart model in vhdl for the xilinx SP605? Thanks Ivan |
|
|
|
时钟分频器根据时钟频率和所需的波特率使用常数。
您已将此定义为整数,但我不确定如果时钟/波特不是整数(100,000,000 / 115,200不是),则常量会发生什么。 你可能最好找到足够接近两个整数定义的波特率 - 比如100,000,000 / 868 = 115,207.37。 这可能是所需速率的足够接近的百分比 - 所有UART必须具有一定的余量。 遗憾的是,我没有足够的时间来查看整个代码并弄清楚可能出现的问题 - 这就是为什么你应该模拟以便你可以调试 - 而不是我。 否则,我确信使用您最喜欢的搜索引擎可以在VHDL中找到一些可用的UART示例。 我假设您不希望使用(或没有许可证)嵌入式系统和Xilinx UART IP。 问候, 霍华德 ----------“我们必须学会做的事情,我们从实践中学习。” - 亚里士多德 以上来自于谷歌翻译 以下为原文 Your clock divider uses a constant based on the clock frequency and the desired baud rate. You have defined this as an integer but I am not sure what will happen with the constant if clock/baud is not an integer (which 100,000,000 / 115,200 is not). You may be better off finding a baud rate close enough that is defined by two integers - say 100,000,000 / 868 = 115,207.37. This may be a close enough percentage of the desired rate - all UARTs must have some margin. Sadly, I don't really have the time to sit through the whole code and figure out what might be going wrong - this is why you should simulate so that you can debug - not me. Otherwise, I am sure that using your favourite search engine can locate some usable examples of a UART in VHDL. I am assuming that you do not wish to use (or do not have the licenses for) an embedded system and the Xilinx UART IP. Regards, Howard ---------- "That which we must learn to do, we learn by doing." - Aristotle |
|
|
|
我发现问题是时钟。
我使用AB13引脚,我在“硬件指南”的第28页看到,这是一个X2 27MHz OSC所以我在代码中设置:CLOCK_FREQUENCY:positive:= 27000000; 现在它正在工作!!!我不知道如何使用U6 200MHZ OSC来设置100Mhz ...如果你有一些建议,欢迎你... :-) 非常感谢你的帮助!!! 以上来自于谷歌翻译 以下为原文 I found that the problem is the clock. I use AB13 pin and I have seen at page 28 of "Hardware guide" that this one is a X2 27MHz OSC so I set in the code: CLOCK_FREQUENCY:positive := 27000000; and now it'is working!!! I don't know how to use the U6 200MHZ OSC in order to set 100Mhz... if you have some suggestions you are welcome... :-) Thanks a lot for your help!!! |
|
|
|
您可以使用DCM。
或者您可以将200MHz时钟除以2以生成时钟使能,并通过使能从主200MHz时钟运行所有进程。 不过,我赞成DCM。 问候, 霍华德 ----------“我们必须学会做的事情,我们从实践中学习。” - 亚里士多德 以上来自于谷歌翻译 以下为原文 You could use a DCM. Or you could divide the 200MHz clock by 2 to generate a clock enable and run all the processes from the main 200MHz clock with the enable. I would favour the DCM, though. Regards, Howard ---------- "That which we must learn to do, we learn by doing." - Aristotle |
|
|
|
只有小组成员才能发言,加入小组>>
2416 浏览 7 评论
2821 浏览 4 评论
Spartan 3-AN时钟和VHDL让ISE合成时出现错误该怎么办?
2292 浏览 9 评论
3372 浏览 0 评论
如何在RTL或xilinx spartan fpga的约束文件中插入1.56ns延迟缓冲区?
2459 浏览 15 评论
有输入,但是LVDS_25的FPGA内部接收不到数据,为什么?
1153浏览 1评论
请问vc707的电源线是如何连接的,我这边可能出现了缺失元件的情况导致无法供电
583浏览 1评论
求一块XILINX开发板KC705,VC707,KC105和KCU1500
449浏览 1评论
2004浏览 0评论
728浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-22 23:17 , Processed in 1.369759 second(s), Total 67, Slave 60 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号