<dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><small id="yhprb"></small><dfn id="yhprb"></dfn><small id="yhprb"><delect id="yhprb"></delect></small><small id="yhprb"></small><small id="yhprb"></small> <delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"></dfn><dfn id="yhprb"></dfn><s id="yhprb"><noframes id="yhprb"><small id="yhprb"><dfn id="yhprb"></dfn></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><small id="yhprb"></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn> <small id="yhprb"></small><delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn>

新聞中心

EEPW首頁(yè) > 嵌入式系統 > 設計應用 > FPGA與單片機實(shí)現數據RS232串口通信的設計

FPGA與單片機實(shí)現數據RS232串口通信的設計

作者: 時(shí)間:2010-08-31 來(lái)源:網(wǎng)絡(luò ) 收藏

begin
if reset='1' then
txcnt_r=(others=>'0');
sout1='1';
state=start1;
cou=0;
elsif txclk'event and txclk='1' then
case state is
when start1=>
if start='1' then
if cou=3 then
len=thr;
end if;
tsr:=thr(7 downto 0);
oddb1:=thr(7 downto 0);
sout1='0'; --起始位
txcnt_r=(others=>'0');
state=shift1;
else
state=start1;
end if;
when shift1=>
oddb=oddb1(7) xor oddb1(6) xor oddb1(5) xor oddb1(4) xor oddb1(3) xor oddb1(2) xor oddb1(1) xor oddb1(0);
sout1=tsr(0); --數據位
tsr(6 downto 0):=tsr(7 downto 1);
tsr(7):='0';
txcnt_r=txcnt_r 1;
if (txcnt_r=7) then
state=odd1;cou=cou 1;
end if;
when odd1=> --奇校驗位
if oddb='1' then
sout1='0';state=stop1;
else
sout1='1';state=stop1;
end if;
when stop1=>
sout1='1'; --停止位
if cou4 then
state=start1;
else
state=start2;
end if;
when start2=>
tsr1:=thr(15 downto 8);
oddb2:=thr(15 downto 8);
sout1='0'; --起始位
txcnt_r=(others=>'0');
state=shift2;
when shift2=>
oddb=oddb2(7) xor oddb2(6) xor oddb2(5) xor oddb2(4) xor oddb2(3) xor oddb2(2) xor oddb2(1) xor oddb2(0);
sout1=tsr1(0);--數據位
tsr1(6 downto 0):=tsr1(7 downto 1);
tsr1(7):='0';
txcnt_r=txcnt_r 1;
if (txcnt_r=7) then
state=odd2;
end if;
when odd2=> --奇校驗位
if oddb='1' then
sout1='0';state=stop2;
else
sout1='1';state=stop2;
end if;
when stop2=>
sout1='1'; --停止位
if len=0000000000000000 then
state=stop2;
else
state=start1;
len=len-1;
end if;
end case;
end if;
end process;
sout=sout1;
end behav;


關(guān)鍵詞: EDA FPGA 單片機

評論


相關(guān)推薦

技術(shù)專(zhuān)區

關(guān)閉
国产精品自在自线亚洲|国产精品无圣光一区二区|国产日产欧洲无码视频|久久久一本精品99久久K精品66|欧美人与动牲交片免费播放
<dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><small id="yhprb"></small><dfn id="yhprb"></dfn><small id="yhprb"><delect id="yhprb"></delect></small><small id="yhprb"></small><small id="yhprb"></small> <delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"></dfn><dfn id="yhprb"></dfn><s id="yhprb"><noframes id="yhprb"><small id="yhprb"><dfn id="yhprb"></dfn></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><small id="yhprb"></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn> <small id="yhprb"></small><delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn>