Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - EPP Data Write Cycle

 
Thread Tools Search this Thread
Old 06-15-2007, 01:05 PM   #1
Default EPP Data Write Cycle


Hello, I'm trying to implement this protocol in VHDL, if someone could
help me it would be great.
http://www.beyondlogic.org/epp/eppdatwr.gif


Code I'm using:

package datatypes is
subtype pixel_value is integer range 0 to 255;
subtype addr_value is integer range 0 to 8191; -- [12..0] linhas
endereço
--subtype addr_value is integer range 0 to 131071; -- [16..0] linhas
endereço

-- maquina de estados
type rec_machine is (startcomm, idle, waitdata, receiveok ); --
maquina p/ receber bytes
end datatypes;

use work.datatypes.all;
library ieee;
use ieee.std_logic_1164.all;

entity interface_paralela is

port (
-- ENTRADAS
write: in std_logic;
data_strobe: in std_logic;
addr_strobe: in std_logic;
reset: in std_logic;

-- DADOS
data: inout pixel_value;

-- SAIDAS
interrupt: out std_logic;
pwait: out std_logic;

-- CONTROLADOR MEMORIA
address: out addr_value;
wren: out std_logic

);

end interface_paralela;


architecture epp_mode of interface_paralela is
signal present_state, next_state: rec_machine;
signal status : NATURAL RANGE 0 TO 15;

begin

-- DEFAULTS;
interrupt <= '0';

maquina_estados: process(write, data_strobe, addr_strobe, reset) is
begin
IF reset='1' THEN
present_state <= startcomm;
ELSIF present_state=startcomm AND write='0' AND data_strobe='1' AND
addr_strobe='1' THEN
present_state <= idle;
ELSIF present_state=idle AND write='0' AND data_strobe='0' AND
addr_strobe='1' THEN
present_state <= waitdata;
ELSIF present_state<=waitdata AND write='0' AND data_strobe='1' AND
addr_strobe='1' THEN
present_state<=receiveok;
ELSIF present_state=receiveok AND write='1' AND data_strobe='1' AND
addr_strobe='1' THEN
present_state<=idle;
END IF;
end process maquina_estados;

control: process(present_state) is
VARIABLE addr_ptr : addr_value;
begin

CASE present_state IS

WHEN startcomm =>
addr_ptr := 0;
WHEN idle =>
wren <='0';
pwait <='0';
WHEN waitdata =>
wren <='1';
pwait <='1';
WHEN receiveok =>
wren <='0';
pwait <='0';
addr_ptr := addr_ptr+1;

END CASE;

end process control;

end epp_mode;



Rodrigo Ribeiro
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Wonderful data input with web reporting tool freezea Software 0 09-09-2009 05:30 AM
Need to write data in one datasheet alone in already existing xls. Amudha Software 0 08-21-2008 04:58 AM
Re: HDD Data Recovery Glenn A+ Certification 0 08-29-2006 04:01 PM
Address Bus and External Data Bus Confusion LoXodonte A+ Certification 1 04-18-2006 10:09 PM
Re: Backing up data to reinstall or replace a Operating system? Barry Watzman A+ Certification 0 08-21-2003 06:59 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46