資料介紹
描述
介紹
前段時(shí)間,我在尋找一種易于理解的 VHDL UART 設(shè)計(jì),但令人驚訝的是我找不到。也許我搜索得不夠好,但無論如何,我認(rèn)為這將是我的技術(shù)愛好博客的一個(gè)很好的起點(diǎn)。所以,這是我的第一個(gè)項(xiàng)目,請歡迎使用 Basys 3 板的 VHDL UART 接口。
這種設(shè)計(jì)允許將位從電路板傳輸?shù)接?jì)算機(jī)終端,并從終端接收位到電路板。您可以通過按下板上的按鈕將數(shù)據(jù)從板傳輸?shù)浇K端。可以使用用戶開關(guān)設(shè)置發(fā)送位,并且可以在用戶 LED 上檢查接收位。
UART接口總結(jié)
如果您是 UART 的完全初學(xué)者,我建議您在此處查看此 wiki 頁面。
由于 UART 接口是串行接口,因此發(fā)送器會逐位發(fā)送數(shù)據(jù)。同時(shí),接收器必須捕獲每個(gè)位并將其轉(zhuǎn)換為并行數(shù)據(jù)。該標(biāo)準(zhǔn)的另一個(gè)重要特征是波特率,它定義了 UART 每秒可以傳輸多少位。該接口允許許多不同的波特率,但在這個(gè)項(xiàng)目中我使用 115200 波特。
讓我們看看這個(gè)項(xiàng)目中使用的時(shí)間框架:
![poYBAGN6W8GAdQauAAA_xRoJfFM383.png](https://file.elecfans.com/web2/M00/7C/89/poYBAGN6W8GAdQauAAA_xRoJfFM383.png)
我使用了最簡單的 UART 版本,如下所述:
- 起始位 ('0')
- 8 個(gè)數(shù)據(jù)位
- 無奇偶校驗(yàn)位
- 一位停止位 ('1')
項(xiàng)目文件
這是 Vivado 中的項(xiàng)目樹:
![pYYBAGN6W8OAU4ngAAC3z4zzsWc392.png](https://file.elecfans.com/web2/M00/7D/16/pYYBAGN6W8OAU4ngAAC3z4zzsWc392.png)
-
UART_controller.vhd
- 將設(shè)計(jì)與外界聯(lián)系起來的頂級文件 -
button_debounce.vhd
- 將發(fā)射按鈕連接到項(xiàng)目的其余部分,并防止每次按下多次啟動 -
UART.vhd
- 將 tx 和 rx 文件組合在一起 -
UART_tx.vhd
- 包含所有發(fā)送器邏輯 -
UART_rx.vhd
- 包含所有接收器邏輯 -
constrains.xdc
- 包含引腳連接和主時(shí)鐘頻率 -
UART_controller_tb.vhd
- 這是設(shè)計(jì)的測試平臺
項(xiàng)目的主要部分位于UART_tx.vhd
和UART_rx.vhd
文件中。這些文件及其邏輯將在下一節(jié)中詳細(xì)討論。
如果您更喜歡先構(gòu)建一個(gè)項(xiàng)目并對芯片進(jìn)行編程,您可以跳到創(chuàng)建項(xiàng)目部分并在閱讀其余的理論部分之前先玩一下電路板。
發(fā)射機(jī)
是UART_tx.vhd
一個(gè)傳輸模塊。這是框圖:
![poYBAGN6W8eAINNoAADHsxRpjeQ547.png](https://file.elecfans.com/web2/M00/7C/89/poYBAGN6W8eAINNoAADHsxRpjeQ547.png)
每個(gè)藍(lán)色塊代表UART_tx.vhd
文件中的一個(gè)進(jìn)程。
baud_rate_clk_generator通過在計(jì)數(shù)器計(jì)數(shù)主時(shí)鐘的滴答時(shí)設(shè)置信號來生成 UART 波特率時(shí)鐘。該常數(shù)反映了主時(shí)鐘與波特率之間的比率。baud_rate_clk
BAUD_CLK_TICKS
BAUD_CLK_TICKS
tx_start_detector在主時(shí)鐘頻率上工作并捕捉tx_start
信號中的短脈沖(一個(gè)時(shí)鐘周期長)并將其保留在UART_tx_FSM
. tx_start_detector
需要,因?yàn)?/font>UART_tx_FSM
工作在波特率頻率上,但button_debounce
模塊每按一下按鈕就會產(chǎn)生一個(gè)主時(shí)鐘周期長脈沖。start_detected
保留發(fā)生此類事件的信息。的第二個(gè)目的tx_start_detector
是保護(hù)傳輸數(shù)據(jù)。stored_data
保持傳輸過程中保存的傳輸數(shù)據(jù)。
data_index_counter是一個(gè)從 0 到 7 的簡單計(jì)數(shù)器,用于處理波特率頻率。它用于執(zhí)行并行數(shù)據(jù)(stored_data
)和串行輸出(tx_data_out
)之間的轉(zhuǎn)換。該data_index
信號用于UART_tx_FSM
遍歷stored_data
向量并一一發(fā)送比特。
UART_tx_FSM代表一個(gè)有限狀態(tài)機(jī),它有四種狀態(tài)(IDLE、START、DATA、STOP)。這是UART_tx_FSM
塊的狀態(tài)圖:
![pYYBAGN6W8qAWZ_AAAFNs_vFE2w282.png](https://file.elecfans.com/web2/M00/7D/16/pYYBAGN6W8qAWZ_AAAFNs_vFE2w282.png)
文件代碼UART_tx.vhd
:
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity UART_tx is
generic(
BAUD_CLK_TICKS: integer := 868); -- clk/baud_rate (100 000 000 / 115 200 = 868.0555)
port(
clk : in std_logic;
reset : in std_logic;
tx_start : in std_logic;
tx_data_in : in std_logic_vector (7 downto 0);
tx_data_out : out std_logic
);
end UART_tx;
architecture Behavioral of UART_tx is
type tx_states_t is (IDLE, START, DATA, STOP);
signal tx_state : tx_states_t := IDLE;
signal baud_rate_clk : std_logic:= '0';
signal data_index : integer range 0 to 7 := 0;
signal data_index_reset : std_logic := '1';
signal stored_data : std_logic_vector(7 downto 0) := (others=>'0');
signal start_detected : std_logic := '0';
signal start_reset : std_logic := '0';
begin
-- The baud_rate_clk_generator process generates the UART baud rate clock by
-- setting the baud_rate_clk signal when the counter counts BAUD_CLK_TICKS
-- ticks of the master clk. The BAUD_CLK_TICKS constant is specified in
-- the package and reflects the ratio between the master clk and the baud rate.
baud_rate_clk_generator: process(clk)
variable baud_count: integer range 0 to (BAUD_CLK_TICKS - 1) := (BAUD_CLK_TICKS - 1);
begin
if rising_edge(clk) then
if (reset = '1') then
baud_rate_clk <= '0';
baud_count := (BAUD_CLK_TICKS - 1);
else
if (baud_count = 0) then
baud_rate_clk <= '1';
baud_count := (BAUD_CLK_TICKS - 1);
else
baud_rate_clk <= '0';
baud_count := baud_count - 1;
end if;
end if;
end if;
end process baud_rate_clk_generator;
-- The tx_start_detector process works on the master clk frequency and catches
-- short (one clk cycle long) impulses in the tx_start signal and keeps it for
-- the UART_tx_FSM. tx_start_detector is needed because the UART_tx_FSM works on
-- the baud rate frequency, but the button_debounce module generates one master clk
-- cycle long impulse per one button push. start_detected keeps the information that
-- such event has occurred.
-- The second purpose of tx_start_detector is to secure the transmitting data.
-- stored_data keeps the transmitting data saved during the transmission.
tx_start_detector: process(clk)
begin
if rising_edge(clk) then
if (reset ='1') or (start_reset = '1') then
start_detected <= '0';
else
if (tx_start = '1') and (start_detected = '0') then
start_detected <= '1';
stored_data <= tx_data_in;
end if;
end if;
end if;
end process tx_start_detector;
-- The data_index_counter process is a simple counter from 0 to 7 working on the baud
-- rate frequency. It is used to perform transformation between the parallel
-- data (stored_data) and the serial output (tx_data_out).
-- The data_index signal is used in UART_tx_FSM to go over the stored_data vector
-- and send the bits one by one.
data_index_counter: process(clk)
begin
if rising_edge(clk) then
if (reset = '1') or (data_index_reset = '1') then
data_index <= 0;
elsif (baud_rate_clk = '1') then
data_index <= data_index + 1;
end if;
end if;
end process data_index_counter;
-- The UART_FSM_tx process represents a Finite State Machine which has
-- four states (IDLE, START, DATA, STOP). See inline comments for more details.
UART_tx_FSM: process(clk)
begin
if rising_edge(clk) then
if (reset = '1') then
tx_state <= IDLE;
data_index_reset <= '1'; -- keep data_index_counter on hold
start_reset <= '1'; -- keep tx_start_detector on hold
tx_data_out <= '1'; -- keep tx line set along the standard
else
if (baud_rate_clk = '1') then -- the FSM works on the baud rate frequency
case tx_state is
when IDLE =>
data_index_reset <= '1'; -- keep data_index_counter on hold
start_reset <= '0'; -- enable tx_start_detector to wait for starting impulses
tx_data_out <= '1'; -- keep tx line set along the standard
if (start_detected = '1') then
tx_state <= START;
end if;
when START =>
data_index_reset <= '0'; -- enable data_index_counter for DATA state
tx_data_out <= '0'; -- send '0' as a start bit
tx_state <= DATA;
when DATA =>
tx_data_out <= stored_data(data_index); -- send one bit per one baud clock cycle 8 times
if (data_index = 7) then
data_index_reset <= '1'; -- disable data_index_counter when it has reached 8
tx_state <= STOP;
end if;
when STOP =>
tx_data_out <= '1'; -- send '1' as a stop bit
start_reset <= '1'; -- prepare tx_start_detector to be ready detecting the next impuls in IDLE
tx_state <= IDLE;
when others =>
tx_state <= IDLE;
end case;
end if;
end if;
end if;
end process UART_tx_FSM;
end Behavioral;
接收者
是UART_rx.vhd
接收模塊。這是框圖:
![pYYBAGN6W8yAKiwwAACaFmiazkU946.png](https://file.elecfans.com/web2/M00/7D/16/pYYBAGN6W8yAKiwwAACaFmiazkU946.png)
與這里相反UART_tx
,我在 FSM 中內(nèi)置了計(jì)數(shù)器(通過過程中的變量,參見代碼)。我這樣做只是為了演示在創(chuàng)建帶有計(jì)數(shù)器的 FSM 時(shí)的不同方法。第一種方式(tx)在硬件上更快,但第二種方式更容易在 VHDL 中實(shí)現(xiàn)。
baud_rate_x16_clk_generator生成一個(gè)過采樣時(shí)鐘。該baud_rate_x16_clk
信號比波特率時(shí)鐘快 16 倍。需要進(jìn)行過采樣以將捕獲點(diǎn)置于接收位持續(xù)時(shí)間的中間。該BAUD_X16_CLK_TICKS
常數(shù)反映了主時(shí)鐘與 x16 波特率之間的比率。
UART_rx_FSM代表一個(gè)有限狀態(tài)機(jī),它有四種狀態(tài)(IDLE、START、DATA、STOP)。這是UART_rx_FSM
塊的狀態(tài)圖:
![poYBAGN6W8-AR8EVAAHXyWhvWBQ926.png](https://file.elecfans.com/web2/M00/7C/89/poYBAGN6W8-AR8EVAAHXyWhvWBQ926.png)
位持續(xù)時(shí)間計(jì)數(shù)器工作baud_rate_x16_clk
這是UART_rx.vhd
文件的代碼:
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity UART_rx is
generic(
BAUD_X16_CLK_TICKS: integer := 54); -- (clk / baud_rate) / 16 => (100 000 000 / 115 200) / 16 = 54.25
port(
clk : in std_logic;
reset : in std_logic;
rx_data_in : in std_logic;
rx_data_out : out std_logic_vector (7 downto 0)
);
end UART_rx;
architecture Behavioral of UART_rx is
type rx_states_t is (IDLE, START, DATA, STOP);
signal rx_state: rx_states_t := IDLE;
signal baud_rate_x16_clk : std_logic := '0';
signal rx_stored_data : std_logic_vector(7 downto 0) := (others => '0');
begin
-- The baud_rate_x16_clk_generator process generates an oversampled clock.
-- The baud_rate_x16_clk signal is 16 times faster than the baud rate clock.
-- Oversampling is needed to put the capture point at the middle of duration of
-- the receiving bit.
-- The BAUD_X16_CLK_TICKS constant reflects the ratio between the master clk
-- and the x16 baud rate.
baud_rate_x16_clk_generator: process(clk)
variable baud_x16_count: integer range 0 to (BAUD_X16_CLK_TICKS - 1) := (BAUD_X16_CLK_TICKS - 1);
begin
if rising_edge(clk) then
if (reset = '1') then
baud_rate_x16_clk <= '0';
baud_x16_count := (BAUD_X16_CLK_TICKS - 1);
else
if (baud_x16_count = 0) then
baud_rate_x16_clk <= '1';
baud_x16_count := (BAUD_X16_CLK_TICKS - 1);
else
baud_rate_x16_clk <= '0';
baud_x16_count := baud_x16_count - 1;
end if;
end if;
end if;
end process baud_rate_x16_clk_generator;
-- The UART_rx_FSM process represents a Finite State Machine which has
-- four states (IDLE, START, DATA, STOP). See inline comments for more details.
UART_rx_FSM: process(clk)
variable bit_duration_count : integer range 0 to 15 := 0;
variable bit_count : integer range 0 to 7 := 0;
begin
if rising_edge(clk) then
if (reset = '1') then
rx_state <= IDLE;
rx_stored_data <= (others => '0');
rx_data_out <= (others => '0');
bit_duration_count := 0;
bit_count := 0;
else
if (baud_rate_x16_clk = '1') then -- the FSM works 16 times faster the baud rate frequency
case rx_state is
when IDLE =>
rx_stored_data <= (others => '0'); -- clean the received data register
bit_duration_count := 0; -- reset counters
bit_count := 0;
if (rx_data_in = '0') then -- if the start bit received
rx_state <= START; -- transit to the START state
end if;
when START =>
if (rx_data_in = '0') then -- verify that the start bit is preset
if (bit_duration_count = 7) then -- wait a half of the baud rate cycle
rx_state <= DATA; -- (it puts the capture point at the middle of duration of the receiving bit)
bit_duration_count := 0;
else
bit_duration_count := bit_duration_count + 1;
end if;
else
rx_state <= IDLE; -- the start bit is not preset (false alarm)
end if;
when DATA =>
if (bit_duration_count = 15) then -- wait for "one" baud rate cycle (not strictly one, about one)
rx_stored_data(bit_count) <= rx_data_in; -- fill in the receiving register one received bit.
bit_duration_count := 0;
if (bit_count = 7) then -- when all 8 bit received, go to the STOP state
rx_state <= STOP;
bit_duration_count := 0;
else
bit_count := bit_count + 1;
end if;
else
bit_duration_count := bit_duration_count + 1;
end if;
when STOP =>
if (bit_duration_count = 15) then -- wait for "one" baud rate cycle
rx_data_out <= rx_stored_data; -- transer the received data to the outside world
rx_state <= IDLE;
else
bit_duration_count := bit_duration_count + 1;
end if;
when others =>
rx_state <= IDLE;
end case;
end if;
end if;
end if;
end process UART_rx_FSM;
end Behavioral;
按鈕控制器
為了從 Basys 3 板向計(jì)算機(jī)終端發(fā)送一個(gè)位,我們需要設(shè)置板開關(guān)并按下按鈕。此時(shí)我們需要確保發(fā)送位。為此,button_debounce.vhd
文件來了。
這是模塊的框圖:
![pYYBAGN6W9GAM4BbAADCVsrNJNk050.png](https://file.elecfans.com/web2/M00/7D/16/pYYBAGN6W9GAM4BbAADCVsrNJNk050.png)
如果輸入發(fā)生變化,則flipflop_1
和flipflop_2
信號會有所不同。button_in
差異觸發(fā)pause_counter
將button_in
信號從觸發(fā)器 2 傳遞到觸發(fā)器 3,但在COUNTER_SIZE
主時(shí)鐘周期之后。這允許button_in
信號在通過之前穩(wěn)定在某個(gè)狀態(tài)。
和信號flipflop_3
有flipflop_4
一個(gè)主時(shí)鐘周期延遲。需要延遲來在button_out
輸出端創(chuàng)建一個(gè)短(一個(gè)主時(shí)鐘周期長)脈沖。完成pause_counter
后,flipflop_3
信號獲取button_in
信息。那一刻flipflop_4
還沒有改變。這會在button_out
一個(gè)主時(shí)鐘周期的輸出上創(chuàng)建“1”,僅當(dāng)flipflop_3
為“1”時(shí)(按鈕已被按下,未釋放)。
這是模塊的代碼:
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity button_debounce is
generic (
COUNTER_SIZE : integer := 10_000
);
port ( clk : in std_logic;
reset : in std_logic;
button_in : in std_logic;
button_out : out std_logic);
end button_debounce;
architecture Behavioral of button_debounce is
signal flipflop_1 : std_logic := '0'; -- output of flip-flop 1
signal flipflop_2 : std_logic := '0'; -- output of flip-flop 2
signal flipflop_3 : std_logic := '0'; -- output of flip-flop 3
signal flipflop_4 : std_logic := '0'; -- output of flip-flop 4
signal count_start : std_logic := '0';
begin
-- The input_flipflops process creates two serial flip-flops (flip-flop 1 and
-- flip-flop 2). The signal from button_in passes them one by one. If flip_flop_1
-- and flip_flop_2 are different, it means the button has been activated, and
-- count_start becomes '1' for one master clock cycle.
input_flipflops: process(clk)
begin
if rising_edge(clk) then
if (reset = '1') then
flipflop_1 <= '0';
flipflop_2 <= '0';
else
flipflop_1 <= button_in;
flipflop_2 <= flipflop_1;
end if;
end if;
end process input_flipflops;
-- The count_start signal triggers the pause_counter process to start counting
count_start <= flipflop_1 xor flipflop_2;
-- The pause_counter process passes the button_in signal farther from flip-flop 2
-- to flip-flop 3, but after COUNTER_SIZE master clock cycles. This allows
-- the button_in signal to stabilize in a certain state before being passed to the output.
pause_counter: process(clk)
variable count: integer range 0 to COUNTER_SIZE := 0;
begin
if rising_edge(clk) then
if (reset = '1') then
count := 0;
flipflop_3 <= '0';
else
if (count_start = '1') then
count := 0;
elsif (count < COUNTER_SIZE) then
count := count + 1;
else
flipflop_3 <= flipflop_2;
end if;
end if;
end if;
end process pause_counter;
-- the purpose of the output_flipflop process is creating another flip-flop (flip-flop 4),
-- which creates a delay between the flipflop_3 and flipflop_4 signals. The delay is
-- one master clock cycle long.
output_flipflop: process(clk)
begin
if rising_edge(clk) then
if (reset = '1') then
flipflop_4 <= '0';
else
flipflop_4 <= flipflop_3;
end if;
end if;
end process output_flipflop;
-- The delay is needed to create one short (one master clock cycle long) impuls
-- at the button_out output. When pause_counter has finished, the flipflop_3 signal gets
-- the button_in information. At the moment flipflop_4 hasn't changed yet.
-- This creates '1' at the button_out output for one master clock cycle, only if
-- flipflop_3 is '1' (The button has been pressed, not released).
with flipflop_3 select
button_out <= flipflop_3 xor flipflop_4 when '1',
'0' when others;
end Behavioral;
?
創(chuàng)建項(xiàng)目
在開始之前,請確保您在 Vivado 文件夾中有電路板文件。為此,請遵循本指南。
另外,如果你想逐步創(chuàng)建項(xiàng)目,你需要從代碼部分下載8個(gè)項(xiàng)目文件。
如果您不想逐步創(chuàng)建項(xiàng)目,可以從 GitHub 存儲庫(代碼部分)下載已完成的項(xiàng)目并跳轉(zhuǎn)到設(shè)計(jì)仿真部分。
逐步創(chuàng)建項(xiàng)目:
第 1 步- 打開 Vivado 并單擊“創(chuàng)建項(xiàng)目”
![poYBAGN6W9eAHa5yAACgNdb3kGY144.png](https://file.elecfans.com/web2/M00/7C/89/poYBAGN6W9eAHa5yAACgNdb3kGY144.png)
![poYBAGN6W9mAfihsAACTtpzAEyU694.png](https://file.elecfans.com/web2/M00/7C/89/poYBAGN6W9mAfihsAACTtpzAEyU694.png)
第 2 步- 為項(xiàng)目命名
![pYYBAGN6W9yAJL8GAACVmxtrf08062.png](https://file.elecfans.com/web2/M00/7D/16/pYYBAGN6W9yAJL8GAACVmxtrf08062.png)
第 3 步- 選擇“RTL 項(xiàng)目”并留下勾號,稍后我們將添加文件
![pYYBAGN6W96AFXEjAAC_oBLsgac561.png](https://file.elecfans.com/web2/M00/7D/16/pYYBAGN6W96AFXEjAAC_oBLsgac561.png)
第 4 步- 選擇電路板
![poYBAGN6W-KAOIQGAAC_P56hCcU126.png](https://file.elecfans.com/web2/M00/7C/89/poYBAGN6W-KAOIQGAAC_P56hCcU126.png)
點(diǎn)擊完成
![poYBAGN6W-WAVnuRAACXdbgzdxA659.png](https://file.elecfans.com/web2/M00/7C/89/poYBAGN6W-WAVnuRAACXdbgzdxA659.png)
您將看到空項(xiàng)目。
第 5 步- 單擊“+”添加源文件
![poYBAGN6W-uAI7MwAAEGpSTEekc878.png](https://file.elecfans.com/web2/M00/7C/89/poYBAGN6W-uAI7MwAAEGpSTEekc878.png)
選擇“添加或創(chuàng)建設(shè)計(jì)源”
![pYYBAGN6W-2AW4L8AAB1AwPnh9M979.png](https://file.elecfans.com/web2/M00/7D/16/pYYBAGN6W-2AW4L8AAB1AwPnh9M979.png)
點(diǎn)擊“添加文件”
![pYYBAGN6W_KAa0aYAACbG147tdU227.png](https://file.elecfans.com/web2/M00/7D/16/pYYBAGN6W_KAa0aYAACbG147tdU227.png)
如圖選擇5個(gè)文件
![poYBAGN6W_SAd0RHAAERIHioiWw115.png](https://file.elecfans.com/web2/M00/7C/89/poYBAGN6W_SAd0RHAAERIHioiWw115.png)
點(diǎn)擊“完成”
![poYBAGN6W_eAGDlbAAD8i9KAC9M249.png](https://file.elecfans.com/web2/M00/7C/89/poYBAGN6W_eAGDlbAAD8i9KAC9M249.png)
第 6 步- 使用“添加或創(chuàng)建約束”和constraints.xdc
文件重復(fù)第 5 步。
第 7 步- 使用“添加或創(chuàng)建模擬源”UART_controller_tb.vhd
和UART_controller_tb_behav.wcfg
文件重復(fù)第 5 步。
你已經(jīng)完成了這些步驟,你應(yīng)該看到這個(gè):
![pYYBAGN6W8OAU4ngAAC3z4zzsWc392.png](https://file.elecfans.com/web2/M00/7D/16/pYYBAGN6W8OAU4ngAAC3z4zzsWc392.png)
設(shè)計(jì)模擬
為了開始模擬,您需要走這條路:
Flow Navigator => SIMULATION => 運(yùn)行模擬 => 運(yùn)行行為模擬
在模擬窗口中,您需要如圖所示設(shè)置模擬時(shí)間,然后單擊帶有(T)子符號的“運(yùn)行”按鈕。
![poYBAGN6W_uAbnaIAAAlEIyXNEA620.png](https://file.elecfans.com/web2/M00/7C/89/poYBAGN6W_uAbnaIAAAlEIyXNEA620.png)
您應(yīng)該能夠看到如下圖所示的模擬結(jié)果。您可以使用設(shè)置并選擇其他信號以更好地了解設(shè)計(jì)。
![poYBAGN6XAGALDVGAAZu2zg8v4M835.png](https://file.elecfans.com/web2/M00/7C/89/poYBAGN6XAGALDVGAAZu2zg8v4M835.png)
綜合、實(shí)現(xiàn)、比特流
完成模擬后,您可能需要構(gòu)建項(xiàng)目。為此,您需要遵循以下路徑:
Flow Navigator => SYNTHESIS => 運(yùn)行綜合
您將看到此窗口,單擊“確定”。
![poYBAGN6XAiAMQuUAABPc4CfwjQ351.png](https://file.elecfans.com/web2/M00/7C/89/poYBAGN6XAiAMQuUAABPc4CfwjQ351.png)
綜合完成后,您可以直接從此窗口開始實(shí)施:
![poYBAGN6XEOASXKJAAA7XH4RhgY213.png](https://file.elecfans.com/web2/M00/7C/89/poYBAGN6XEOASXKJAAA7XH4RhgY213.png)
生成比特流的方式相同:
![pYYBAGN6XEmAHcO5AAA-IH6X9Ak041.png](https://file.elecfans.com/web2/M00/7D/17/pYYBAGN6XEmAHcO5AAA-IH6X9Ak041.png)
當(dāng)比特流準(zhǔn)備好后,您需要通過 USB 電纜將 Basys3 開發(fā)板連接到我們的計(jì)算機(jī)并打開開發(fā)板。之后,您需要打開硬件管理器:
![poYBAGN6XEuATE8gAABKEYitL9w705.png](https://file.elecfans.com/web2/M00/7C/89/poYBAGN6XEuATE8gAABKEYitL9w705.png)
單擊“打開目標(biāo)”并選擇“自動連接”。
![poYBAGN6XE6AcYJfAABJEhGeo6c549.png](https://file.elecfans.com/web2/M00/7C/89/poYBAGN6XE6AcYJfAABJEhGeo6c549.png)
右鍵單擊零件編號并選擇“編程設(shè)備”。
![pYYBAGN6XFWAP3koAAEt5en1X9k471.png](https://file.elecfans.com/web2/M00/7D/17/pYYBAGN6XFWAP3koAAEt5en1X9k471.png)
您將看到下面的窗口,只需單擊“程序”。
![poYBAGN6XFiACW4IAABxSZ7gJQE651.png](https://file.elecfans.com/web2/M00/7C/89/poYBAGN6XFiACW4IAABxSZ7gJQE651.png)
必須對芯片進(jìn)行編程。最后一步是設(shè)置計(jì)算機(jī)終端。
Tera 術(shù)語設(shè)置
打開 Tera Term 并選擇“Serial”(在我的例子中是 COM4,但它可以是任何端口號)并單擊 OK。
![pYYBAGN6XFuAG1GuAACznQwBy44052.png](https://file.elecfans.com/web2/M00/7D/17/pYYBAGN6XFuAG1GuAACznQwBy44052.png)
轉(zhuǎn)到設(shè)置 => 串行端口...您將看到此窗口,如圖所示設(shè)置
![pYYBAGN6XF2ANFX3AACid8ND4gQ725.png](https://file.elecfans.com/web2/M00/7D/17/pYYBAGN6XF2ANFX3AACid8ND4gQ725.png)
轉(zhuǎn)到 Setup => Terminal... 并勾選“Local echo”,它可以讓您查看您正在輸入的內(nèi)容。
![poYBAGN6XGCACTuPAADgPk7TF14564.png](https://file.elecfans.com/web2/M00/7C/89/poYBAGN6XGCACTuPAADgPk7TF14564.png)
完畢!
怎么玩
為了查看您在鍵盤上按下的鍵的二進(jìn)制表示,您需要檢查板上的前 8 個(gè) LED。
要將字節(jié)發(fā)送到終端,您需要使用前 8 個(gè)開關(guān)設(shè)置字節(jié)并按下中央按鈕 (U18)。您將看到您在板上設(shè)置的字節(jié)的 ASCII 表示。
要重置設(shè)計(jì),您需要按下頂部按鈕 (T18)。
結(jié)論
這個(gè)項(xiàng)目遠(yuǎn)不是一個(gè)完成的專業(yè)項(xiàng)目,因?yàn)樗鼪]有很多重要的組件,例如:檢查停止位、奇偶校驗(yàn)位、元穩(wěn)定性防止、引腳緩沖區(qū)等。我想專注于主要設(shè)計(jì):發(fā)送器和接收器的邏輯。
我希望這個(gè)項(xiàng)目是有幫助和有用的。
- verilog設(shè)計(jì)之基于basys3實(shí)現(xiàn)的簡易分秒數(shù)字鐘 0次下載
- 基于FPGA的波特率連續(xù)可調(diào)UART接口 10次下載
- Basys 3 Power Tree
- Basys 3 FPGA開發(fā)板的數(shù)據(jù)手冊免費(fèi)下載 31次下載
- BASYS 3開發(fā)板的電路原理圖免費(fèi)下載 28次下載
- BASYS 3 FPGA板參考手冊資料免費(fèi)下載 8次下載
- 基于Vivado 的Basys3開發(fā)板的解碼教程 66次下載
- Digilent公司basys2開發(fā)板的全套開發(fā)例程 256次下載
- Xilinx 公司BASYs開發(fā)板自帶的Demo程序 11次下載
- Xilinx 的Basys板VGA顯示圖片原碼 45次下載
- 通用異步串行接口的VHDL實(shí)用化設(shè)計(jì)
- 通用異步串行接口的VHDL實(shí)用化設(shè)計(jì)
- UART參考設(shè)計(jì),帶16byte緩沖 VHDL代碼 xapp
- UART 4 UART參考設(shè)計(jì),Xilinx提供VHDL代碼
- 介紹Xilinx CPLD中配置UART的VHDL和Veri
- 嵌入式系統(tǒng)串口UART接口為啥沒有數(shù)據(jù)輸出 1004次閱讀
- 如何配置MAX78615+LMU用于UART通信 957次閱讀
- 如何使用Basys3板創(chuàng)建一個(gè)簡單的示波器 8181次閱讀
- 微雪電子AIO-3128C主板UART使用介紹 2198次閱讀
- AIO-3288C開發(fā)板UART串口簡介 1535次閱讀
- Firefly-RK3128開發(fā)板UART接口介紹 3401次閱讀
- digilentUSB轉(zhuǎn)UART接口介紹 2322次閱讀
- Firefly-RK3288開發(fā)板介紹 3014次閱讀
- digilent Artix-7 FPGA訓(xùn)練板介紹 2256次閱讀
- Firefly關(guān)于UART接口使用介紹 2912次閱讀
- digilent Spartan-3E FPGA訓(xùn)練板介紹 2935次閱讀
- 實(shí)現(xiàn)了接口功能和性能驗(yàn)證自動化的UART&SPI接口驗(yàn)證工具設(shè)計(jì) 3379次閱讀
- 電視uart接口干什么的 1.2w次閱讀
- vhdl數(shù)碼管中的倒計(jì)時(shí)程序介紹 8448次閱讀
- uart接口介紹和認(rèn)識 2.3w次閱讀
下載排行
本周
- 1IP6823 支持 qi 認(rèn)證的無線充電發(fā)射控制 SOC
- 1.01 MB | 1次下載 | 免費(fèi)
- 2IP6824? 全集成QI?無線充電發(fā)射控制SOC
- 1.22 MB | 1次下載 | 免費(fèi)
- 3PESD18VY1BBIF保護(hù)二極管規(guī)格書
- 4.56MB | 次下載 | 免費(fèi)
- 474HC4050緩沖器規(guī)格書
- 217.58KB | 次下載 | 免費(fèi)
- 574HC193;74HC7193二進(jìn)制加減計(jì)數(shù)器規(guī)格書
- 327.93KB | 次下載 | 免費(fèi)
- 674HC73-Q100雙JK觸發(fā)器規(guī)格書
- 220.85KB | 次下載 | 免費(fèi)
- 7ASW3410 USB3.1高速數(shù)據(jù)開關(guān)切換規(guī)格書
- 1.39 MB | 次下載 | 免費(fèi)
- 8多款常用電子電路分享
- 7.96 MB | 次下載 | 2 積分
本月
- 1A7159和A7139射頻芯片的資料免費(fèi)下載
- 0.20 MB | 55次下載 | 5 積分
- 2零死角玩轉(zhuǎn)STM32F103—指南者
- 26.78 MB | 41次下載 | 1 積分
- 3PIC12F629/675 數(shù)據(jù)手冊免費(fèi)下載
- 2.38 MB | 36次下載 | 5 積分
- 4PIC16F716 數(shù)據(jù)手冊免費(fèi)下載
- 2.35 MB | 18次下載 | 5 積分
- 5dsPIC33EDV64MC205電機(jī)控制開發(fā)板用戶指南
- 5.78MB | 8次下載 | 免費(fèi)
- 6STC15系列常用寄存器匯總免費(fèi)下載
- 1.60 MB | 7次下載 | 5 積分
- 7AN-1267: 使用ADSP-CM408F ADC控制器的電機(jī)控制反饋采樣時(shí)序
- 1.41MB | 5次下載 | 免費(fèi)
- 8模擬電路仿真實(shí)現(xiàn)
- 2.94MB | 4次下載 | 免費(fèi)
總榜
- 1matlab軟件下載入口
- 未知 | 935124次下載 | 10 積分
- 2開源硬件-PMP21529.1-4 開關(guān)降壓/升壓雙向直流/直流轉(zhuǎn)換器 PCB layout 設(shè)計(jì)
- 1.48MB | 420063次下載 | 10 積分
- 3Altium DXP2002下載入口
- 未知 | 233088次下載 | 10 積分
- 4電路仿真軟件multisim 10.0免費(fèi)下載
- 340992 | 191367次下載 | 10 積分
- 5十天學(xué)會AVR單片機(jī)與C語言視頻教程 下載
- 158M | 183335次下載 | 10 積分
- 6labview8.5下載
- 未知 | 81581次下載 | 10 積分
- 7Keil工具M(jìn)DK-Arm免費(fèi)下載
- 0.02 MB | 73813次下載 | 10 積分
- 8LabVIEW 8.6下載
- 未知 | 65988次下載 | 10 積分
評論