基于PC104總線(xiàn)的429接口板
begin
WR6=XIOW or MCS or A4 or(not A3) or(not A2)or A1;
WR5=XIOW or MCS or A4 or(not A3) or A2 or(not A1);
WR4=XIOW or MCS or A4 or(not A3) or A2 or A1;
WR3=XIOW or MCS or A4 or A3 or(not A2)or(not A1);
WR2=XIOW or MCS or A4 or A3 or(not A2)or A1;
WR1=XIOW or MCS or A4 or A3 or A2 or(not A1);
WR0=XIOW or MCS or A4 orA3 or A2 or A1; --產(chǎn)生寫(xiě)信號
if MCS='0' then
IO16=MCS;
else
IO16='Z';
endif;
RD4=XIOR or MCS or(notA4)orA3 or A2;
RD3=XIOR or MCS or A4 or(not A3)or(not A2);
RD2=XIOR or MCS or A4 or(not A3)or A2;
RDI=XIOR or MCS or A4 or A3 or(not A2)
RD0=XIOR or MCS or A4 or A3 orA2;--產(chǎn)生讀信號
ENTX1=ENT1 and(not TXR1);
ENTX2=ENT2 and(not TXR2);--產(chǎn)生發(fā)送使能信號
end process;
end behav; 本文引用地址:http://dyxdggzs.com/article/173258.htm
(6)中斷控制模塊
本模塊用于實(shí)現中斷控制操作,有一個(gè)接收器滿(mǎn)便產(chǎn)生中斷,產(chǎn)生中斷時(shí)亦能判斷出中斷源。該模塊是用VHDL輸入方式產(chǎn)生的,其相應的VHDL程序如下
library ieee;
use ieee.std logic_1164.all;
entity U32 is
port(TXR1,DR11,DR12,TXR2,DR21,DR22,RD4:in std_logic;
D0,D1,D2,D3,D4,D5,INT:out std_logic);
end U32;
architecture behav of U32 is
begin
process
begin
if RD4='0' then
D0=not DR11:
D1=not DR12;
D2=not DR21;
D3=not DR22;
--產(chǎn)生中斷時(shí)用來(lái)判斷哪個(gè)接收器滿(mǎn)
D4=TXR1;
D5=TXR2;
--用來(lái)判斷哪一個(gè)發(fā)送緩沖區空
else
D0='Z';D1'Z';D2='Z';D3='Z';D4='Z';D5='Z';
endif;
INT=not(DR11 and DR12 and DR21 and DR22); --有一個(gè)接收器滿(mǎn)便產(chǎn)生中斷
end process;
end behav;
3.3 CPLD程序的下載
各輸入模塊經(jīng)過(guò)編譯處理,根據其相互關(guān)系連結,再通過(guò)功能仿真和時(shí)序仿真確認無(wú)誤后,對各輸入輸出端口進(jìn)行管腳分配。當整個(gè)設計完成時(shí),MAX+PLUSII將生成一個(gè)文件(.pof),該文件通過(guò)下載電纜從JTAG口傳送到PC104板上的CPLD芯片內部。這樣就可將CPLD構造成自己的專(zhuān)用芯片,由此便可以對設計的PC104板卡進(jìn)行調試。調試過(guò)程中CPLD的設計部分還可根據需要進(jìn)行修改,只是修改后要重新產(chǎn)生.pof文件,重新將文件加載到芯片中。
4 結束語(yǔ)
針對PC104接口板的尺寸小的特點(diǎn),本論文介紹了用CPLD實(shí)現基于PC104總線(xiàn)的429接口板,CPLD大大節省了硬件資源,同時(shí)也節省了板卡上的可利用空間,徹底解決了PC104 板卡的小尺寸給設計帶來(lái)的困難。且CPLD修改簡(jiǎn)單,給調試工作帶來(lái)了方便。該板卡經(jīng)過(guò)調試后實(shí)驗,可穩定工作。實(shí)驗結果表明:應用CPLD簡(jiǎn)化了系統結構,縮短了設計周期,提高了系統的可靠性。
評論