全文预览已结束
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
基于VHDL的IIC时序电路设计iic 总线在设计时要看你所使用的器件的传输或接收时序只要会一个,其他的都一样以下是我在一本书上看到的,你看看就会用了library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;entity reciver isport(reset,clk:in std_logic;sda,scl:inout std_logic;rd:out std_logic;tdata:in std_logic_vector(7 downto 0);rdata:out std_logic_vector(7 downto 0);end reciver;architecture one of reciver issignal rdatai:std_logic_vector(7 downto 0);type state is (start,transmit,ack,sub,ack1,start1,slave,ack2,reading,ack3);signal current:state;beginprocess(clk,reset)variable count:integer range 0 to 40;variable cnt:integer range 0 to 8;beginif reset=1thensda=1;scl=1;rdata=00000000;currentcount:=count+1;case count iswhen 1=sdasclsdasclcount:=0;currentnull;end case;when transmit=count:=count+1;case count iswhen 1=sdasclsclcnt:=cnt-1;count:=0;if cnt=0 then cnt:=8;current=ack;rd=1;else current=transmit;rdnull;end case;when ack=count:=count+1;case count iswhen 1=sdasclsclcurrentnull;end case;when sub=count:=count+1;case count iswhen 1=sdasclsclcnt:=cnt-1;count:=0;if cnt=0 then cnt:=8;current=ack1;rd=1;else current=sub;rdnull;end case;when ack1=count:=count+1;case count iswhen 1=sdasclsclcurrentnull;end case;when start1=count:=count+1;case count iswhen 1=sdasclsdasclcurrentnull;end case;when slave=count:=count+1;case count iswhen 1=sdasclsclcnt:=cnt-1;count:=0;if cnt=0 then cnt:=8;current=ack2;rd=1;else current=sub;rdnull;end case;when ack2=count:=count+1;case count iswhen 1=sdasclsclcurrentnull;end case;when reading=count:=count+1;case count iswhen 1=sdasclrdatai(cnt)sclcnt:=cnt-1;count:=0;if cnt=0 then cnt:=8;current=ack3;rd=1;else current=reading;rdnull;end case;when ack3=count:=count+1;case count iswhen 1=sdasclsclrdata=rdatai;currentnull;end case;end case;end if;end process;end arc
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 产品测试与验证标准化工具保证产品质量稳定版
- 用户数据保护无漏洞承诺书9篇
- 平仄起伏:古诗词韵律教学教案
- 家属抚养责任承诺书4篇
- 2025铁路上海12306旅客服务中心客户服务实习生招聘考试笔试模拟试题及答案解析
- 跨国经济合作信诺承诺函6篇
- 2025甘肃河西学院招聘事业编制人员53人考试笔试备考题库及答案解析
- 二、认识多媒体作品的制作工具教学设计-2025-2026学年小学信息技术粤教版四年级下册-粤教版
- 2025安徽安庆仲裁委员会秘书处招聘政府购买服务人员2人考试笔试模拟试题及答案解析
- 供应商信息管理及审核工具
- 2026云南云天化石化有限公司校园招聘9人考试笔试备考题库及答案解析
- 海域云:2025年中国户用储能行业出海研究报告
- 社交礼仪知识互动试题及答案
- 2025贵阳市城市建设投资集团有限公司第二批招聘笔试考试参考试题附答案解析
- 承装修安全生产管理制度
- 2025物流师考试试题及答案物流师考试真题及答案
- 2025-2026学年天一大联考高二物理第一学期期末质量跟踪监视模拟试题含解析
- 配电室安全检查要点和监管培训
- 市政府办公文材料审核办法
- 2026年中国食品检验检测市场调查与市场前景预测报告
- 小区物业消防演练方案及
评论
0/150
提交评论