首页 | 新闻 | 新品 | 文库 | 方案 | 视频 | 下载 | 商城 | 开发板 | 数据中心 | 座谈新版 | 培训 | 工具 | 博客 | 论坛 | 百科 | GEC | 活动 | 主题月 | 电子展
返回列表 回复 发帖

跪求帮助:关于VDHL的一段代码

跪求帮助:关于VDHL的一段代码

下面是我编写的串行接收数据部分,但是总是调不通,我用示波器量的输入信号及时钟都是正确的,但是我按照下面的程序将数据读入CPLD的缓冲区中,然后显示出来总是不正确,但是通过data_out将接收的数据转发出去,另一端用单片机接收却能接收到,实在找不出原因,望请大侠们帮我一下,非常感谢!
sck是串行输入时钟,show_pin为数码管显示管脚,data_in为基于sck的数据输入
非常非常感谢!
data_rx:process(sck,data_in)
begin
  if  sck'event and sck = '0' then
       data_in_buf(7 downto 0) <= data_in_buf(6 downto 0)& data_in;
  end if;
end process data_rx;

data_show:process(data_in_buf)
begin
   case data_in_buf(3 downto 0) is  --ABCDEFG
   when "0000"  => show_pin <= "1111110";--0
   when "0001"  => show_pin <= "0110000";--1
   when "0010"  => show_pin <= "1101101";--2
   when "0011"  => show_pin <= "1111001";--3
   when "0100"  => show_pin <= "0110011";--4
   when "0101"  => show_pin <= "1011011";--5
   when "0110"  => show_pin <= "1011111";--6
   when "0111"  => show_pin <= "1110000";--7
   when "1000"  => show_pin <= "1111111";--8
   when "1001"  => show_pin <= "1111011";--9
   when "1010"  => show_pin <= "1110111";--A
   when "1011"  => show_pin <= "0011111";--B
   when "1100"  => show_pin <= "1001110";--C
   when "1101"  => show_pin <= "0111101";--D
   when "1110"  => show_pin <= "1001111";--E
   when "1111"  => show_pin <= "1000111";--F
   when others  => show_pin <= "0000000";-->turn off
end case;
end process data_show;
data_out    <= data_in_buf(0); -- 发送数据赋值

我用的CPLD 为XC9572xl-10,再次感谢
返回列表