Presentation is loading. Please wait.

Presentation is loading. Please wait.

EE 316 Computer Engineering Junior Lab Digital Hangman.

Similar presentations


Presentation on theme: "EE 316 Computer Engineering Junior Lab Digital Hangman."— Presentation transcript:

1 EE 316 Computer Engineering Junior Lab Digital Hangman

2 Topics Important Specifications for the Digital Hangman game. For details read the project description Serial Port Software PS/2 Keyboards

3 Digital Hangman Game will be played using a PS/2 keyboard attached to hardware The Personal computer will ● Randomly select word puzzles from a text-file. ● Display all correctly picked letters and positions of unknown letters on the LCD connected via a serial port. ● Keep count of the number of guesses played so far. ● Display messages for the player as specified in the game.

4 Operational Characteristics of the LCD Display Short messages (20 or fewer characters) –displayed “instantly”, left justified Long messages (>20 characters) –start at right, scroll right to left –scroll at “reading rate” Remain displayed until next message or clear

5 Software Standard Windows GUI (Windows XP) Must be able to read text-files Must be able to control serial port –use the references in the Project assignment –there are several classes (Cserial and CSerialPort) that are for general use Use them with caution You may want to write your own code too

6 The PS/2 Keyboard PS/2 device interface was developed by IBM. PS/2 port these days use the 6-pin mini-DIN connectors. The Data and clock are open-collector with pull-up resistors. http://www.computer-engineering.org/ps2protocol/

7 PS/2 Keyboard, contd..  PS/2 devices use bidirectional synchronous serial protocol.  The device (keypad in this case) generates the clock.  The clock frequency is 10-16.7 kHz.  One byte of data is sent at a time.  Each frame from keypad to the PC contains 11 bits. These bits are: http://www.computer-engineering.org/ps2protocol/  1 start bit. This is always 0.  8 data bits, least significant bit first.  1 Parity bit.  1 stop bit. This is always 1.

8 Scan code Keyboards consist of a large matrix of keys The keys are monitored or scanned by an on-board processor (aka the "keyboard encoder“). If a key is pressed, held and released, the keypad sends out an 11-bit “Scan code” (data). There are several scan codes. We will use the default code (See Scan code 2) for all modern keyboard.(See Scan code 2) http://www.computer-engineering.org/ps2keyboard/

9 Keyboard to Host communication The “Make scan code” for Q http://www.computer-engineering.org/ps2protocol/ Stop bit = 1 1 0 1 0 1 0 0 0 0001 0101 = 0X15 <= The make scan code for the “Q” key Start bit = 0 Parity bit

10 References http://www.computer-engineering.org/ps2protocol/ http://www.computer-engineering.org/ps2keyboard/ http://www.computer- engineering.org/ps2keyboard/scancodes2.htmlhttp://www.computer- engineering.org/ps2keyboard/scancodes2.html


Download ppt "EE 316 Computer Engineering Junior Lab Digital Hangman."

Similar presentations


Ads by Google