当前位置:网站首页>(5) SPI application design and simulation verification 2 - design code implementation
(5) SPI application design and simulation verification 2 - design code implementation
2022-06-27 17:21:00 【Shaoqing is not in Dali Temple】
( Two ) Code implementation
1) Practical code ——master
module spi_master(
input clk,
input rstn,
input[11:0] cmd_in,
input cmd_valid,
input miso,
output sclk,
output csn,
output mosi,
output cmd_ready,
output[7:0] read_data,
output read_valid
);
parameter BAUD_NUM = 200/10;
reg[7:0] baud_cnt_r;
wire baud_cnt_half = baud_cnt_r == (BAUD_NUM>>1) - 1;
wire baud_cnt_end = baud_cnt_r == BAUD_NUM - 1;
reg[7:0] read_data_r;
reg read_valid_r;
reg[3:0] bit_cnt_r;
reg[11:0] cmd_in_r;
reg cmd_ready_r;
reg csn_r;
reg sclk_r;
reg mosi_r;
//(1)sclk
[email protected](posedge clk or negedge rstn) begin
//state0: Reset and clear
if(!rstn) begin
sclk_r <= 'b0;
end
边栏推荐
- When the publish / subscribe mode encounters NET
- P.A.R.A 方法在思源的简易应用(亲测好用)
- 医院预约挂号系统-系统结构
- C système de gestion de la charge de travail des enseignants en langues
- Part 32 supplement (32) string of ECMAScript
- National food safety risk assessment center: do not blindly and unilaterally pursue "zero addition" and "pure natural" food
- Ten common methods of arrays tools
- The time of localdatetime type (2019-11-19t15:16:17) is queried with the time range of Oracle
- Detailed explanation of transaction isolation level
- Oracle概念三
猜你喜欢

07. Express routing

d3dx9_ Where is 35.dll? d3dx9_ Where can I download 35.dll

Detailed explanation of various GPIO input and output modes (push-pull, open drain, quasi bidirectional port)

Oracle concept 3

Hospital reservation and registration system - system structure

如何提升IT电子设备效能管理

After the mobile phone, it was reported that Samsung also cut the output of TV and other home appliance product lines

一个机器人位于一个 m x n 网格的左上角 。机器人每次只能向下或者向右移动一步。机器人试图达到网格的右下角。问总共有多少条不同的路径?【LeetCodeHot100】

About MySQL: the phenomenon and background of the problem

Halcon: discrete digital OCR recognition
随机推荐
leetcode 142. Circular linked list II
Detailed explanation of transaction isolation level
Synchronization mechanism of dual namenodes
Deeply digitise, lead cloud nativity and serve more developers
如何提升IT电子设备效能管理
Construction and management practice of ByteDance buried point data flow
Dark horse programmer - software testing foundation class -02-30-45 tools open browser running code, audio, video, test points, audio and video labels, layout labels. Advanced hyperlink syntax, absolu
Leetcode 46 Full Permutation
C语言课程设计
C language set operation
阿里云刘珅孜:云游戏带来的启发——端上创新
Sliding window + monotone queue concept and example (p1886 Logu)
Autodesk Navisworks 2022软件安装包下载及安装教程
Handling of difficult and miscellaneous problems during the installation and configuration of qt5.5.1 desktop version (configuring arm compilation Kit)
leetcode 82. Delete duplicate Element II in the sorting linked list
What do fast fashion brands care more about?
Leetcode 33. Search rotation sort array
一个机器人位于一个 m x n 网格的左上角 。机器人每次只能向下或者向右移动一步。机器人试图达到网格的右下角。问总共有多少条不同的路径?【LeetCodeHot100】
Etcd visualization tool: kstone deployment (I), rapid deployment based on Helm
软件测试学习-黑马程序员,软件测试学习大纲