Keypad Lecture L4.6. Port Integration Module PIM_9C32 Block Guide V01.06 Reference: S12C32PIMV1.pdf.

Slides:



Advertisements
Similar presentations
Programmable Interval Timer
Advertisements

Programmable Keyboard/ Display Interface: 8279
Input/Output Ports and Interfacing ELEC 330 Digital Systems Engineering Dr. Ron Hayne Images Courtesy of Ramesh Gaonkar and Delmar Learning.
10-1 EE 319K Introduction to Microcontrollers Lecture 10: Interrupts, Output Compare Periodic Interrupts Read Book Sections 9.1, 9.2, 9.4, 9.6.1, 9.6.2,
68HC11 Analog I/O Chapter 12.
Mark Neil - Microprocessor Course 1 Decoding and Using a 4x4 Keyboard.
Spring EE 316 Computer Engineering Junior Lab Designing State machines for a numeric Keypad.
© 2006 Pearson Education, Upper Saddle River, NJ All Rights Reserved.Brey: The Intel Microprocessors, 7e Interfacing a 4x4 Key Matrix Row Inputs.
Parallel Ports Lecture L4.1. Parallel Interfacing Parallel I/O Ports Using Parallel Ports.
Subroutines and Stacks Lecture L3.1. Subroutine and Stacks The System Stack Subroutines A Data Stack.
Embedded Systems 7763B Mt Druitt College of TAFE Electrical Engineering Lesson 2 LCD Display Interfacing.
7-1 Keypad Scanning interface Used for interfacing push-button(momentary) switches Used for large number(>8) push-buttons Relies on matrix arrangement.
Interrupts CML-12C32 Lecture L4.2.
EET 2261 Unit 7 I/O Pins and Ports
Practical Session No. 10 Input &Output (I/O). I/O Devices Input/output (I/O) devices provide the means to interact with the “outside world”. An I/O device.
The Serial Peripheral Interface (SPI)
ECE 447 Fall 2009 Lecture 6: TI MSP430 IO Interfacing.
ECE 447: Lecture 6 Input/Output Interfacing LEDs, Button Switches & Port Multiplexing.
Lab 1 – Assembly Language and Interfacing Start date: Week 3 Due date: Week 4 1.
Input/Output Ports and Interfacing
George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction.
8279 KEYBOARD AND DISPLAY INTERFACING
Practical Session 11 Computer Architecture and Assembly Language Input &Output (I/O)
Parallel Interfacing Chapter 7. Parallel Interfacing Parallel I/O Ports Using Parallel Ports Seven-Segment Displays Keypad Interfacing Liquid Crystal.
Introduction to Computers Section 2A. home Keyboard Alphanumeric keys Modifier keys Numeric keypad Function keys Cursor-movement keys Special-purpose.
ECE 371 – Unit 9 Interrupts (continued). Example Set up Two Interrupt Request Inputs: –Port H[0] Set Interrupt Flag on “0” to “1” transition (rising edge)
1 ECE 372 – Microcontroller Design Parallel IO Ports - Inputs.
1 COMP541 Input Devices: Keyboards, Mice and Joysticks Montek Singh Apr 6, 2015.
Embedded Systems 7763B Mt Druitt College of TAFE Electrical Engineering Lesson 2 LCD Display Interfacing.
The Serial Communication Interface (SCI) MC9S12-C32
8279 KEYBOARD AND DISPLAY INTERFACING
Programming Microcontrollers in C Lecture L7.1. C Data Types TypeSizeRange char1 byte-128 – 127 unsigned char1 byte0 – 255 Int2 bytes – unsigned.
Parallel I/O. Introduction This section focuses on performing parallel input and output operations on the 68HC11 3 operation types – Simple, blind data.
RFID Access Control System Lucius Knight. General System Design  Microcontroller  PSoC CY8C29466  24MHz Bus Frequency  Memory Available  32kB FLASH.
Alpha/Numeric Keypad Functions using AVR Preliminary Design Review Luke R. Morgan ECE /17/2008.
BICYCLE SECURITY AND TRIP COMPUTER MATTHEW ROTHNIE WESTERN WASHINGTON UNIVERSITY 4/25/12.
Embedded Systems Lecture 5 January 25 th, 2016.
Mark Neil - Microprocessor Course 1 Decoding and Using a 4x4 Keyboard.
1 68HC11 Timer. 2 68HC11 Timer Subsystem Several timing functions: Basic timing Basic timing Real time interrupts Real time interrupts Output compare.
Practical Session 12 Input &Output (I/O). I/O Device Input / Output (I/O) devices Input / Output (I/O) devices provide the means to interact with the.
ECE 447: Lecture 12 Keypads ECE 447: Lecture 10. ECE 447: Matrix Keypad.
SCI Communication Proudly Presented By: Adam Cardi & Aaron Enes.
ELE22MIC Lecture 17 Writing 68HC11 software 68HC11 Main Timer System –Output Compare –What is different about TOC1?
Practical Session 11 Computer Architecture and Assembly Language Input &Output (I/O)
HCS12 Technical Training Module 6 – Port Integration, Slide 1 MOTOROLA and the Stylized M Logo are registered in the US Patent & Trademark Office. All.
Peripherals – Keypad The Keypad provides a simple means of numerical data or control input. The keys can be attributed whatever data or control values.
Addressing Modes in Microprocessors
Example 14 Real-time Interrupts
Buffered, Interrupt-Driven Printer Design Example
Fri. Sept 29 Announcements
LCD and Keyboard Interfacing
DIGITAL CALCULATOR USING 8051
COMP2121: Microprocessors and Interfacing
Buffered, Interrupt-Driven Printer Design Example
ECE 3430 – Intro to Microcomputer Systems
ECET 330 Innovative Education--snaptutorial.com
LCD and Keyboard Interfacing
Example 6 Hex Keypad Lecture L3.2.
Keypad Source: under under
Final Exam Review Department of Electrical and Computer Engineering
LCD and Keyboard Interfacing
Port Integration Module
Computer Architecture and Assembly Language
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
Interrupt-Driven State Machine
LCD and Keyboard Interfacing
Keypad Source: under under
Keypad Source: under under
Indexing Through Memory
Accum A: Index X: CCR Bit Z: $0100 $0101 $0102 $0103 $0104 $0105
Presentation transcript:

Keypad Lecture L4.6

Port Integration Module PIM_9C32 Block Guide V01.06 Reference: S12C32PIMV1.pdf

Axiom 4 x 4 Hex Keypad

Port P

PTP equ $258 ; Port P PTIP equ $259 ; Port P input DDRP equ $25A ; Direction RDRP equ $25B ; portP reduced drive register PERP equ $25C ; portP pull device enable PPSP equ $25D ; portP pull polarity select PIEP equ $25E ; portP interrupt enable register PIFP equ $25F ; portP interrupt flag register

Axiom 4 x 4 Hex Keypad

;keypad.asm ;AXIOM keypad org$800 outaequ$FF4F PTP equ $258 ; Port P DDRP equ $25A ; Direction PERP equ $25C ; portP pull device enable PPSP equ $25D ; portP pull polarity select

keycodes db$14; 0 db$88; 1 db$84; 2 db$82; 3 db$48; 4 db$44; 5 db$42; 6 db$28; 7 db$24; 8 db$22; 9 db$81; A db$41; B db$21; C db$11; D db$18; E/* db$12; F/#

; Initialize KEYPAD ; Port P 0-3 must be input with pull downs ; 4-7 must be output initkey ldaa #$F0 ; set Port P direction staa DDRP ldaa #$0f staa PPSP ; set for pull downs ldaa #$0f staa PERP ; enable pull downs rts

;scan all keys ;B = key pressed ;if B = #$10, no key pressed keyscan clrb; B = index ldx#keycodes ks1ldaab,x staaptp;write next code nop;wait to settle down nop ldaaptp;read it back cmpab,x;if key pressed, beqks2; B = key incb;else, inx index cmpb#$10; and scan all keys bneks1;if no key pressed ks2rts; B = #$10 keycodes db$14 ; 0 db$88 ; 1 db$84 ; 2 db$82 ; 3 db$48 ; 4 db$44 ; 5 db$42 ; 6 db$28 ; 7 db$24 ; 8 db$22 ; 9 db$81 ; A db$41 ; B db$21 ; C db$11 ; D db$18 ; E/* db$12 ; F/#

;wait to press a key ;B = key value keypad bsrkeyscan;scan keypad cmpb#$10;until key pressed beqkeypad rts

Debounce ;debounced key input getkey bsrkeypad;wait for key pshb;save key value ldy#3 jsrms_delay;delay ~10 ms bsrkeypad;wait for key pula;get 1st value sba;if not same as 2nd bnegetkey;repeat rts;B = key value

;wait to lift finger from key wait_keyup bsrkeyscan;scan keypad cmpb#$10;while key is pressed bnewait_keyup ldy#3 jsrms_delay;delay ~10 ms bsrkeyscan;scan keypad cmpb#$10;if key is pressed bnewait_keyup;repeat rts #includems_delay.asm #includehexasc.asm

org$4000 main bsrinitkey;initialize keypad mn1jsrgetkey;get key input tba;A = key hex value jsrhexasc;convert to ascii jsrouta;display on screen jsrwait_keyup;wait to lift finger bramn1;get more keys