当前位置:网站首页>(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边栏推荐
- 2.13 summary
- Leetcode sword finger offer brush questions - day 21
- Multi camera stereo calibration
- Yiwen gets rid of the garbage collector
- Selenium+Pytest自动化测试框架实战
- Activate function and its gradient
- February 13, 2022 -5- maximum depth of binary tree
- 3D reconstruction of point cloud
- Ultrasonic sensor flash | LEGO eV3 Teaching
- fibonacci search
猜你喜欢

Douban scoring applet Part-2

两数之和、三数之和(排序+双指针)

数据库基础知识(面试)

Yiwen gets rid of the garbage collector

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

Data type, variable declaration, global variable and i/o mapping of PLC programming basis (CoDeSys)

Masked Autoencoders Are Scalable Vision Learners (MAE)

PLC编程基础之数据类型、变量声明、全局变量和I/O映射(CODESYS篇 )

数学公式截图识别神器Mathpix无限使用教程

fibonacci search
随机推荐
Douban scoring applet Part-2
Hj16 shopping list
Activate function and its gradient
Selenium+pytest automated test framework practice
C Primer Plus Chapter 9 question 10 binary conversion
数学公式截图识别神器Mathpix无限使用教程
How to quickly understand complex businesses and systematically think about problems?
利用LNMP实现wordpress站点搭建
Composition of interface
2:第一章:认识JVM规范1:JVM简介;
实现反向代理客户端IP透传
Global and Chinese markets for welding products 2022-2028: Research Report on technology, participants, trends, market size and share
一文搞定JVM常见工具和优化策略
秒杀系统的设计与实现思路
Judge whether the binary tree is a complete binary tree
Vcomp110.dll download -vcomp110 What if DLL is lost
终于搞懂什么是动态规划的
Vision Transformer (ViT)
Debian 10 installation configuration
3D point cloud slam