USB-IK01 User‟s Manual
9
<VHDL Source>
decode_prog:process(nRESET,MM)
begin
if ( nRESET = '0') then
nCE <= "11";
nOE <= "11";
EA <= '0';
else
case MM is
when "00" =>
-- No external memory
nCE <= "11";
nOE <= "11";
EA <= '0';
when "01" =>
-- RAM is located at address 0x8000
nCE(2) <= not A(15);
nCE(1) <= '1';
nOE(2) <= nPSEN and PC(7);
nOE(1) <= '1';
EA <= '0';
when "10" =>
-- RAM(0x0) ROM(0x8000)
nCE(2) <= A(15);
nCE(1) <= not A(15);
nOE(2) <= nPSEN and PC(7);
nOE(1) <= nPSEN and PC(7);
EA <= '0';
when "11" =>
-- ROM(0x0), RAM(0x8000)
nCE(2) <= not A(15);
nCE(1) <= A(15);
nOE(2) <= nPSEN and PC(7);
nOE(1) <= nPSEN and PC(7);
EA <= '1';
when others => NULL;
end case;
end if;
end process;
nWE <= PC(6);
-- Write enable
USER <= (others => '0');
SM1 <= BOOT;
nCON <= BOOT;
nPROG <= PA(0) when PA(1) = '0' else CLK1MHz;
SPARE(1) <= CLK1MHz;
nWAKEUP <= nINT and nSW_ST;
PA2 <= nSW_ST;
PA3 <= nINT;
SPARE(2) <= A(14) and BKPT;