1 -------------------------------------------------------------------------------
2 --! @file interface_RTX_Base.vhd
3 --! @author Michael Riedel
4 --! @author Marc Kossmann
7 --! @brief Interface Base-File (RTX) to embed Qsys-outputAssignments->))
10 --! @details v0.1.0 28.10.2014 Kossmann
12 --! @details v1.0.0 03.11.2014 Riedel
13 --! - corrected documentation and indention
14 --! @details v1.0.1 05.11.2014 Riedel
15 --! - renamed led-outputs in StepperMotorControl-Component
16 --! - removed unused-comments and corrected formatting
17 -------------------------------------------------------------------------------
19 --! Use Standard Library
21 --! Use Logic Elements
22 USE ieee.std_logic_1164.
all;
28 --! @brief Base-Entity. This Entity describes the connection
35 SRAM_A : OUT (17 DOWNTO 0);
--! SRAM address lines
36 SRAM_D : INOUT (15 DOWNTO 0);
--! SRAM-data bus
39 SRAM_OE_N : OUT ;
--! SRAM output enable (read) line
42 KEY : IN (3 DOWNTO 0);
--! key-definition
43 SW : IN (9 DOWNTO 0);
--! slidINg switches
44 LED9 : OUT ;
--! debug LEDs
45 LEDG : OUT (7 DOWNTO 0);
--! green leds
46 LEDR : OUT (7 DOWNTO 0);
--! red leds
47 HEX0 : OUT (6 DOWNTO 0);
--! HEX display 0
48 HEX1 : OUT (6 DOWNTO 0);
--! HEX display 1
49 HEX2 : OUT (6 DOWNTO 0);
--! HEX display 2
50 HEX3 : OUT (6 DOWNTO 0);
--! HEX display 3
53 LCD_DQ : INOUT (7 DOWNTO 0) := (OTHERS => '0');
--! LCD data
55 HSMC_RX_P : OUT (16 DOWNTO 0);
--! Motor_pwm1( bit 0 ) and Motor_pwm2( bit 1 )
56 HSMC_RX_N : OUT (16 DOWNTO 0);
--! Motor_pwm3( bit 0 ) and Motor_pwm4( bit 1 )
57 HSMC_TX_N : OUT (16 DOWNTO 0);
--! Motor_en_a( bit 2 )
58 HSMC_TX_P : OUT (16 DOWNTO 0) --! Motor_en_b( bit 3 )
60 END interface_RTX_Base;
62 --! @brief NIOS-Processor with SOPC-Peripherals
65 COMPONENT StepperMotorControl
IS
68 reset_reset_n :
IN := '
0';
70 sram_SRAM_OE_N :
OUT (
0 DOWNTO 0);
71 sram_SRAM_CE_N :
OUT (
0 DOWNTO 0);
72 sram_SRAM_BE_N :
OUT (
1 DOWNTO 0);
73 sram_SRAM_D :
INOUT (
15 DOWNTO 0) := (
OTHERS => '
0');
74 sram_SRAM_A :
OUT (
18 DOWNTO 0);
75 sram_SRAM_WE_N :
OUT (
0 DOWNTO 0);
76 sw_export :
IN (
9 DOWNTO 0) := (
OTHERS => '
0');
79 lcd_data :
INOUT (
7 DOWNTO 0) := (
OTHERS => '
0');
81 key_export :
IN (
3 DOWNTO 0) := (
OTHERS => '
0');
82 hex0_export :
OUT (
6 DOWNTO 0);
83 hex1_export :
OUT (
6 DOWNTO 0);
84 hex2_export :
OUT (
6 DOWNTO 0);
85 hex3_export :
OUT (
6 DOWNTO 0);
87 registers_conduit_nios_redleds :
OUT (
7 DOWNTO 0);
88 registers_conduit_nios_greenleds :
OUT (
7 DOWNTO 0);
89 mcu_conduit_motor_motor_pwm :
OUT (
3 DOWNTO 0);
90 mcu_conduit_motor_motor_en :
OUT (
1 DOWNTO 0)
92 END COMPONENT StepperMotorControl;
94 SIGNAL be_n : (1 DOWNTO 0);
--! Byte enable signals
95 SIGNAL motor_pwm_wire : (3 DOWNTO 0);
96 SIGNAL motor_en_wire : (1 DOWNTO 0);
109 LEDG(3) <= motor_pwm_wire(3);
110 LEDG(2) <= motor_pwm_wire(1);
111 LEDG(1) <= motor_pwm_wire(2);
112 LEDG(0) <= motor_pwm_wire(0);
118 LEDG(5 DOWNTO 4) <= motor_en_wire;
120 u0 :
COMPONENT StepperMotorControl
127 sram_SRAM_BE_N => be_n,
129 sram_SRAM_A
(18 DOWNTO 1) =>
SRAM_A ,
142 registers_conduit_nios_redleds =>
LEDR,
143 --registers_conduit_nios_greenleds => LEDG
144 mcu_conduit_motor_motor_pwm => motor_pwm_wire,
145 mcu_conduit_motor_motor_en => motor_en_wire
out HSMC_TX_PSTD_LOGIC_VECTOR(16 DOWNTO0)
Motor_en_b( bit 3 )
in CPU_RESET_nSTD_LOGIC
CPU reset_n.
in KEYSTD_LOGIC_VECTOR(3 DOWNTO0)
key-definition
inout SRAM_DSTD_LOGIC_VECTOR(15 DOWNTO0)
SRAM-data bus.
out HSMC_RX_PSTD_LOGIC_VECTOR(16 DOWNTO0)
Motor_pwm1( bit 0 ) and Motor_pwm2( bit 1 )
out LEDRSTD_LOGIC_VECTOR(7 DOWNTO0)
red leds
out HEX0STD_LOGIC_VECTOR(6 DOWNTO0)
HEX display 0.
out SRAM_UB_NSTD_LOGIC
SRAM upper byte linkage.
in SWSTD_LOGIC_VECTOR(9 DOWNTO0)
slidINg switches
out LED9STD_LOGIC
debug LEDs
_library_ ieeeieee
Use Standard Library.
Base-Entity. This Entity describes the connection to DE2-Board.
out HSMC_TX_NSTD_LOGIC_VECTOR(16 DOWNTO0)
Motor_en_a( bit 2 )
out LCD_RSSTD_LOGIC
LCD RS.
out HEX3STD_LOGIC_VECTOR(6 DOWNTO0)
HEX display 3.
out HEX1STD_LOGIC_VECTOR(6 DOWNTO0)
HEX display 1.
out SRAM_CE_NSTD_LOGIC
SRAM chip enable.
out LEDGSTD_LOGIC_VECTOR(7 DOWNTO0)
green leds
out SRAM_WE_NSTD_LOGIC
SRAM write enable line.
out LCD_ENSTD_LOGIC
LCD enable.
out LCD_RWSTD_LOGIC
LCD RW.
out SRAM_ASTD_LOGIC_VECTOR(17 DOWNTO0)
SRAM address lines.
out SRAM_LB_NSTD_LOGIC
SRAM lower byte line.
out HSMC_RX_NSTD_LOGIC_VECTOR(16 DOWNTO0)
Motor_pwm3( bit 0 ) and Motor_pwm4( bit 1 )
out HEX2STD_LOGIC_VECTOR(6 DOWNTO0)
HEX display 2.
inout LCD_DQSTD_LOGIC_VECTOR(7 DOWNTO0):=(others=> '0')
LCD data.
out SRAM_OE_NSTD_LOGIC
SRAM output enable (read) line.
in CLOCK_50_B5BSTD_LOGIC
50 MHz Oscillator