器件名称: ST72251
功能描述: ST7 KEYPAD DECODING TECHNIQUES, IMPLEMENTING WAKE-UP ON KEYSTROKE
文件大小: 66.79KB 共11页
简 介:APPLICATION NOTE
ST7 KEYPAD DECODING TECHNIQUES, IMPLEMENTING WAKE-UP ON KEYSTROKE
by Microcontroller Division Application Team
INTRODUCTION
The goal of this application note is to present an example of the use of the HALT mode. In this application, the MCU (here a ST72251) is waked up by an external interrupt caused by someone pressed a key on the 4x4 matrixed keypad.
1 ST7 / KEYBOARD INTERFACE
Rows are connected to inputs with pull-up and interrupts (Port C). Columns are connected to Port A configured as output. The result of the interrupt (the value of the pressed key) is sent on LEDS (Port B) and stored into the X register. In our configuration, we have to add 4 pull-up resistors on Port A (from PA0 to PA3) to be able to apply a high level on the corresponding pads. Figure 1. ST7 / keypad interface set-up
4x100k 8x560 VDD PC0 PC1 PC2 PC3 ST7 PA0 PA1 PA2 GND PA3
AN980/1098
1/10
1
ST72251 CONFIGURATION
2 ST72251 CONFIGURATION
The application has been validated with a ST72251. Its configuration is described in this part. Refer to your datasheet for more details. 2.1 I/O CONTROL Rows are connected to pins configured as inputs (Port C as input with pull up and interrupts). Columns are connected to pins configured as outputs (Port A). External interrupts are caused by a low level applied to a pin of Port C (caused by a key pressed), they wake up the MCU which was in HALT mode. Port B is configured as outputs to send the value of the pressed key on LEDS. Please, refer ……