Microcontroller Based Low Cost Portable PC Mouse and Keyboard Tester



Similar documents
DATA LOGGER AND REMOTE MONITORING SYSTEM FOR MULTIPLE PARAMETER MEASUREMENT APPLICATIONS. G.S. Nhivekar, R.R.Mudholker

Microtronics technologies Mobile:

The Programming Interface

Lab Experiment 1: The LPC 2148 Education Board

Develop a Dallas 1-Wire Master Using the Z8F1680 Series of MCUs

EVAL-UFDC-1/UFDC-1M-16

CAN bus board. EB018

Data Transfer between Two USB Devices without using PC

Data Acquisition Module with I2C interface «I2C-FLEXEL» User s Guide

Display Message on Notice Board using GSM

M68EVB908QL4 Development Board for Motorola MC68HC908QL4

Embedded Systems on ARM Cortex-M3 (4weeks/45hrs)

DKWF121 WF121-A B/G/N MODULE EVALUATION BOARD

ET-BASE AVR ATmega64/128

AVR151: Setup and Use of the SPI. Introduction. Features. Atmel AVR 8-bit Microcontroller APPLICATION NOTE

Secure My-d TM and Mifare TM RFID reader system by using a security access module Erich Englbrecht (info@eonline.de) V0.1draft

STK User Guide

TURBO PROGRAMMER USB, MMC, SIM DEVELOPMENT KIT

8-bit Microcontroller. Application Note. AVR415: RC5 IR Remote Control Transmitter. Features. Introduction. Figure 1.

An Introduction to MPLAB Integrated Development Environment

Single channel data transceiver module WIZ2-434

Implementing a Digital Answering Machine with a High-Speed 8-Bit Microcontroller

A DIY Hardware Packet Sniffer

COMPUTER HARDWARE. Input- Output and Communication Memory Systems

A 5 Degree Feedback Control Robotic Arm (Haptic Arm)

Microcomputer Protocol Implementation at Local Interconnect Network Georgi Krastev

The CW Machine Hardware

ARM Thumb Microcontrollers. Application Note. Software ISO 7816 I/O Line Implementation. Features. Introduction

Arduino Due Back. Warning: Unlike other Arduino boards, the Arduino Due board runs at 3.3V. The maximum. Overview

RN-131-PICTAIL & RN-171-PICTAIL Evaluation Boards

User Manual. AS-Interface Programmer

Bluetooth HID Profile

HANDLING SUSPEND MODE ON A USB MOUSE

Serial Communications

Programming Flash Microcontrollers through the Controller Area Network (CAN) Interface

Chapter 6 The BIOS Setup Program

EasyPIC4 User s Manual

MODULE BOUSSOLE ÉLECTRONIQUE CMPS03 Référence :

CHAPTER 11: Flip Flops

8-Bit Flash Microcontroller for Smart Cards. AT89SCXXXXA Summary. Features. Description. Complete datasheet available under NDA

Arduino ADK Back. For information on using the board with the Android OS, see Google's ADK documentation.

Remote PLC system using GSM network with application to home security system

Ocean Controls RC Servo Motor Controller

PACKAGE OUTLINE DALLAS DS2434 DS2434 GND. PR 35 PACKAGE See Mech. Drawings Section

Quick Installation. A Series of Intelligent Bar Code Reader with NeuroFuzzy Decoding. Quick Installation

Old Company Name in Catalogs and Other Documents

Computer Automation Techniques. Arthur Carroll

How to read this guide

Design and Implementation of Home Monitoring System Using RF Technology

Freescale Semiconductor, I

AUTOMATIC NIGHT LAMP WITH MORNING ALARM USING MICROPROCESSOR

Wireless Temperature

Eureka Technology. Understanding SD, SDIO and MMC Interface. by Eureka Technology Inc. May 26th, Copyright (C) All Rights Reserved

Computer Organization and Components

ARM Ltd 110 Fulbourn Road, Cambridge, CB1 9NJ, UK.

WA Manager Alarming System Management Software Windows 98, NT, XP, 2000 User Guide

Below is a diagram explaining the data packet and the timing related to the mouse clock while receiving a byte from the PS-2 mouse:

Digital Photo Bank / Portable HDD Pan Ocean E350 User Manual

AN141 SMBUS COMMUNICATION FOR SMALL FORM FACTOR DEVICE FAMILIES. 1. Introduction. 2. Overview of the SMBus Specification. 2.1.

Web Site: Forums: forums.parallax.com Sales: Technical:

A+ Guide to Managing and Maintaining Your PC, 7e. Chapter 1 Introducing Hardware

Embedded Systems Design Course Applying the mbed microcontroller

[PROJECT PLAN: IPOD BARCODE SCANNER]

AVR Butterfly Training. Atmel Norway, AVR Applications Group

Implementing SPI Master and Slave Functionality Using the Z8 Encore! F083A

POCKET SCOPE 2. The idea 2. Design criteria 3

CENTRONICS interface and Parallel Printer Port LPT

Serial Communications

LTM-1338B. Plus Communications Manual

LDG Electronics External Meter Serial Communications Protocol Specification

The I2C Bus. NXP Semiconductors: UM10204 I2C-bus specification and user manual HAW - Arduino 1

PART B QUESTIONS AND ANSWERS UNIT I

Palaparthi.Jagadeesh Chand. Associate Professor in ECE Department, Nimra Institute of Science & Technology, Vijayawada, A.P.

GTS-4E Hardware User Manual. Version: V1.1.0 Date:

Troubleshooting Tips Lifestyle SA-2 & SA-3 Amplifier. Troubleshooting Tips

DS2401 Silicon Serial Number

Implementing MOD bus and CAN bus Protocol Conversion Interface

Switch board datasheet EB

USER GUIDE EDBG. Description

Network Operation and Troubleshooting

How To Program A Microcontroller Board (Eb064) With A Psp Microcontroller (B064-74) With An Ios 2.5V (Power) And A Ppt (Power Control) (Power Supply) (

Accurate Measurement of the Mains Electricity Frequency

HC(S)08-System for Development and Training

APPLICATION NOTE Atmel AT02509: In House Unit with Bluetooth Low Energy Module Hardware User Guide 8-bit Atmel Microcontroller Features Description

MSITel provides real time telemetry up to 4.8 kbps (2xIridium modem) for balloons/experiments

Chapter 5 Real time clock by John Leung

Pmod peripheral modules are powered by the host via the interface s power and ground pins.

ENGI E1112 Departmental Project Report: Computer Science/Computer Engineering

Objectives. Basics of Serial Communication. Simplex vs Duplex. CMPE328 Microprocessors (Spring ) Serial Interfacing. By Dr.

Designing a USB Keyboard and PS/2 Mouse Combination Device Using the Cypress Semiconductor CY7C63413 USB Microcontroller

C8051F020 Utilization in an Embedded Digital Design Project Course. Daren R. Wilcox Southern Polytechnic State University Marietta, Georgia

MX PIC24F Educational Module User Manual

WinProladder software package

ETEC Digital Controls PIC Lab 10 Pulse Width Modulation

Using Xbee in Serial Communication

APPLICATION NOTE. Atmel AT01095: Joystick Game Controller Reference Design. 8-/16-bit Atmel Microcontrollers. Features.

3. Programming the STM32F4-Discovery

INTERNATIONAL JOURNAL OF ELECTRONICS AND COMMUNICATION ENGINEERING & TECHNOLOGY (IJECET)

How To Design A Code Lock System With A Status Display On A Cell Phone And A Password Code On A Smart Phone

TRILOGI 5.3 PLC Ladder Diagram Programmer and Simulator. A tutorial prepared for IE 575 by Dr. T.C. Chang. Use On-Line Help

Transcription:

Leonardo Journal of Sciences ISSN 1583-0233 Issue 20, January-June 2012 p. 31-36 Microcontroller Based Low Cost Portable PC Mouse and Keyboard Tester Ganesh Sunil NHIVEKAR *, and Ravidra Ramchandra MUDHOLKAR Department of Electronics, Shivaji University, Kolhapur-410004, India. E-mail: gonioelect@gmail.com * Abstract This article describes design of low cost embedded system to test standard PS2 mouse and keyboard based on AVR microcontroller. Keywords Mouse; Keyboard; Microcontroller; AVR microcontroller. Introduction Many mouse and keyboards uses PS2 (AT) device interface protocol [1]. When a computer is used for the purpose of testing using software programs, each time the computer needs to be rebooted to test them. This process need be repeated for each mouse or keyboard to be tested. This method is time consuming also need PC as resource. The microcontroller based portable system has been developed as described in this paper to test standard mouse and keyboard without need of PC as resource. The Hardware interface The available PS2 port connectors for standard mouse and keyboard are of two types, the 5-pin DIN connector of 5D type, and the smaller six-pin mini-din. The pin assignments are shown in Figure 1. The physical interface between the device and the host is shown in Figure 2. Two signal lines are used, clock and data. The signal lines are open connector, http://lejpt.academicdirect.org 31

Microcontroller Based Low Cost Portable PC Mouse and Keyboard Tester Ganesh NHIVEKAR and Ravi MUDHOLKAR which required external pull-up resistors. This allows either the device or the host system to force a line to low level. Figure 1. Connector pin assignments Figure 2. Interface between the host and the device PS2 keyboards use the same protocol as the PS2 mouse [1]. Keyboard and mouse use a serial protocol with 11-bit frames; the timing for the data transferred from the device to the host is shown in Figure 3. The device writes a bit on the Data line when Clock is high, and it is read by the host when Clock is low. The protocol is: one start bit (always 0), eight data bits, one odd parity bit and one stop bit (always 1). Figure 3. Timing for device to host communication The Host to PS2 device protocol is initiated by taking the data line low. However to prevent the conflict data, device Clock line kept low for more than 100us. Then pull data line low, and release clock line. The timing for the communication from the host to the device is shown in Figure 4. 32

Leonardo Journal of Sciences ISSN 1583-0233 Issue 20, January-June 2012 p. 31-36 Figure 4. Timing for host to device communication The system circuit Central Processing Unit (CPU) The CPU used in the system is ATMEL AVR microcontroller, ATMEGA8 provides on chip internal RC oscillator which is used to lower the cost increase the efficiency and reliability. ATMEGA8 also have low power consumption which makes it a best for battery powered portable systems. Internal RC oscillator is calibrated at 8 MHz. The Display Circuit The system uses LCD module for display results. The module has on-board display controller, which relieves the main microcontroller from manually generating dot-matrix character display. The display unit is composed of 16 2 dot matrix alphanumeric LCD. The LCD is configured in 4-bit mode with read-write control (WR) pin grounded. This configuration requires less number of I/O pins of microcontroller, typically 6 only. The circuit diagram shown in Fig. 5 reveals actual pin connections of the system. Figure 5. Full Functional Hardware Schematic of Microcontroller based low cost portable PC mouse and keyboard tester 33

Microcontroller Based Low Cost Portable PC Mouse and Keyboard Tester Software Description Ganesh NHIVEKAR and Ravi MUDHOLKAR In microcontroller based system, software design is also a subtle task as that of hardware design. The software for the CPU is written in embedded-c language with the help of AVR studio IDE tool. Figure 6 shows the basic flow chart of the system software and the Figure 7 revel the main function of the device program along with necessary included header files. Figure 6. Basic flow chart of the system Figure 7. Main function in device software 34

Leonardo Journal of Sciences ISSN 1583-0233 Issue 20, January-June 2012 p. 31-36 The logical behavioral flow of the system is as follows: When the system is poweredon, the initialization part of the system software configures various on-chip peripherals such as timers, interrupts etc. and initializes the externally interfaced LCD. This initialization sequence puts these resources into a known state. Mouse and keyboard have different device ID. Once initialized the system first checks interfaced device type using key (sw1), then it manually reads device ID and based on that it determines device type. Error is displayed if both are not matched. Keyboard The AT keyboard has a scan code associated with each key. When a key is pressed, this code is transmitted. If a key is held down for a while, it starts repeating. The repeat rate is typically 10 per second. When a key is released, a break code ($F0) is transmitted followed by the key scan code. For most of the keys, the scan code is one byte. Some keys like the Home, Insert and Delete keys have an extended scan code, from two to five bytes. The first byte is always $E0. This is also true for the break sequence, e.g., E0 F0 xx AT keyboards are capable of handling three sets of scan codes, where set two is default. The present system only use set two. Keyboard reception is handled by the interrupt function INT0_interrupt. The reception will operate independent of the rest of the program. The algorithm for keyboard tester is: Store the value of the data line at the leading edge of the clock pulse. This is easily handled if the clock line is connected to the INT0 pin. The interrupt function will be executed at every edge of the clock cycle, and data will be stored at the falling edge. After all bits are received, the data can be decoded. This is done by calling the decode function. For character keys, this function will store an ASCII character in a buffer. It will take into account if the shift key is held down when a key is pressed. Other keys like function keys, navigation keys (arrow keys, page up/down keys etc.) and modifier keys like Ctrl and Alt are ignored. The mapping from scan codes to ASCII characters are handled with table look-ups, one table for shifted characters and one for un-shifted. The received ASCII character is displayed on LCD. Mouse The program initializes the mouse with some commands, and then enters a loop where about every 200 milliseconds requests to the mouse data about switches' state and X-Y movement since last request [3]. The received data from mouse is processed by 35

Microcontroller Based Low Cost Portable PC Mouse and Keyboard Tester Ganesh NHIVEKAR and Ravi MUDHOLKAR microcontroller and display the X-Y coordinate, and right-left button pressed on LCD. Software communication is also managed to verifying timeout, framing and parity errors, and coding from mouse [4-6]. Timeout error, as an example, can occur also in the case the mouse is disconnected, it doesn't answer, there is a broken wire etc.; in such case error is displayed on LCD. Conclusion This is an inexpensive, portable design allows the users to quickly test mouse and keyboard with flexibility of compatibility with other mouse and keyboard technologies. The total cost for system is less then 4 dollars. Looking at these factors the above mentioned system will be preferred over the conventional PC based test system. References 1. Chapweske A., PS/2 Mouse/Keyboard Protocol, 2001, Available at: http://www.computer-engineering.org 2. Simandl P., PC keyboard, 1999, Available at: http://www.simandl.cz/stranky/elektro/keyboard/keyboard_a.htm 3. Fahey C., PS2 mouse and BASIC Stamp computer, Available at: http://colinfahey.com/index_en.html 4. Barr M., Programming Embedded Systems in C and C++, 1st edition, O'Reilly & Associates, Canada, 1999. 5. Nhivekar G.S., Mudholkar R.R., Data Logger and Remote Monitoring System for Multiple Parameter Measurement Applications, Journal of Electrical and Electronics Engineering, 2011, 4(1), p. 139-142. 6. Nhivekar G.S., Mudholkar R.R., Implementation of fuzzy logic control algorithm in embedded microcomputers for dedicated application, International Journal of Engineering, Science and Technology, 2011, 3(4), p. 276-283. 36