45181 Parallax Inc, 45181 Datasheet - Page 96

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
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 45181