45111 Parallax Inc, 45111 Datasheet - Page 94

MANUAL FOR SX-KEY/BLITZ VER. 2.0

45111

Manufacturer Part Number
45111
Description
MANUAL FOR SX-KEY/BLITZ VER. 2.0
Manufacturer
Parallax Inc
Datasheet

Specifications of 45111

Accessory Type
Manual
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
Parallax microcontroller
For Use With
70002PAR - GUIDE PROG THE SX MICRO -DAUBACH
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
10 SX Special Features and Coding Tips
and the flag indicating this will remain set until the program clears it. Additional transitions on that pin
will not cause interrupts until the associated bit in the Pending register is cleared.
To configure the I/O pins for wake-up (interrupt) edge detection:
The following code snippet demonstrates this:
Interrupt
Start
Main
Page 94 SX-Key/Blitz Development System Manual 2.0 Parallax, Inc.
1) Set I/O pin edge detection as desired. (See Edge Detection, above, for more information).
2) Set the MODE register to $0B (the value for Wake-Up Enable register configuration).
3) Use the port configuration instruction to enable the individual pins for wake-up interrupts. A high
4) Set I/O pin directions as necessary.
5) Clear the Pending register to enable new interrupts.
bit (1) disables interrupts and a low bit (0) enables interrupts.
RESET Start
ORG
MODE $09
MOV
RETI
; Wake-Up Edge Detection Configuration
;
MODE $0A
MOV
MODE $0B
MOV
MODE $0F
MOV
MODE $09
MOV
NOP
JMP
$0
!rb,%00000000
!rb,#%11111111 ; Port B bits 0-7 to falling edge
!rb#%11110000 ; Port B bits 4-7 to normal, 0-3 to Wake-Up
!rb,#%11111111 ; Port B bits 0-7 to input
!rb,%00000000
Main
; Interrupt routine (must be at address $0)
; Set Mode for Pending register
; Clear Pending/get current status in W
; rest of interrupt routine goes here
; Set Mode to allow Edge configuration
; Set Mode to allow Wake-Up configuration
; Set Mode to allow Direction configuration
; Set Mode for Pending register
; Clear register to allow new interrupts
; rest of main routine goes here

Related parts for 45111