45111 Parallax Inc, 45111 Datasheet - Page 96

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
Main
The following are points to remember with Comparator mode:
10.3 The SX48/52 Multi-Function Timers
In addition to the standard timers (RTCC and watchdog), the SX48/52 devices come with two Multi-
Function Timers T1 and T2. These timers are useful to replace a software solution for generating PWM
signals, counting events, and generating longer time delays.
Each timer comes with a free-running 16-bit counter. At reset, the counters are initialized with $0000,
and then, they start continuously counting upwards. The counters can either be clocked from the
system clock (through an 8-bit prescaler), or from an external transition at the external clock pin. This
input can be configured to sense positive, or negative transitions.
Each counter has associated 16-bit capture and comparison registers. As an option, various events can
be used to trigger an interrupt, or to generate an output signal.
Page 96 SX-Key/Blitz Development System Manual 2.0 Parallax, Inc.
Port B I/O pins 1 and 2 are the comparator inputs and I/O pin 0 is, optionally, the comparator
result output.
Port B I/O pin 0 may be used as a normal I/O pin by setting the OE bit of the Comparator register.
The comparator is independent of the clock source and thus will operate even if the SX chip is
halted or in SLEEP mode. To avoid spurious current draw during SLEEP mode, disable the
comparator.
; Comparator Configuration
;
MODE $08
MOV
MODE $0F
MOV
MODE $08
MOV
JMP
!rb,#%00000000 ; Enable comparator and result output
!rb,#%11111110 ; Port B bits 1-7 to input, bit 0 to input
!rb,#$00
Main
; Set Mode to Comparator configuration
; Set Mode to allow Direction configuration
; Here, bit 0 of W holds result of compare

Related parts for 45111