Digilent Parallel Interface Model User Manual
Page 7

Digilent Parallel Interface Model
Digilent, Inc.
www.digilentinc.com
Copyright Digilent, Inc.
Page 7
signal
ctlEppAstb : std_logic;
signal
ctlEppDstb : std_logic;
signal
ctlEppDir
: std_logic;
signal
ctlEppWr
: std_logic;
signal
ctlEppAwr
: std_logic;
signal
ctlEppDwr
: std_logic;
signal
busEppOut
: std_logic_vector(7 downto 0);
signal
busEppIn
: std_logic_vector(7 downto 0);
signal
busEppData : std_logic_vector(7 downto 0);
-- Registers
signal
regEppAdr
: std_logic_vector(3 downto 0);
signal
regData0
: std_logic_vector(7 downto 0);
signal
regData1
: std_logic_vector(7 downto 0);
signal regData2
: std_logic_vector(7 downto 0);
signal regData3
: std_logic_vector(7 downto 0);
signal regData4
: std_logic_vector(7 downto 0);
signal
regData5
: std_logic_vector(7 downto 0);
signal
regData6
: std_logic_vector(7 downto 0);
signal
regData7
: std_logic_vector(7 downto 0);
signal
regLed
: std_logic_vector(7 downto 0);
signal
cntr
: std_logic_vector(23 downto 0);
------------------------------------------------------------------------
-- Module Implementation
------------------------------------------------------------------------
begin
------------------------------------------------------------------------
-- Map basic status and control signals
------------------------------------------------------------------------
clkMain <= mclk;
ctlEppAstb <= astb;
ctlEppDstb <= dstb;
ctlEppWr <= pwr;
pwait <= ctlEppWait; -- drive WAIT from state machine output
-- Data bus direction control. The internal input data bus always
-- gets the port data bus. The port data bus drives the internal
-- output data bus onto the pins when the interface says we are doing
-- a read cycle and we are in one of the read cycles states in the
-- state machine.
busEppIn <= pdb;
pdb <= busEppOut when ctlEppWr = '1' and ctlEppDir = '1' else "ZZZZZZZZ";
-- Select either address or data onto the internal output data bus.
busEppOut <= "0000" & regEppAdr when ctlEppAstb = '0' else busEppData;
rgLed <= regLed;
ldg <= '1';
-- Decode the address register and select the appropriate data register
busEppData <= regData0 when regEppAdr = "0000" else
regData1 when regEppAdr = "0001" else
regData2 when regEppAdr = "0010" else