38
007- rst: OUT STD_LOGIC;
-- uC reset
008- oeb: OUT STD_LOGIC;
-- RAM output enable
009- kb_data: IN STD_LOGIC;-- serial data from the keyboard
010- kb_clk: IN STD_LOGIC; -- clock from the keyboard
011- db: OUT STD_LOGIC_VECTOR(8 DOWNTO 1);
-- bargraph LED
012- rsb: OUT STD_LOGIC_VECTOR(6 DOWNTO 0)
-- right LED digit
013- );
014- END kbd_read;
015-
016- ARCHITECTURE kbd_read_arch OF kbd_read IS
017- SIGNAL scancode: STD_LOGIC_VECTOR(9 DOWNTO 0);
018- COMPONENT ibuf PORT(i: IN STD_LOGIC; o: OUT STD_LOGIC); END COMPONENT;
019- COMPONENT bufg PORT(i: IN STD_LOGIC; o: OUT STD_LOGIC); END COMPONENT;
020- SIGNAL buf_clk0, buf_clk1: STD_LOGIC;
021- BEGIN
022- rst <= '1'; -- keep the uC in the reset state
023- oeb <= '1'; -- disable the RAM output drivers
024-
025- b0: ibuf PORT MAP(i=>kb_clk,o=>buf_clk0); -- buffer the clock from
026- b1: bufg PORT MAP(i=>buf_clk0,o=>buf_clk1); -- the keyboard
027-
028- -- shift keyboard data into the MSb of the scancode register
029- -- on the falling edge of the keyboard clock
030- gather_scancode:
031- PROCESS(buf_clk1,scancode)
032- BEGIN
033- IF(buf_clk1'EVENT AND buf_clk1='0') THEN
034- scancode <= kb_data & scancode(9 DOWNTO 1);
035- END IF;
036- END PROCESS;
037-
038- db <= NOT(scancode(7 DOWNTO 0)); -- show scancode on the bargraph
039-
040- -- display the key that was pressed on the right LED digit
041- rsb <= "1101101" WHEN scancode(7 DOWNTO 0)="00010110" ELSE
-- 1
042- "0100010" WHEN scancode(7 DOWNTO 0)="00011110" ELSE
-- 2
043- "0100100" WHEN scancode(7 DOWNTO 0)="00100110" ELSE
-- 3
044- “1000101" WHEN scancode(7 DOWNTO 0)="00100101" ELSE
-- 4
045- "0010100" WHEN scancode(7 DOWNTO 0)="00101110" ELSE
-- 5
046- "0010000" WHEN scancode(7 DOWNTO 0)="00110110" ELSE
-- 6
047- "0101101" WHEN scancode(7 DOWNTO 0)="00111101" ELSE
-- 7
048- "0000000" WHEN scancode(7 DOWNTO 0)="00111110" ELSE
-- 8
049- "0000100" WHEN scancode(7 DOWNTO 0)="01000110" ELSE
-- 9
050- "0001000" WHEN scancode(7 DOWNTO 0)="01000101" ELSE
-- 0
051- "0010010";
-- E
052- END kbd_read_arch;
•
Listing 21:
XS40 UCF file for the PS/2 keyboard interface.
001- net rst
loc=p36;
002- net oeb
loc=p61;
003- net kb_data
loc=p69;
004- net kb_clk
loc=p68;
Summary of Contents for XStend XS40
Page 17: ...16 Figure 5 Programmer s model of the XS40 XStend Board combination...
Page 18: ...17...
Page 20: ......
Page 31: ......
Page 33: ......
Page 41: ......
Page 58: ...Appendix A XStend Schematics...
Page 59: ...XStend V1 3 XS Board Connectors...
Page 60: ...XStend V1 3 RAM...
Page 61: ......
Page 62: ...XStend V1 3 Stereo Codec...
Page 63: ......