当前位置:网站首页>(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
边栏推荐
- Selenium+Pytest自动化测试框架实战
- 3D point cloud slam
- 3D reconstruction of point cloud
- Use the rewrite rule to rewrite all accesses to the a domain name to the B domain name
- 实现反向代理客户端IP透传
- One article deals with the microstructure and instructions of class
- Use of metadata in golang grpc
- Hcip day 12 (BGP black hole, anti ring, configuration)
- regular expression
- 一文搞定class的微观结构和指令
猜你喜欢
Data type, variable declaration, global variable and i/o mapping of PLC programming basis (CoDeSys)
一文搞定垃圾回收器
Spectrum analysis of ADC sampling sequence based on stm32
Using LNMP to build WordPress sites
Go语言实现原理——锁实现原理
VOT Toolkit环境配置与使用
一文搞定class的微观结构和指令
关于MySQL的30条优化技巧,超实用
Detailed explanation of pointer and array written test of C language
【Note17】PECI(Platform Environment Control Interface)
随机推荐
Detailed explanation of pointer and array written test of C language
npm ELECTRON_ Mirror is set as domestic source (npmmirror China mirror)
d3dx9_ How to repair 31.dll_ d3dx9_ 31. Solution to missing DLL
一文搞定垃圾回收器
Error when LabVIEW opens Ni instance finder
Week 17 homework
Overview of Fourier analysis
Common JVM tools and optimization strategies
Openresty ngx Lua regular expression
并查集实践
2:第一章:认识JVM规范1:JVM简介;
Ultrasonic sensor flash | LEGO eV3 Teaching
Alibaba Tianchi SQL training camp task4 learning notes
查看网页最后修改时间方法以及原理简介
fibonacci search
Activate function and its gradient
Shell: operator
判斷二叉樹是否為完全二叉樹
Nangou Gili hard Kai font TTF Download with installation tutorial
openresty ngx_lua正則錶達式