library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity clockport is
Port( -- clockport signals
data : inout STD_LOGIC_VECTOR (7 downto 0); -- data pins
addressIn : in STD_LOGIC_VECTOR (3 downto 0); -- address pins
iord : in STD_LOGIC; -- active low when read from device to CPU
iowr : in STD_LOGIC; -- active low when write from CPU to device
--cs : in STD_LOGIC;
-- debug signals
addressOut : out STD_LOGIC_VECTOR (3 downto 0);
-- registers used to exchange data
--btnReg : in STD_LOGIC_VECTOR (3 downto 0)
testOut : out STD_LOGIC_VECTOR (7 downto 0)
);
end clockport;
architecture Behavioral of clockport is
signal address : STD_LOGIC_VECTOR (3 downto 0);
begin
address <= addressIn when iord = '0' or iowr = '0';
addressOut <= address;
process (iowr)
begin
if iowr = '0' then
testOut <= data;
end if;
end process;
process (iord)
begin
if iord = '0' then
data <= "00000001";
end if;
end process;
end Behavioral;process (iord) begin if rising_edge(iord) then testOut <= data; end if; end process;
@strim, post #1
data <= "00000001" when (iord = '0') AND address = "1111" else "ZZZZZZZZ";
process (iowr) begin if iowr = '0' then testOut <= data; end if; end process;
@strim, post #1
@strim, post #5
@strim, post #6
module clockport (
d0, d1, d2, d3, d4, d5, d6, d7, cs, ior, iow
);
inout d0, d1, d2, d3, d4, d5, d6, d7;
input cs, ior, iow;
wire write_event, read_event;
reg [7:0] register;
assign write_event = !(cs | iow);
assign read_event = !(cs | ior);
assign {d7, d6, d5, d4, d3, d2, d1, d0} = read_event?register:8'bZ;
always@(posedge write_event)
begin
register <= {d7, d6, d5, d4, d3, d2, d1, d0};
end
endmodule @rafgc, post #7
@strim, post #9
@rafgc, post #10
@strim, post #11
@strim, post #12
@strim, post #15

@Nathanel, post #16
@wawrzon, post #18
kontrolry usb i eternetu juz sa..
http://www.amiga.org/forums/showthread.php?p=722060#post722060
@pekdar, post #22
Co musiałoby być jeszcze zaimplementowane w tym PLD, aby można było podpiąć pod to jakiś stos USB?
Kontroler USB Ale to nie wlezie do takiego maluszka...
jeżeli jakiś nowszy to stawiasz virtualbox-a z XP i jazda
@strim, post #24
@rafgc, post #25
Co tak naprawdę robi ten CPLD, bo skoro obsługa USB jest w mikrokontrolerze, to chyba po stronie cpld nie powinien być jakiś prosty interfejs?
Nic dziwnego, że kod zajmuje tyle makroceli, 32-bitowy liczniki i dwa 32-bitowe komparatory, zajmują około 96 makroceli, czy naprawdę potrzebne są aż tak wielkie liczniki?
@strim, post #26
32-bitowy licznik i komparatory są obecnie wykorzystywane chyba tylko przez dzielnik zegara. Na płytce zamontowany jest kwarc 8MHz, a to za dużo do obsługi wyświetlacza.
@abcdef, post #28
to taki coolboard ? http://kamami.pl/index.php?ukey=product&productID=188195
Nie jestem pewien, ale chyba jednak da się ciut prościej prescaler/freq divider zrobić niż przez 32 bitowe liczniki
@strim, post #29