当前位置:网站首页>(4)UART應用設計及仿真驗證2 —— TX模塊設計(無狀態機)
(4)UART應用設計及仿真驗證2 —— TX模塊設計(無狀態機)
2022-07-05 23:10:00 【少卿不在大理寺】
前言:再次回顧這個小項目已是幾個月後了,在後續的學習中,新的老師在不斷强調,實際工作中盡量少用狀態機,整理文章時忘了當時他咋說的了。所以我試著自己重新寫一下UART,整理一個不帶狀態機的版本。
這裏有幾個基礎的邏輯點要再次回顧一下:
1)完整的一幀數據格式包含:起始比特,有效數據比特,校驗比特,停止比特;
2)計算單bit數據的傳輸時間:利用baoud(波特率)和clk(系統時鐘),波特率單比特bit per second,時鐘Hz單比特time per second ,所以時鐘除以波特率得到的就是time per bit,即每bit對應多少個時鐘周期;
3)參考信號:傳輸信號baoud_cnt_half,每bit計數到一半的時候,傳遞數據;切換計數信號baoud_cnt_end,每bit計數完的時候,進入下一輪計數周期;比特計數bit_cnt,計算一幀數據中傳遞到第幾比特了;傳輸過程標志信號start_flag,貫穿每一次的數據傳輸。
上代碼:
//date:2022.6.30
//edgar.yao
//uart_tx block
module uart_tx(
input clk,
input rst_n,
input[7:0] cmd_data,
input data_valid,
output tx,
output tx_read边栏推荐
- Composition of interface
- [untitled]
- Common model making instructions
- Basic knowledge of database (interview)
- One article deals with the microstructure and instructions of class
- LabVIEW打开PNG 图像正常而 Photoshop打开得到全黑的图像
- 513. Find the value in the lower left corner of the tree
- Three. JS VR house viewing
- LeetCode145. Post order traversal of binary tree (three methods of recursion and iteration)
- Leecode learning notes
猜你喜欢

SPSS analysis of employment problems of college graduates

Selenium+pytest automated test framework practice

Hcip day 12 (BGP black hole, anti ring, configuration)

如何快速理解复杂业务,系统思考问题?

基于脉冲神经网络的物体检测

How to quickly understand complex businesses and systematically think about problems?

d3dx9_ How to repair 31.dll_ d3dx9_ 31. Solution to missing DLL

Matlab smooth curve connection scatter diagram

Simple and beautiful method of PPT color matching

February 13, 2022-4-symmetric binary tree
随机推荐
Basic knowledge of database (interview)
Un article traite de la microstructure et des instructions de la classe
Hcip day 11 (BGP agreement)
[digital signal denoising] improved wavelet modulus maxima digital signal denoising based on MATLAB [including Matlab source code 1710]
SPSS analysis of employment problems of college graduates
Getting started stm32--gpio (running lantern) (nanny level)
Use of metadata in golang grpc
3 find the greatest common divisor and the least common multiple
Calculating the number of daffodils in C language
Nangou Gili hard Kai font TTF Download with installation tutorial
H5c3 advanced - player
ORB_ SLAM2/3
视频标准二三事
Global and Chinese market of diesel fire pump 2022-2028: Research Report on technology, participants, trends, market size and share
fibonacci search
Go语言实现原理——Map实现原理
Common JVM tools and optimization strategies
Global and Chinese markets for reciprocating seal compressors 2022-2028: Research Report on technology, participants, trends, market size and share
Three.js-01 入门
CorelDRAW plug-in -- GMS plug-in development -- new project -- macro recording -- VBA editing -- debugging skills -- CDR plug-in (2)