|
楼主 |
发表于 2010-5-13 17:04:46
|
显示全部楼层
回复【1楼】40130064
一个进程只能有一个边沿检测
试试这个,我没在q2上试,也许有错.
begin
--datstart <= "10101010";--
process
begin
if(rmcu = '0') then
case(datnum) is
when 0 => datout <= datstart;
when 1 => datout <= datx1h;
when 2 => datout <= datx1l;
when 3 => datout <= daty1h;
when 4 => datout <= daty1l;
......
-----------------------------------------------------------------------
试过,用户else也不行。一样的错误。
还有我开了两个进程,
architecture behav of MCUtest is
signal datnum: integer range 0 to 8;
signal datstart: std_logic_vector(7 downto 0);
signal datx1h,daty1h,datx2h,daty2h,datx1l,daty1l,datx2l,daty2l: std_logic_vector(7 downto 0);
begin
datstart <= "10101010";
process(rMCU)
begin
if(rMCU'event and rMCU = '0') then
case(datnum) is
when 0 => datout <= datstart;
when 1 => datout <= datx1h;
when 2 => datout <= datx1l;
when 3 => datout <= daty1h;
when 4 => datout <= daty1l;
when 5 => datout <= datx2h;
when 6 => datout <= datx2l;
when 7 => datout <= daty2h;
when 8 => datout <= daty2l;
end case;
wMCU <= '0';
if(datnum = 8) then
datnum <= 0;
else
datnum <= datnum + 1;
end if;
end if;
end process;
process(rMCU)
begin
if(rMCU'event and rMCU = '1') then
wMCU <= '1';
end if;
end process;
end behav;
这样会出现另外一个问题。是不能在两个进程对同一个寄存器附值。
最后我只能把wMCU去掉。 |
|