ARM HOW-TO GUIDE Interfacing Keypad with LPC2148 ARM

Similar documents
ARM HOW-TO GUIDE Interfacing Switch with LPC2148 ARM

ARM HOW-TO GUIDE Interfacing Buzzer with LPC2148 ARM

ARM HOW-TO GUIDE Interfacing GLCD with LPC2148 ARM

ARM HOW-TO GUIDE Interfacing 7SEG with LPC2148 ARM

ARM HOW-TO GUIDE Interfacing Relay with LPC2148 ARM

ARM HOW-TO GUIDE Interfacing Stepper Motor with LPC2148

ARM HOW-TO GUIDE Interfacing GPS with LPC2148 ARM

ARM HOW-TO GUIDE Interfacing I2C-7SEG with LPC2148 ARM

ARM HOW-TO GUIDE Interfacing GLCD with LPC2148 ARM

Texas Instruments Microcontroller HOW-TO GUIDE Interfacing Keypad with MSP430F5529

8085 HOW-TO GUIDE Interfacing 8251 with 8085

P89V51RD2 Development Board May 2010

LPC1768 Industrial Reference Design Platform System Development Kit Version 1.3. May 2009

Diploma in Embedded Systems

Basic Input/Output Operations

LPC2148 DEV BOARD. User Manual.

acret Ameya Centre for Robotics & Embedded Technology Syllabus for Diploma in Embedded Systems (Total Eight Modules-4 Months -320 Hrs.

NFC NUTSHELL KIT. MCU Modules USER MANUAL REVISION GMMC GmbH Keywords Abstract. Document information

Advanced Embedded Systems

LPC2468 Industrial Reference Design Platform System Development Kit Version 1.2. August 2008

e-pg Pathshala Subject: Computer Science Paper: Embedded System Module: Interfacing External Devices using Embedded C Module No: CS/ES/22

AN10210 Using the Philips 87LPC76x microcontroller as a remote control transmitter

Interfacing input devices e.g. keypads, sensors with the micro-controller

CoiNel Technology Solutions LLP. LPC2148 ARTIST Instruction Manual LPC2148 ARTIST. Instruction manual. Revision 1

8051 General Purpose Board

Lecture (03) PIC16F84 (2)

Evaluation board for NXP LPC2103. User Guide. Preliminary Version updated 27 th Aug TechToys Company All Rights Reserved

A PIC-based LCD Display for Stand-Alone Instrumentation

ST SPC58 B Line Emulation Adapter System

LABORATORY MANUAL EMBEDDED SYSTEMS LABORATORY. M. Tech I Year I Sem R15 DEPARTMENT OF ELECTRONICS & COMMUNICATION ENGG.

8051 Basic Development Board. Product Manual. Contents. 1) Overview 2) Features 3) Using the board 4) Troubleshooting and getting help

ecee NXP LPC 2138 ARM Development Board

Future Designs, Inc. Your Development Partner LCD DEMO KITS

Bachelor of Engineering in Computer and Electronic Engineering

Write LED display data, in accordance with the address from the display from low to high, from low to high data byte operation.

EPM900 - Overview. Features. Technical Data

AVR Development Board

8051 Intermidiate Development Board. Product Manual. Contents. 1) Overview 2) Features 3) Using the board 4) Troubleshooting and getting help

Lab 3 LCD Mar

Lecture (04) PIC 16F84A programming I

SX1509 I/O Expander Breakout Hookup Guide

LABORATORY MANUAL Interfacing LCD 16x2, Keypad 4x4 and 7Segment Display to PIC18F4580

LPC1788 Mio Board. The functional details of the board are as follows-

AN Entering ISP mode from user code. Document information. ARM ISP, bootloader

Introduction to ARM LPC2148 Microcontroller

Celadon, Inc. TRX Series Infrared Remote and Receiver Assembly and Operation Instruction Manual

LCD. Configuration and Programming

Magic 8 Ball. Student's name & ID (1): Partner's name & ID (2): Your Section number & TA's name

Phi-panel backpack assembly and keypad options Dr. John Liu 12/16/2012

Lab 1 Introduction to Microcontroller

The industrial technology is rapidly moving towards ARM based solutions. Keeping this in mind, we are providing a Embedded ARM Training Suite.

WiMOD - im880b. Application Note AN017 / Version 1.1. Firmware Update for im880b. Document ID: 4100/40140/0103. Category:

Electronics Construction Manual

Getting Started with STK200 Dragon

LPC1788 Mio Board. User Manual. Revision 1.0 1

Flash Magic Application Note 4 What to do if ISP Does Not Work Embedded Systems Academy 2003, All Rights Reserved

FiO Lite Datasheet FEATURES SAMPLE APPLICATIONS. FiO Lite

Start a New Project with Keil MDK-ARM Version 5 and ST Micro Nucleo-F446RE

Adafruit Metro Mini. Created by lady ada. Last updated on :12:28 PM UTC

AN10184 Connecting a keyboard to the Philips LPC9xx microcontroller

AN Interfacing Philips Bridge IC with Philips microcontroller. Document information

NX-51 V2 plus experiment board Documentation 1. NX-51 V2 plus. P89V51RD2 microcontroller Eexperiment board. Documentation

Introduction to 8051 microcontrollers

Evaluation board for NXP LPC2103 USE GNU ARM UNDER KEIL IDE

ENGN3213. Digital Systems & Microprocessors. HLAB 6: ARM Embedded Systems I

Building the FlipChip Tester

GIE 8051 Professional Kit. User Manual

UM QN908x Quick Start. Document information. QN908x, Quick Start, Development Kit, QN9080 DK, QN9080 Development Kit

MULTISENSOR SYSTEM USING LPC2148 MICROCONTROLLER

AVR MICROCONTROLLER PROJECT TUTORIAL E-PUB

Trends in Prototyping Systems. ni logic Pvt. Ltd., Pune, India

Breeze Board. Type A. User Manual.

8051 Microcontroller

TWR-KL28Z User s Guide

AN10955 Full-duplex software UART for LPC111x and LPC13xx

Exclusive 2.5 GHz Frequency Counter

Keywords Digital IC tester, Microcontroller AT89S52

Bolero3M Nexus Emulation Adapter 256BGA 176TQ

I2C on the HMC6352 Compass

Automation Engineers AB Pvt Ltd, NOIDA Job-Oriented Course on Embedded Microcontrollers & Related Software Stack

RFID: Read and Display V2010. Version 1.1. Sept Cytron Technologies Sdn. Bhd.

Embedded Technosolutions

Breeze Board. Type B. User Manual.

WAVETEK BLE-WT51822AA/AB. Revision History. Bluetooth low energy Module WT51822AA (256k) /AB (128k) (Bluetooth Low Energy BT4.0) PRODUCT SPECIFICATION

Contents. Join the Technical Community Today!

Electronics Construction Manual

LCD03 - I2C/Serial LCD Technical Documentation

32 bit Micro Experimenter Board Description and Assembly manual

AN LPC1700 secondary USB bootloader. Document information. LPC1700, Secondary USB Bootloader, ISP, IAP

REQUIRED MATERIALS Reread Lab Rules and Policies document EEL 3744 (upad and upad Proto Base) Digilent Analog Discovery (DAD) PRELAB REQUIREMENTS

REQUIRED MATERIALS Reread Lab Rules and Policies document EEL 3744 (upad and upad Proto Base) Digilent Analog Discovery (DAD) PRELAB REQUIREMENTS

Getting Started in C Programming with Keil MDK-ARM Version 5

AVR-P20 development board Users Manual

AVR-M Rev 5 ASSEMBLY

Purchase Agreement. P&E Microcomputer Systems, Inc. 98 Galen St. Watertown, MA

POTENTIOMETER. Revision Class. Instructor / Professor LICENSE

Getting Started in C Programming with Keil MDK-ARM Version 5

AC/DC Adapter. Figure 1. Hardware Setup

ECE383: Microprocessors Lab 9 Analog-to-Digital and Digital-to-Analog Conversion with I 2 C Serial EEPROM Data Storage

PIC Dev 14 Through hole PCB Assembly and Test Lab 1

Transcription:

ARM HOW-TO GUIDE Interfacing Keypad with LPC2148 ARM

Contents at a Glance ARM7 LPC2148 Primer Board... 3 Keypad... 3 Interfacing keypad... 4 Interfacing keypad with LPC2148... 6 Pin Assignment with LPC2148... 6 Circuit Diagram to Interface keypad with LPC2148... 7 Source Code... 7 C Program to 4 X 4 matrix keypad using LPC2148... 8 Testing the Keypad with LPC2148... 10 General Information... 11

ARM7 LPC2148 Primer Board The ARM7 LPC2148 Primer board is specifically designed to help students to master the required skills in the area of embedded systems. The kit is designed in such way that all the possible features of the microcontroller will be easily used by the students. The kit supports in system programming (ISP) which is done through serial port. NXP s ARM7 (LPC2148), ARM Primer Kit is proposed to smooth the progress of developing and debugging of various designs encompassing of High speed 32-bit Microcontrollers. Keypad A keypad is a set of buttons arranged in a block or "pad" which usually bear digits, symbols and usually a complete set of alphabetical letters. If it mostly contains numbers then it can also be called a numeric keypad. Here we are using 4 X 4 matrix keypad.

Interfacing keypad Fig. 1 shows how to interface the 4 X 4 matrix keypad to two ports in microcontroller. The rows are connected to an output port and the columns are connected to an input port. To detect a pressed key, the microcontroller grounds all rows by providing 0 to the output latch, and then it reads the columns. If the data read from the columns is D3- D0=1111, no key has been pressed and the process continues until a key press is detected. However, if one of the column bits has a zero, this means that a key press has occurred. For example, if D3-D0=1101, this means that a key in the D1 column has been pressed. After a key press is detected, the microcontroller will go through the process of identifying the key. Starting with the top row, the microcontroller grounds it by providing a low to row D0 only; then it reads the columns.

If the data read is all 1s, no key in that row is activated and the process is moved to the next row. It grounds the next row, reads the columns, and checks for any zero. This process continues until the row is identified. After identification of the row in which the key has been pressed, the next task is to find out which column the pressed key belongs to. Fig. 1 Interfacing keypad to Microcontroller

COLUMN ROW C1 C2 C3 C4 Interfacing keypad with LPC2148 We now want to scan a keypad in LPC2148 Primer Board. In case of 4X4 matrix Keypad both the ends of switches are connected to the port pin i.e. four rows and four columns. So in all sixteen switches have been interfaced using just eight lines. 1Keypads arranged by matrix format, each row and column section pulled by high or low by selection J5, all row lines(p1.24 P1.27) and column lines(p1.28 to P1.31) connected directly by the port pins. Pin Assignment with LPC2148 4x4 Matrix Lines LPC2148 Lines 4x4 Matrix Keypad ROW-0 P1.24 ROW-1 P1.25 SW1 SW2 SW3 SW4 ROW-2 P1.26 R1 SW5 SW6 SW7 SW8 ROW-4 P1.27 R2 COLUMN-0 P1.28 COLUMN-1 P1.29 R3 SW9 SW10 SW11 SW12 SW13 SW14 SW15 SW16 COLUMN-2 P1.30 R4 COLUMN-3 P1.31

61 62 XTAL2 XTAL1 VREF VDD1 VDD2 VDD3 VDDA 63 51 43 23 7 Circuit Diagram to Interface keypad with LPC2148 3.3V U16 6 18 VSS1 P1.27 25 VSS2 P1.26 42 VSS3 P1.25 50 VSS4 P1.24 59 VSS5 VSSA P1.31 LPC2148 P1.30 P1.29 P1.28 64 24 28 32 20 52 56 60 SW4 SW5 SW6 SW7 _0 SW8 SW9 SW10 SW11 12MHz SW12 SW13 SW14 SW15 C34 22pf X12 C35 22pf SW16 SW17 SW18 SW19 4X4 MATRIX KEYPADS Source Code The Interfacing keypad with LPC2148 program is very simple and straight forward, that scan a keypad rows and columns. When the rows and columns are detected then it will display in PC through UART0. The C programs are developed in Keil software.

C Program to 4 X 4 matrix keypad using LPC2148 *************************************************************************************** Title : Program to keypad interfacing *************************************************************************************** #include <LPC214x.h> #include <stdio.h> #include "Keypad.h" #include "UART_Utility.c" extern void Delay(void); unsigned char Row_Data, Col_Data; unsigned char Msg[4][4] = { '0','1','2','3', '4','5','6','7', '8','9','A','B', 'C','D','E','F' }; void main(void) { VPBDIV = 0x02; UART0_Init (9600); PINSEL2 = 0x0; UART0_PutS ("\nps-primer ARM LPC2148 Keypad Demo\n\r"); UART0_PutC (0xB8); UART0_PutS (" Pantech Solutions Pvt Ltd., \n\r"); UART0_PutS (" www.pantechsolutions.net\n\r"); UART0_PutS ("------------------------------------ ----- \n\n\r"); UART0_PutS ("Keypad Ports : P1.24 - P1.31 \n\n\n\r"); UART0_PutS ("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~\n\n\r");

while (1) { Delay(); Delay(); KeyScan(&IOPIN1,24,&Row_Data,&Col_Data); UART0_PutS ("The Key You Pressed is : "); } } if (Row_Data < 4 && Col_Data < 4) { U0THR = Msg[Row_Data][Col_Data]; Delay(); Delay(); U0THR = '\r'; } void Delay(void) { } unsigned int i,j; for(i=0;i<35;i++) for(j=0;j<1234;j++); To compile the above C code you need the KEIL software. They must be properly set up and a project with correct settings must be created in order to compile the code. To compile the above code, the C file must be added to the project.

In Keil, you want to develop or debug the project without any hardware setup. You must compile the code for generating HEX file. In debugging Mode, you want to check the port output without LPC2148 Primer Board. The Flash Magic software is used to download the hex file into your microcontroller IC LPC2148 through UART0. Testing the Keypad with LPC2148 Give +3.3V power supply to LPC2148 Primer Board; the serial cable is connected between the LPC2148 Primer Board and PC. Open the Hyper Terminal screen, select which port you are using and set the default settings. Now the screen should show some text messages & it display which key is pressed in keypad. If you not reading any text from UART0, then you just check the jumper connections & just check the serial cable is working. And also check the keypad keys are properly working or not. Otherwise you just check the code with debugging mode in Keil.

If you want to see more details about debugging just see the videos in below link. How to Create & Debug a Project in Keil. General Information For proper working use the components of exact values as shown in Circuit file. Wherever possible use new components. Solder everything in a clean way. A major problem arises due to improper soldering, solder jumps and loose joints. Use the exact value crystal shown in schematic. More instructions are available in following articles, User Manual of LPC2148 Primer Board. Tutorial of how to create & Debug a project in Keil. Interfacing Switches with LPC2148.

Did you enjoy the read? Pantech solutions creates information packed technical documents like this one every month. And our website is a rich and trusted resource used by a vibrant online community of more than 1,00,000 members from organization of all shapes and sizes.

What do we sell? Our products range from Various Microcontroller development boards, DSP Boards, FPGA/CPLD boards, Communication Kits, Power electronics, Basic electronics, Robotics, Sensors, Electronic components and much more. Our goal is to make finding the parts and information you need easier and affordable so you can create awesome projects and training from Basic to Cutting edge technology.