OpenCores
URL https://opencores.org/ocsvn/usb_dongle_fpga/usb_dongle_fpga/trunk

Subversion Repositories usb_dongle_fpga

[/] [usb_dongle_fpga/] [trunk/] [src/] [design_top/] [design_top_thincandbg.vhd] - Diff between revs 26 and 35

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 26 Rev 35
Line 274... Line 274...
signal    umem_wr    : std_logic;
signal    umem_wr    : std_logic;
signal    umem_val   : std_logic;
signal    umem_val   : std_logic;
signal    umem_ack   : std_logic;
signal    umem_ack   : std_logic;
signal    umem_cmd   : std_logic;
signal    umem_cmd   : std_logic;
signal    enable_4meg: std_logic;
signal    enable_4meg: std_logic;
 
signal    dongle_con_n : std_logic;
 
 
constant dongle_ver  : std_logic_vector(15 downto 0):=x"8605";
constant dongle_ver  : std_logic_vector(15 downto 0):=x"8605";
--END USB signals
--END USB signals
 
 
begin
begin
 
 
--GPIO PINS START
--GPIO PINS START
fl_sts_en <='Z';
fl_sts_en <='Z';
hdr(1) <= fl_sts when resetn='1' else
 
                  '0';
hdr(1) <= dongle_con_n;
 
--hdr(1) <= fl_sts when resetn='1' else
 
--                '0';
 
 
--when jumper on then mem read and firmware read enabled else only firmware read
--when jumper on then mem read and firmware read enabled else only firmware read
hdr(0) <= 'Z';
hdr(0) <= 'Z';
lena_mem_r <= not hdr(0); -- disabled if jumper is not on header pins 1-2
lena_mem_r <= not hdr(0); -- disabled if jumper is not on header pins 1-2
 
 
-- jumper on pins 5,6 then postcode only mode (no mem device)
-- jumper on pins 5,6 then postcode only mode (no mem device)
hdr(2) <= '0'; --create low pin for jumper pair 5-6 (this pin is 6 on J1 header)
hdr(2) <= '0'; --create low pin for jumper pair 5-6 (this pin is 6 on J1 header)
lena_reads <= hdr(3) and mem_idle; -- disabled if jumper is on (jumper makes it a postcode only device) paired with hdr(2) pins 5,6 and when usb control is not accessing flash
lena_reads <= hdr(3) and mem_idle and (not dongle_con_n); -- disabled if jumper is on (jumper makes it a postcode only device) paired with hdr(2) pins 5,6 and when usb control is not accessing flash
 
 
 
 
-- when jumper on pins 7,8 then post code capture mode enabled
-- when jumper on pins 7,8 then post code capture mode enabled
hdr(4)<= '0';
hdr(4)<= '0';
dbg_usb_mode_en <= not hdr(5);  --weak pullup on hdr(5) paired with hdr(4)
dbg_usb_mode_en <= not hdr(5);  --weak pullup on hdr(5) paired with hdr(4)
Line 425... Line 428...
                if lreset_n='0' then
                if lreset_n='0' then
                        lpc_debug(7 downto 0)<=(others=>'0');
                        lpc_debug(7 downto 0)<=(others=>'0');
                        c33_dbg_addr_d <=(others=>'0');
                        c33_dbg_addr_d <=(others=>'0');
                        enable_4meg <='0';
                        enable_4meg <='0';
                        c33_lpc_wr <='0';
                        c33_lpc_wr <='0';
 
                        dongle_con_n <='0';  -- pin 3 in GPIO make it toggleable
                elsif lclk'event and lclk = '1' then    -- rising clock edge
                elsif lclk'event and lclk = '1' then    -- rising clock edge
                        c33_lpc_wr <= lpc_wr;
                        c33_lpc_wr <= lpc_wr;
                        if c33_lpc_wr='0' and  lpc_wr='1' then
                        if c33_lpc_wr='0' and  lpc_wr='1' then
                                c33_dbg_addr_d <= lpc_addr(7 downto 0);
                                c33_dbg_addr_d <= lpc_addr(7 downto 0);
                                lpc_debug(7 downto 0)<= lpc_data_o;
                                lpc_debug(7 downto 0)<= lpc_data_o;
                                if lpc_addr(7 downto 0)=x"88" and lpc_data_o=x"4F" then   --Flash 4 Mega enable (LSN is first MSN is second)
                                if lpc_addr(7 downto 0)=x"88" and lpc_data_o=x"F4" then   --Flash 4 Mega enable (LSN is first MSN is second)
                                        enable_4meg <='1';
                                        enable_4meg <='1';
                                elsif lpc_addr(7 downto 0)=x"88" and lpc_data_o=x"1F" then --Flash 1 Mega enalbe
                                elsif lpc_addr(7 downto 0)=x"88" and lpc_data_o=x"F1" then --Flash 1 Mega enalbe
                                        enable_4meg <='0';
                                        enable_4meg <='0';
 
                                elsif lpc_addr(7 downto 0)=x"88" and lpc_data_o=x"D1" then --Set Dongle not attached signal
 
                                        dongle_con_n <='1';  -- pin 3 in GPIO make it 1
 
                                elsif lpc_addr(7 downto 0)=x"88" and lpc_data_o=x"D0" then --Set Dongle attached signal
 
                                        dongle_con_n <='0';  -- pin 3 in GPIO make it 1                                                                          
                                end if;
                                end if;
                        end if;
                        end if;
                end if;
                end if;
        end process LATCHled;
        end process LATCHled;
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.