ds1302(vhdl) io口问答
时间:10-02
整理:3721RD
点击:
PROCESS(CLK,IO,IO_LINK,IO_R,IO_R1,IO_LINK1)
BEGIN
IF RISING_EDGE(CLK) THEN
IF IO_LINK='1' AND IO_LINK1='0' THEN
IO<=IO_R; IO_IN<='Z';
-- TEST1<=TEST1+1;
ELSIF IO_LINK='0' AND IO_LINK1='1' THEN
IO<=IO_R1; IO_IN<='Z';
-- TEST2<=TEST2+1;
ELSIF IO_LINK='0' AND IO_LINK1='0' THEN
IO_IN<=IO; IO<='Z';
-- TEST3<=TEST3+1;
ELSE
IO<='Z'; IO_IN<='Z';
-- TEST4<=TEST4+1;
END IF;
END IF;
END PROCESS;
这是我写的io口操作
谢谢
BEGIN
IF RISING_EDGE(CLK) THEN
IF IO_LINK='1' AND IO_LINK1='0' THEN
IO<=IO_R; IO_IN<='Z';
-- TEST1<=TEST1+1;
ELSIF IO_LINK='0' AND IO_LINK1='1' THEN
IO<=IO_R1; IO_IN<='Z';
-- TEST2<=TEST2+1;
ELSIF IO_LINK='0' AND IO_LINK1='0' THEN
IO_IN<=IO; IO<='Z';
-- TEST3<=TEST3+1;
ELSE
IO<='Z'; IO_IN<='Z';
-- TEST4<=TEST4+1;
END IF;
END IF;
END PROCESS;
这是我写的io口操作
谢谢
谁能给点意见,上面的io口一直没调好
什么意见,,,小编可否描述清楚点。
io是双向口嘛,我现在是仿真没有问题了,但是在跟ds1302通信的时候接受到的数据都是ff,不知道是前面的指令有问题,还是我的io口有问题,不知道怎么搞
http://bbs.elecfans.com/forum.ph ... p;extra=#pid3784116