SX18AC/SO Parallax Inc, SX18AC/SO Datasheet - Page 17

no-image

SX18AC/SO

Manufacturer Part Number
SX18AC/SO
Description
IC MCU 2K FLASH 50MHZ SO-18
Manufacturer
Parallax Inc
Series
SXr
Datasheet

Specifications of SX18AC/SO

Core Processor
RISC
Core Size
8-Bit
Speed
50MHz
Number Of I /o
12
Program Memory Size
3KB (2K x 12)
Program Memory Type
FLASH
Ram Size
137 x 8
Oscillator Type
Internal
Operating Temperature
0°C ~ 70°C
Package / Case
18-SOIC
Voltage - Supply (vcc/vdd)
-
Eeprom Size
-
Data Converters
-
Peripherals
-
Connectivity
-
7.2 Port B MIWU/Interrupt Configuration
The WKPND_B register comes up with a random value
upon reset. The user program must clear the register
prior to enabling the wake-up condition or interrupts. The
proper initialization sequence is:
1. Clear the WKPND_B register
2. Select the desired edge (through WKED_B register)
3. Enable the Wakeup condition (through WKEN_B regis-
Below is an example how to read the WKPND_B register
to determine which Port B pin caused the wakeup or
interrupt, and to clear the WKPND_B register:
The final “mov” instruction in this example performs an
exchange of data between the working register (W) and
the WKPND_B register. This exchange occurs only with
Port B accesses. Otherwise, the “mov” instruction does
not perform an exchange, but only moves data from the
source to the destination.
Here is an example of a program segment that config-
ures the RB0, RB1, and RB2 pins to operate as Multi-
Input Wakeup/Interrupt pins, sensitive to falling edges:
© 1998 Scenix Semiconductor, Inc. All rights reserved.
ter)
mov
clr
mov
M,#$09
W
!RB,W
;W contains WKPND_B
;contents of W exchanged
;with contents of WKPND_B
- 17 -
To prevent false interrupts, the enabling step (clearing
bits in WKEN_B) should be done as the last step in a
sequence of Port B configuration steps.
After this program segment is executed, the device can
receive interrupts on the RB0, RB1, and RB2 pins. If the
device is put into the power down mode (by executing a
“sleep” instruction), the device can then receive wakeup
signals on those same pins.
mov M,#$09
mov W,#$00
mov !RB,W
mov M,#$0F
mov W,#$07
mov !RB,W
mov M,#$0A
mov !RB,W
mov M,#$0B
mov W,#$F8h ;load W with the value F8h
mov !RB,W
;prepare to access WKPND_B
;(pending) register
;clear W
;clear all wakeup pending flags
;prepare to write port data
;direction registers
;load W with the value 07h
;configure RB0-RB2 to be inputs
;prepare to write WKED_B
;(edge) register
;W contains the value 07h
;configure RB0-RB2 to sense
;falling edges
;prepare to write WKEN_B (enable)
;register
;enable RB0-RB2 to operate as
;wakeup inputs
SX18AC / SX20AC / SX28AC
www.scenix.com

Related parts for SX18AC/SO