DatasheetsPDF.com

AN552

Microchip
Part Number AN552
Manufacturer Microchip
Description Implementing Wake-up on Key Stroke
Published Mar 8, 2014
Detailed Description M Author: AN552 SUMMARY The PIC16CXXX is ideally suited to interface directly to a keypad application. Built in pull-up...
Datasheet PDF File AN552 PDF File

AN552
AN552


Overview
M Author: AN552 SUMMARY The PIC16CXXX is ideally suited to interface directly to a keypad application.
Built in pull-up resistors and very low current consumption during sleep make it a very good candidate for battery powered remote operations and applications.
Appendix A provides an example of the code.
Performance: Code Size RAM Used 64 words 0 bytes Implementing Wake-up on Key Stroke Stan D’Souza Microchip Technology Inc.
INTRODUCTION Microchip's PIC16CXXX microcontroller family are ideally suited to directly interface to a keypad.
The high 4-bits of PORTB (RB7:RB4) have internal pull-ups and can trigger a “change on state” interrupt.
This interrupt, if enabled, will wake the microcontroller from SLEEP.
In most battery powered applications, a microcontroller is exercised when a key is pressed (e.
g.
, in a remote keyless entry system).
The life of the battery can be extended by using PIC16CXXX microcontrollers.
This is done by putting the PIC16CXXX microcontroller into SLEEP mode for most of the time and wake-up only when a key is pressed.
FIGURE 1: 4 KEY INTERFACE TO PIC16CXXX 4x1k LED1 LED2 LED3 LED4 SW1 SW2 SW3 SW4 4x100Ω RB0 RB1 RB2 RB3 RB4 RB5 RB6 RB7 PIC16CXXX IMPLEMENTATION Figure 1 depicts an application where four keys are connected to RB7:RB4.
Internal pull-ups are used to maintain a high level on these inputs.
In this example, LEDs are connected to RB3:RB0.
When SW1 is pressed, LED1 is turned on and when SW2 is pressed, LED2 is turned on and so on.
The PIC16CXXX is normally in SLEEP mode with the “change on state” interrupt enabled.
When SW1 is pressed, RB4 goes low and triggers an interrupt.
Since the PIC16CXXX is in SLEEP, it first wakes up and starts executing code at the interrupt vector.
Note that if the global interrupt is enabled, the program execution after an interrupt is at the interrupt vector, if the global interrupt is not enabled, the program starts executing the first line of code right after the SLEEP instruction.
After waking up, a...



Similar Datasheet


@ 2014 :: Datasheetspdf.com :: Semiconductors datasheet search & download site. (Privacy Policy & Contact)