COMP541 Input Devices: Keyboards, Mice and Joysticks

Slides:



Advertisements
Similar presentations
INPUT-OUTPUT ORGANIZATION
Advertisements

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.
Other I/O LCD display Flash ROM Keyboard (PS/2) UART connectors.
1 COMP541 Keyboard Interface Montek Singh April 9, 2007.
3D Wireless Mouse Shirley Li Matt Tanwentang Joseph Cheng.
Timers and Interrupts Shivendu Bhushan Summer Camp ‘13.
COMP541 Input Devices: Keyboards, Mice and Joysticks
EE 316 Computer Engineering Junior Lab Digital Hangman.
1 COMP541 State Machines – 2 Registers and Counters Montek Singh Feb 8, 2007.
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
Little arduino microcontrollers Meghan Jimenez 12 February 2014.
1 COMP541 Input Devices: Keyboards, Mice and Joysticks Montek Singh Apr 16, 2012.
EE4OI4 Engineering Design UP1core Library Functions.
Overview What is Arduino? What is it used for? How to get started Demonstration Questions are welcome at any time.
8279 KEYBOARD AND DISPLAY INTERFACING
Practical Session 11 Computer Architecture and Assembly Language Input &Output (I/O)
Shift Registers pp Shift Registers Capability to shift bits ♦ In one or both directions Why? ♦ Part of standard CPU instruction set ♦ Cheap.
1 COMP541 Input Devices: Keyboards, Mice and Joysticks Montek Singh Apr 6, 2015.
8279 KEYBOARD AND DISPLAY INTERFACING
PS/2 Mouse/Keyboard Port
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.
Practical Session 11 Computer Architecture and Assembly Language Input &Output (I/O)
MICROCONTROLLER AND INTERFACING Presented by: Shefali Jethva ( ) Shivali Panchal ( ) Komal Soni ( ) Roll no. :- 14EC308.
1 COMP541 Final Missing Pieces of MIPS: Adding Memory & I/O Montek Singh Apr 6, 2010.
INTERFACING KEYBOARD WITH ATMEGA32 ELECTRONICS & COMMUNICATION TITLE.
My Power point  By: William Curtiss. Power Point Power point is a software that makes a virtual project or presentation.
Lecture Input Devices Keyboard. Mouse Microphone Digital Camera Scanner.
Digital Logic Design Alex Bronstein
COMP541 Video Monitors Montek Singh Oct 7, 2016.
Computer System Structures
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.
Serial I/O Port.
Michael Rahaim, PhD Candidate Multimedia Communications Lab
COMP541 Video Monitors Montek Singh Sep 15, 2017.
Chapter 6 Input/Output Organization
Peripherals – Keypad The Keypad provides a simple means of numerical data or control input. The keys can be attributed whatever data or control values.
REGISTER TRANSFER LANGUAGE (RTL)
COMP541 Input Devices: Keyboards, Mice and Joysticks
Microcontrollers & GPIO
Control Unit Lecture 6.
COMP541 Video Monitors Montek Singh Feb 20, 2015.
Operating Systems (CS 340 D)
Serial I/O and Data Communication.
1 Input-Output Organization Computer Organization Computer Architectures Lab Peripheral Devices Input-Output Interface Asynchronous Data Transfer Modes.
Principles & Applications
Pulse Width Modulation (PWM)
Source: Serial Port Source:
EEL 3705 / 3705L Digital Logic Design
Interrupts, Tasks and Timers
Asynchronous Serial Communications
AT91 Memory Interface This training module describes the External Bus Interface (EBI), which generatesthe signals that control the access to the external.
Input devices A piece of equipment that allows the user to give instructions and input data to the computer.
Computer Architecture and Assembly Language
COMP541 Video Monitors Montek Singh Feb 6, 2019.
Source: Serial Port Source:
8253 – PROGRAMMABLE INTERVAL TIMER (PIT). What is a Timer? Timer is a specialized type of device that is used to measure timing intervals. Timers can.
Chapter 8 I/O.
Wireless Embedded Systems
Registers Today we’ll see some common sequential devices: counters and registers. They’re good examples of sequential analysis and design. They are also.
Source: Serial Port Source:
Interfacing keyboard with FPGA
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

COMP541 Input Devices: Keyboards, Mice and Joysticks Montek Singh Sep 22, 2017

USB keyboard plugs into the USB port on Nexys 4 boards Keyboard Interface USB keyboard plugs into the USB port on Nexys 4 boards

USB to PS/2 emulation Host controller on Nexys boards talks to USB keyboard on one side speaks PS/2 protocol to the FPGA on the other side PS/2 used to be the dominant keyboard protocol PS/2 = a synchronous serial protocol What does that mean? Each symbol is transmitted bit-by-bit 8 data bits + 3 control bits synchronized to the keyboard’s clock (slow)

Physical Interface Two lines Read: Clock (15-20KHz) Data Normally high, asserted low Read: pg. 10-11 of Nexys 4 manual pg. 10-12 of Nexys 4 DDR manual

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

Protocol 11 bits Clocked by keyboard a start bit: always 0 8 bits of data lsb first one parity bit (odd) a stop bit: always 1 Clocked by keyboard Value should be latched by FPGA on neg edge of keyboard clock Illustration from http://www.beyondlogic.org/keyboard/keybrd.htm

What is Sent ASCII is not sent! Scan codes for keys Most keys have an 8-bit (single byte) scancode Some have two bytes A few have even more! Most (not all, be careful!) keyboards use these scancodes: Our keyboards have slightly different scan codes! Check before using! Illustration from Nexys 4 manual

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

Some Scan Codes Long Two code sequence common Some special keys use even more… …have a look at Break key!

Even More Complicated Scan code generated when you press And when you release Extra byte: F0 followed by key scan code Example: Space pressed, 29 sent Space released, F0 29 sent

Resources Information Scan codes Available on the class website: http://www.beyondlogic.org/keyboard/keybrd.htm Scan codes http://www.barcodeman.com/altek/mule/scandoc.php Available on the class website: my Verilog for keyboard keyboard.sv: keyboard controller hardware keyboard_test.sv: demo with keyboard and 7-seg display displays the scan code of the last event from keyboard

My Verilog Have Verilog for keyboard To use: a test/demo which displays data from keyboard onto 7-segment display have tested it with the FPGA kit; seems to work fine To use: You will 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 Either: Check for a key release before reading a new key press OR: Delaying next key read (by, say, 1/4th sec) gives you automatic “key repeat” feature!

Mice

Mouse Very similar interface (clk & data) Read Verilog But: 3 words sent w/ mouse movement or button press Read pp. 12-13 of Nexys 4 manual Verilog I can guide you to modify keyboard.sv to read 3 bytes

Movement Movement is relative XS, YS are sign (+ is up/right) XY, YY are overflow (too fast) L, R are buttons

Scroll Wheel, etc. Extensions to original 2 button PS/2 mouse See http://www.computer-engineering.org/ps2mouse/

Accelerometer Nexys 4 boards have built-in accelerometer Verilog module is available on the course website

Verilog for accelerometer module accelerometer( input wire clk, //use 100MHz clock //Accelerometer signals output wire aclSCK, output wire aclMOSI, input wire aclMISO, output wire aclSS, //Accelerometer data output wire [8:0] accelX, accelY, // X and Y tilt values output wire [11:0] accelTmp // temperature sensor value ); AccelerometerCtl accel(clk, 0, aclSCK, aclMOSI, aclMISO, aclSS, accelX, accelY, accelTmp); endmodule

Built-In Audio Amplifier Nexys 4 has mono amplifier built-in

Built-In Mono Amplifier Mono output headphone jack compatible Very very low-level…! expects analog waveform on input! your design on FPGA will have to generate an analog value by rapidly toggling between 0 and 1 e.g., 60% of the time ‘1’ value will approximate an analog value of 0.60V (if range is 0-1V) Verilog code: available on course website simple tone generator: doesn’t use PWM simply approximates sine wave using square wave input is period in units of 10 ns (i.e., 100 MHz clock)