45181 Parallax Inc, 45181 Datasheet - Page 95

SX TECH TOOL KIT NO POWER

45181

Manufacturer Part Number
45181
Description
SX TECH TOOL KIT NO POWER
Manufacturer
Parallax Inc
Series
SXr
Type
Microcontrollerr
Datasheet

Specifications of 45181

Contents
SX Book, SX Key, SX Tech Board, Samples, Resonators, Cable and Manual
Product
Microcontroller Basic Stamps
Operating Supply Voltage
5 V
For Use With/related Products
SX MCUs
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
The following are points to remember with Wake-Up Interrupts:
10.2.7 Comparator
I/O pins 0 through 2 in port B can be set for comparator operation. This can be configured by writing to
the EN and OE bits of the Comparator register (CMP_B) and monitored by reading the RES bit. The
comparator mode is disabled by default. Comparator mode can be activated for all three pins,
regardless of pin direction, but really matters only when pin 1 and 2 are set to input mode (pin 0 can
optionally be set to output the comparative result). By configuring Comparator mode, the SX chip can
quickly determine logical differences between two signals and even indicate those differences for
external circuitry.
When comparator mode is activated, the RES bit in the Comparator register indicates the result of the
compare. A high bit (1) indicates the voltage on pin 2 is higher than that of pin 1, a low bit (0) indicates
the voltage on pin 2 is lower than that of pin 1. If the OE bit (Output Enable) of the Comparator register
is cleared, output pin 0 of port B reflects the state of the RES bit.
To configure port B I/O pins 0 though 2 for Comparator mode:
The following code snippet demonstrates this:
1) Set the MODE register to $08 (the value for Comparator register configuration).
2) Use the port configuration instruction to enable the Comparator and, optionally, the result output
3) Set I/O pin directions appropriately.
The interrupt routine must be located starting at address $0 in the SX program.
It is up to the SX program to clear the bits of the Pending register when future interrupts on that pin
are desired. This should normally be done as part of the interrupt routine. The MOV !rb,
#%00000000 instruction effectively clears all bits of the Pending register at the same time that it
stores the current edge detection status in W.
The SX chip will activate the interrupt routine exactly 5 clock cycles in Turbo mode or exactly 10
clock cycles in compatible mode after a Wake-Up Edge Detection event occurs. This deterministic
feature allows for nearly jitter-free interrupt response. Latency may vary by as much as +1
instruction cycle when interrupting on external asynchronous events, thus a high clock speed may
be necessary to lessen the effects.
If multiple interrupt pins are required, the SX chip may not be able to properly process them in
certain situations. See Interrupts, below, for more information.
An edge-detection interrupt event will wake up the SX chip from a SLEEP mode.
on pin 0.
10 SX Special Features and Coding Tips
SX-Key/Blitz Development System Manual 2.0 Parallax, Inc. Page 95

Related parts for 45181