Revision 398
Added by markw almost 10 years ago
eclaireXL/atari800core_eclaireXL.vhd | ||
---|---|---|
GPIOA(I) <= GPIOA_out(I) when GPIOA_dir_out(I)='1' else 'Z';
|
||
end generate GPIOA_gen;
|
||
|
||
GPIO1_gen:
|
||
GPIOB_gen:
|
||
for I in 0 to 35 generate
|
||
GPIOB(I) <= GPIOB_out(I) when GPIOB_dir_out(I)='1' else 'Z';
|
||
end generate GPIO1_gen;
|
||
end generate GPIOB_gen;
|
||
|
||
-- duplicate GPIOC
|
||
GPIOC_gen:
|
||
for I in 0 to 35 generate
|
||
GPIOC(I) <= GPIOB_out(I) when GPIOB_dir_out(I)='1' else 'Z';
|
||
end generate GPIOC_gen;
|
||
|
||
gen_old_gpio : if gpio=1 generate
|
||
GPIO1 : entity work.gpio
|
||
GENERIC MAP(
|
||
... | ... | |
);
|
||
end generate gen_new_gpio;
|
||
|
||
gen_test_gpio : if gpio=3 generate
|
||
gpio2 : entity work.gpiov3
|
||
GENERIC MAP(
|
||
cartridge_cycle_length => 26
|
||
)
|
||
PORT MAP(clk => CLK,
|
||
reset_n => reset_n,
|
||
gpio_enable => pbi_enable,
|
||
pot_reset => pot_reset,
|
||
pbi_write_enable => pbi_write_enable,
|
||
enable_179_early => enable_179_early,
|
||
cart_request => cart_request,
|
||
cart_complete => cart_request_complete,
|
||
cart_data_read => cart_data,
|
||
s4_n => cart_s4_n,
|
||
s5_n => cart_s5_n,
|
||
cctl_n => cart_cctl_n,
|
||
cart_data_write => pbi_write_data(7 downto 0),
|
||
GPIO_0_IN => GPIOA,
|
||
GPIO_0_OUT => GPIOA_OUT,
|
||
GPIO_0_DIR_OUT => GPIOA_DIR_OUT,
|
||
GPIO_1_IN => GPIOB,
|
||
GPIO_1_OUT => GPIOB_OUT,
|
||
GPIO_1_DIR_OUT => GPIOB_DIR_OUT,
|
||
keyboard_scan => KEYBOARD_SCAN,
|
||
pbi_addr_out => pbi_addr,
|
||
porta_out => PORTA_OUT,
|
||
porta_output => PORTA_DIR_OUT,
|
||
lightpen => ANTIC_LIGHTPEN,
|
||
rd4 => CART_RD4,
|
||
rd5 => CART_RD5,
|
||
keyboard_response => GPIO_KEYBOARD_RESPONSE,
|
||
porta_in => PORTA_IN,
|
||
pot_in => pot_in,
|
||
trig_in => TRIGGERS,
|
||
CA2_DIR_OUT => CA2_DIR_OUT,
|
||
CA2_OUT => CA2_OUT,
|
||
CA2_IN => CA2_IN,
|
||
CB2_DIR_OUT => CB2_DIR_OUT,
|
||
CB2_OUT => CB2_OUT,
|
||
CB2_IN => CB2_IN,
|
||
SIO_IN => GPIO_SIO_RXD,
|
||
SIO_OUT => SIO_TXD,
|
||
SIO_CLOCKIN => SIO_CLOCKIN,
|
||
SIO_CLOCKOUT => SIO_CLOCKOUT
|
||
);
|
||
end generate gen_test_gpio;
|
||
|
||
process(clk,RESET_N,SDRAM_RESET_N,reset_atari)
|
||
begin
|
||
if ((RESET_N and SDRAM_RESET_N and not(reset_atari))='0') then
|
||
... | ... | |
PS2_DAT => ps2dat,
|
||
|
||
KEYBOARD_SCAN => KEYBOARD_SCAN,
|
||
KEYBOARD_RESPONSE => PS2_KEYBOARD_RESPONSE,
|
||
KEYBOARD_RESPONSE => KEYBOARD_RESPONSE,
|
||
|
||
CONSOL_START => CONSOL_START,
|
||
CONSOL_SELECT => CONSOL_SELECT,
|
eclaireXL/build.sh | ||
---|---|---|
"A2EBA" =>
|
||
{
|
||
"TV" => 2,
|
||
"GPIO" => 2,
|
||
"GPIO" => 3,
|
||
"internal_ram" => 0,
|
||
"internal_rom" => 0
|
||
},
|
eclaireXL/gpiov3.vhd | ||
---|---|---|
---------------------------------------------------------------------------
|
||
-- (c) 2013 mark watson
|
||
-- I am happy for anyone to use this for non-commercial use.
|
||
-- If my vhdl files are used commercially or otherwise sold,
|
||
-- please contact me for explicit permission at scrameta (gmail).
|
||
-- This applies for source and binary form and derived works.
|
||
---------------------------------------------------------------------------
|
||
LIBRARY ieee;
|
||
USE ieee.std_logic_1164.all;
|
||
use ieee.numeric_std.all;
|
||
|
||
entity gpiov3 is
|
||
generic
|
||
(
|
||
cartridge_cycle_length : in integer := 32
|
||
);
|
||
port
|
||
(
|
||
clk : in std_logic;
|
||
reset_n : in std_logic;
|
||
|
||
gpio_enable : in std_logic;
|
||
|
||
-- pia
|
||
porta_in : out std_logic_vector(7 downto 0);
|
||
porta_out : in std_logic_vector(7 downto 0);
|
||
porta_output : in std_logic_vector(7 downto 0);
|
||
CA1_IN : OUT STD_LOGIC;
|
||
CA2_DIR_OUT : IN std_logic;
|
||
CA2_OUT : IN std_logic;
|
||
CA2_IN : OUT STD_LOGIC;
|
||
CB1_IN : OUT STD_LOGIC;
|
||
CB2_DIR_OUT : IN std_logic;
|
||
CB2_OUT : IN std_logic;
|
||
CB2_IN : OUT STD_LOGIC;
|
||
|
||
-- gtia
|
||
trig_in : out std_logic_vector(3 downto 0);
|
||
|
||
-- antic
|
||
lightpen : out std_logic;
|
||
|
||
-- pokey
|
||
pot_reset : in std_logic;
|
||
pot_in : out std_logic_vector(7 downto 0);
|
||
keyboard_scan : in std_logic_vector(5 downto 0);
|
||
keyboard_response : out std_logic_vector(1 downto 0);
|
||
SIO_IN : OUT STD_LOGIC;
|
||
SIO_OUT : IN STD_LOGIC;
|
||
SIO_CLOCKIN : OUT STD_LOGIC;
|
||
SIO_CLOCKOUT : IN STD_LOGIC;
|
||
|
||
-- cartridge
|
||
enable_179_early : in std_logic;
|
||
pbi_addr_out : in std_logic_vector(15 downto 0);
|
||
pbi_write_enable : in std_logic;
|
||
cart_data_read : out std_logic_vector(7 downto 0);
|
||
cart_request : in std_logic;
|
||
cart_complete : out std_logic;
|
||
cart_data_write : in std_logic_vector(7 downto 0);
|
||
rd4 : out std_logic;
|
||
rd5 : out std_logic;
|
||
s4_n : in std_logic;
|
||
s5_n : in std_logic;
|
||
cctl_n : in std_logic;
|
||
|
||
-- gpio connections
|
||
GPIO_0_IN : in std_logic_vector(35 downto 0);
|
||
GPIO_0_OUT : out std_logic_vector(35 downto 0);
|
||
GPIO_0_DIR_OUT : out std_logic_vector(35 downto 0);
|
||
GPIO_1_IN : in std_logic_vector(35 downto 0);
|
||
GPIO_1_OUT : out std_logic_vector(35 downto 0);
|
||
GPIO_1_DIR_OUT : out std_logic_vector(35 downto 0)
|
||
);
|
||
end gpiov3;
|
||
|
||
architecture vhdl of gpiov3 is
|
||
signal shift_next : std_logic_vector(71 downto 0);
|
||
signal shift_reg : std_logic_vector(71 downto 0);
|
||
begin
|
||
CA2_in <= '1';
|
||
CB2_in <= '1';
|
||
SIO_IN <= '1';
|
||
|
||
pot_in <= (others=>'0');
|
||
porta_in <= (others=>'1');
|
||
trig_in_async <= "0111";
|
||
|
||
lightpen <= '1';
|
||
|
||
-- keyboard
|
||
keyboard_response <= '1';
|
||
|
||
cart_data_read <= '1';
|
||
cart_complete'<= (others=>'0');
|
||
|
||
rd4 <= '0';
|
||
rd5 <= '0';
|
||
|
||
process(clk,reset_n)
|
||
begin
|
||
if (reset_n=='0') then
|
||
shift_reg(71 downto 1) <= (others=>'0');
|
||
shift_reg(0) <= '1';
|
||
elsif (clk'event and clk='1') then
|
||
shift_reg <= shift_next;
|
||
end if
|
||
end process;
|
||
|
||
process(shift_reg,enable_179_early)
|
||
begin
|
||
shift_next <= shift_reg;
|
||
if (enable_179_early = '1') then
|
||
shift_next(71 downto 1) <= shift_reg(70 downto 0);
|
||
shift_next(0) <= shift_reg(71);
|
||
end if;
|
||
end process;
|
||
|
||
GPIO_0_OUT <= shift_reg(71 downto 36);
|
||
GPIO_0_DIR_OUT <= (others=>'1');
|
||
GPIO_1_OUT <= shift_reg(35 downto 0);
|
||
GPIO_1_DIR_OUT <= (others=>'1');
|
||
|
||
end vhdl;
|
||
|
Also available in: Unified diff
fix keyboard. Add a hardware test gpio version to just turn on each pin in turn.