当前位置:网站首页>(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
边栏推荐
- Leetcode weekly The 280 game of the week is still difficult for the special game of the week's beauty team ~ simple simulation + hash parity count + sorting simulation traversal
- Expectation, variance and covariance
- Multi sensor fusion of imu/ optical mouse / wheel encoder (nonlinear Kalman filter)
- openresty ngx_ Lua request response
- Starting from 1.5, build a micro Service Framework -- log tracking traceid
- 两数之和、三数之和(排序+双指针)
- [speech processing] speech signal denoising and denoising based on Matlab GUI low-pass filter [including Matlab source code 1708]
- ORB_ SLAM2/3
- Negative sampling
- Non rigid / flexible point cloud ICP registration
猜你喜欢
实现反向代理客户端IP透传
Vision Transformer (ViT)
How to quickly understand complex businesses and systematically think about problems?
Use of grpc interceptor
Leetcode weekly The 280 game of the week is still difficult for the special game of the week's beauty team ~ simple simulation + hash parity count + sorting simulation traversal
openresty ngx_ Lua request response
Getting started stm32--gpio (running lantern) (nanny level)
Simple and beautiful method of PPT color matching
MoCo: Momentum Contrast for Unsupervised Visual Representation Learning
数学公式截图识别神器Mathpix无限使用教程
随机推荐
How to quickly understand complex businesses and systematically think about problems?
Simple and beautiful method of PPT color matching
Multi sensor fusion of imu/ optical mouse / wheel encoder (nonlinear Kalman filter)
一文搞定class的微觀結構和指令
东南亚电商指南,卖家如何布局东南亚市场?
PLC编程基础之数据类型、变量声明、全局变量和I/O映射(CODESYS篇 )
实现反向代理客户端IP透传
Déterminer si un arbre binaire est un arbre binaire complet
6-axis and 9-axis IMU attitude estimation
Masked Autoencoders Are Scalable Vision Learners (MAE)
[digital signal denoising] improved wavelet modulus maxima digital signal denoising based on MATLAB [including Matlab source code 1710]
Calculating the number of daffodils in C language
Hainan Nuanshen tea recruits warmhearted people: recruitment of the product experience recommender of Nuanshen multi bubble honey orchid single cluster
数据库基础知识(面试)
2022 G3 boiler water treatment simulation examination and G3 boiler water treatment simulation examination question bank
Boring boring
Metasploit(msf)利用ms17_010(永恒之蓝)出现Encoding::UndefinedConversionError问题
C Primer Plus Chapter 9 question 10 binary conversion
[untitled]
30 optimization skills about mysql, super practical