From: Vladimir Burian Date: Sun, 17 Apr 2011 11:18:21 +0000 (+0200) Subject: MCU interface to Qcount (32-bit output) X-Git-Url: http://rtime.felk.cvut.cz/gitweb/fpga/virtex2/msp_motion.git/commitdiff_plain/5c780ffcc66ec4a62bd4e6f5bfe3aef63a837ed9 MCU interface to Qcount (32-bit output) --- diff --git a/msp_motion.prj b/msp_motion.prj index adab074..e33c4e8 100644 --- a/msp_motion.prj +++ b/msp_motion.prj @@ -66,6 +66,7 @@ vhdl work quadcount/qcounter.vhd #==============================================================================# vhdl work mcu_periph/gpio.vhd +vhdl work mcu_periph/qcounter_mcu16.vhd #==============================================================================# diff --git a/msp_motion.vhd b/msp_motion.vhd index 286c022..4edb457 100644 --- a/msp_motion.vhd +++ b/msp_motion.vhd @@ -68,6 +68,9 @@ architecture rtl of msp_motion is signal GPIO_OUT : std_logic_vector (15 downto 0); signal GPIO_DAT_O : std_logic_vector (15 downto 0); signal GPIO_SEL : std_logic; + -- Qcounter MCU interface + signal QCNT_DAT_O : std_logic_vector (15 downto 0); + signal QCNT_SEL : std_logic; ------------------------------------------------------------------------------ -- Dual-port shared memory @@ -168,9 +171,11 @@ begin -- Peripheral bus address decoder and data multiplexer. ------------------------------------------------------------------------------ per_dout <= GPIO_DAT_O when GPIO_SEL = '1' else + QCNT_DAT_O when QCNT_SEL = '1' else (others => '0'); -- MUST be 0 when nothing is addressed GPIO_SEL <= '1' when per_addr(7 downto 2) = 16#0140#/2/4 else '0'; + QCNT_SEL <= '1' when per_addr(7 downto 1) = 16#0148#/2/2 else '0'; ------------------------------------------------------------------------------ @@ -197,6 +202,15 @@ begin GPIO_I => GPIO_IN, GPIO_O => GPIO_OUT); + qcounter_mcu16_0 : entity work.qcounter_mcu16 + port map ( + ACK_O => open, + ADR_I => per_addr (0), + CLK_I => mclk, + DAT_O => QCNT_DAT_O, + SEL_I => QCNT_SEL, + STB_I => per_en, + QCOUNT => QCNT); ------------------------------------------------------------------------------