1 COMP541 Input Devices: Keyboards, Mice and Joysticks Montek Singh Apr 16, 2012.

Slides:



Advertisements
Similar presentations
INPUT-OUTPUT ORGANIZATION
Advertisements

Microprocessor Dr. Rabie A. Ramadan Al-Azhar University Lecture 4.
Input and Output CS 215 Lecture #20.
Programmable Keyboard/ Display Interface: 8279
Bits and Bytes + Controlling 8 LED with 3 Pins Binary Counting and Shift Registers.
Processor System Architecture
Henry Hexmoor1 Chapter 7 Henry Hexmoor Registers and RTL.
EE 316 Computer Engineering Junior Lab Word Mastermind.
EE 316 Computer Engineering Junior Lab PS/2 Keyboard.
1 COMP541 Joysticks Anselmo Lastra. 2 Atari 2600 Joystick
Other I/O LCD display Flash ROM Keyboard (PS/2) UART connectors.
1 Sec (2.1) Computer Architectures. 2 For temporary storage of information, the CPU contains cells, or registers, that are conceptually similar to main.
PS/2 Mouse/Keyboard Port Lecture L9.4. PS/2 Port.
1 COMP541 Keyboard Interface Montek Singh April 9, 2007.
Spring EE 316 Computer Engineering Junior Lab LCD modules, PROMs, Serial Ports.
9/20/6Lecture 3 - Instruction Set - Al Hardware interface (part 2)
COMP541 Input Devices: Keyboards, Mice and Joysticks
EE 316 Computer Engineering Junior Lab Digital Hangman.
1 COMP541 Completing the MIPS Datapath Montek Singh Mar 27, 2007.
1 COMP541 State Machines – 2 Registers and Counters Montek Singh Feb 8, 2007.
Interface circuits I/O interface consists of the circuitry required to connect an I/O device to a computer bus. Side of the interface which connects to.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Joystick Anselmo Lastra.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Counters and Registers
1 Keyboard Controller Design By Tamas Kasza Digital System Design 2 (ECE 5572) Summer 2003 Presentation for.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Keyboard Interface Anselmo Lastra.
PS/2 Mouse/Keyboard Port Discussion D7.2. PS/2 Port.
PS2 Keyboard Interface Using Spartan-3 Starter Kit Board
INPUT-OUTPUT ORGANIZATION
CHARACTERS Data Representation. Using binary to represent characters Computers can only process binary numbers (1’s and 0’s) so a system was developed.
Transmission Modes Serial Transmission  One bit is transmitted on a circuit at a time  Usually there is one transmit circuit and one receive circuit.
Digilent System Board Capabilities Serial Port (RS-232) Parallel Port 1 Pushbutton Hint: Good for a reset button Connected to a clock input. See Digilent.
Universal Synchronous/Asynchronous Receiver/Transmitter (USART)
DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK
EE4OI4 Engineering Design UP1core Library Functions.
1 COMP541 Final Missing Pieces of MIPS: Adding Memory & I/O Montek Singh Apr 11, 2012.
MODES OF Details of Pins Pin 1GND –Connected Ground Pins 2-16 AD14-AD0–acts as both input/output. Outputs address at the first part of the cycle.
8279 KEYBOARD AND DISPLAY INTERFACING
EE 316 Computer Engineering Junior Lab Serial Ports, LCD Displays & PROMs.
1 COMP541 Input Devices: Keyboards, Mice and Joysticks Montek Singh Apr 6, 2015.
PPI-8255.
8279 KEYBOARD AND DISPLAY INTERFACING
PS/2 Mouse/Keyboard Port
Digital Computer Concept and Practice Copyright ©2012 by Jaejin Lee Control Unit.
1 COMP541 State Machines – 2 Registers and Counters Montek Singh Feb 11, 2010.
The Spartan®-3E FPGA Starter Kit board. A computer mouse is designed mainly to detect two-dimensional motion on a surface. Its internal circuit measures.
UNIT 7 - INTRODUCTION TO I/O INTERFACING. TWO MAJOR TYPES OF I/O INTERFACING ISOLATED I/O - DEDICATED I/O INSTRUCTIONS ARE USED TO ACCESS I/O DEVICES.
1 COMP541 Datapaths I Montek Singh Mar 8, Topics  Over next 2/3 classes: datapaths  Basic register operations Book sections 7-2 to 7-6 and 7-8.
Chapter 3 System Buses.  Hardwired systems are inflexible  General purpose hardware can do different tasks, given correct control signals  Instead.
8085 INTERNAL ARCHITECTURE.  Upon completing this topic, you should be able to: State all the register available in the 8085 microprocessor and explain.
1 Digital Logic Design Engr. Kashif Shahzad. 2 What’s Course About?  Digital logic, focusing on the design of computers  Stay above transistor level.
REGISTER TRANSFER LANGUAGE (RTL) INTRODUCTION TO REGISTER Registers1.
Keyboard Introduction Keyboard is an input device. It is used to give text, numbers and controls as input to computer. The.
PlayStation 2 DualShock 2 Controller Ryan O’Keefe, Kabir Singh and Adrian Padin 1.
1 COMP541 Video Monitors Montek Singh Mar 11, 2016.
1 COMP541 Final Missing Pieces of MIPS: Adding Memory & I/O Montek Singh Apr 6, 2010.
INTERFACING KEYBOARD WITH ATMEGA32 ELECTRONICS & COMMUNICATION TITLE.
COMP541 Video Monitors Montek Singh Oct 7, 2016.
The HCS12 SCI Subsystem A HCS12 device may have one or two serial communication interface. These two SCI interfaces are referred to as SCI0 and SCI1. The.
Chapter 6 Input/Output Organization
REGISTER TRANSFER LANGUAGE (RTL)
COMP541 Input Devices: Keyboards, Mice and Joysticks
Clocks, I/O devices, Thin Clients, and Power Management
Serial I/O and Data Communication.
COMP541 Input Devices: Keyboards, Mice and Joysticks
1 Input-Output Organization Computer Organization Computer Architectures Lab Peripheral Devices Input-Output Interface Asynchronous Data Transfer Modes.
EEL 3705 / 3705L Digital Logic Design
Serial Communication Interface: Using 8251
Registers Today we’ll see some common sequential devices: counters and registers. They’re good examples of sequential analysis and design. They are also.
Interfacing keyboard with FPGA
Presentation transcript:

1 COMP541 Input Devices: Keyboards, Mice and Joysticks Montek Singh Apr 16, 2012

Keyboard Interface

3 PS/2 Keyboard  Uses a synchronous serial protocol What does that mean? What does that mean? Each symbol is transmitted bit-by-bit Each symbol is transmitted bit-by-bit  8 data bits + 3 control bits

4 Physical Interface  Two lines Clock (15-20KHz) Clock (15-20KHz) Data Data Normally high, asserted low Normally high, asserted low  Read: pp of Nexys 3 manual pp of Nexys 3 manual

5Protocol  Bidirectional Kybd-to-host and host-to-kybd on same wires Kybd-to-host and host-to-kybd on same wires  CAPS LOCK light for example  Assert low To send, keyboard starts clocking To send, keyboard starts clocking  sends successive bit on positive edge of clock  host reads bits on negative edges of clock  You shouldn’t need to send to kybd

Protocol  11 bits a start bit: always 0 a start bit: always 0 8 bits of data 8 bits of data  lsb first one parity bit (odd) one parity bit (odd) a stop bit: always 1 a stop bit: always 1  Clocked by keyboard Value should be latched by FPGA on neg edge of keyboard clock Value should be latched by FPGA on neg edge of keyboard clock 6 Illustration from

7 What is Sent  ASCII is not sent!  Scan codes for keys Most keys have an 8-bit (single byte) scancode Most keys have an 8-bit (single byte) scancode Some have two bytes Some have two bytes A few have even more! A few have even more! Most (not all, be careful!) keyboards use these scancodes: Most (not all, be careful!) keyboards use these scancodes: Illustration from Nexys 3 manual

8 Scan Codes  Normally translated by software You remap your keys, for example You remap your keys, for example  Software takes care of Shift, caps lock, control Shift, caps lock, control

9 Some Scan Codes Long  Two code sequence common Have a look at Break key! Have a look at Break key!

10 Even More Complicated  Scan code generated when you press  And when you release Two bytes: F0 followed by key scan code Two bytes: F0 followed by key scan code Example: Example:  Space pressed, 29 sent  Space released, F0 29 sent  If you hold key, scan code repeated

11Resources  Information  Scan codes  My Verilog for keyboard is on the class website

12 My Verilog  Have Verilog for keyboard  Have tested it with the FPGA kit; seems to work fine  To use: You should memory-map the character code register You should memory-map the character code register  give the keyboard a memory address so the CPU can read it using lw instructions Handle presses and releases appropriately in software Handle presses and releases appropriately in software  maybe add another register to indicate that a new character has arrived..??

Mice 13

Mouse  Very similar interface (clk & data) But: 3 words sent w/ mouse movement or button press But: 3 words sent w/ mouse movement or button press  Read pp of Nexys 3 manual pp of Nexys 3 manual 14

Movement  Movement is relative XS, YS are sign (+ is up/right) XS, YS are sign (+ is up/right) XV, YV are overflow (too fast) XV, YV are overflow (too fast) L, R are buttons L, R are buttons 15

Scroll Wheel, etc.  Extensions to original 2 button PS/2 mouse See See

Joystick (Courtesy Anselmo Lastra)

Atari 2600 Joystick (we only have 2-3) 18

We Have Sega Joypads (we have 5-6)  Enhanced version with more buttons Has mux Has mux Select pin chooses first or second set of buttons, L/R Select pin chooses first or second set of buttons, L/R 19

Six Button Use  See  Use select to use buttons B & C  To use X, Y, Z, need to pulse select 20

NEXYS Mappings (PMOD JA)  We have to connect them using wires… 21 SignalFPGA PinDB-910- Pin UpM1514 DownL1723 LeftL1638 RightK1242 Btn A/BM1469 Start/CL1591 SelectM16710 Ground-85 Power-56 PMOD JA is 10-pin connector nearest VGA connector

Suggestion  Create FF for Select Memory map so you can set from CPU Memory map so you can set from CPU  Memory map the input signals I would not latch them I would not latch them  Please power off when plugging or unplugging Sega joypads! Careful when plugging in PCB Careful when plugging in PCB 22

23Links     