45181 Parallax Inc, 45181 Datasheet - Page 102

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
By adjusting the value in W before the RETIW command, various amounts of cycle bandwidth will be
allocated to the main routines. Normally this won’t be a problem but care should be taken to ensure that
the RTCC doesn’t rollover too often, causing little or no cycle time to be allocated to the main routines.
If the RTCC adjustment value is too small for the size of the interrupt routine, the main routine may
eventually hang up, may not execute at all, or the interrupt routine will miss the rollover and only
execute every 256 cycles. Use the following equation as a general rule-of-thumb when determining the
minimum adjustment value:
Minimum RTCC Adjustment Value = -(max cycles for interrupt + 6)
The 6 in this equation accounts for the number of cycles required to enter the interrupt routine (3 cycles)
plus the number of additional cycles needed to complete the longest command (3 cycles extra to finish
an IREAD). If the IREAD command is not used in the main program, a value of -(maximum cycles for
interrupt + 4) is the minimum, allowing for only a single instruction in the main routine to be executed
between interrupts.
As an example, the following interrupt routine takes 4 cycles to execute:
Interrupt
The adjustment value of –8, which is –(max cycles for interrupt + 4), will cause the interrupt routine to
execute every 8 cycles and will only allow one single-cycle or one three-cycle instruction in the main
routine to execute between interrupts. If the main routine contained an IREAD command, however, the
main routine would execute one instruction between interrupts until it reached the IREAD, at which
point it would get eternally stuck, and only the interrupt would continue. As another example, if the
adjustment value was –7, this would be too small an adjustment and would cause the interrupt routine
to execute, but no instructions in the main routine would execute at all.
Page 102 SX-Key/Blitz Development System Manual 2.0 Parallax, Inc.
MOV
RETIW
1) RTCC rolls over
2) 3 cycles required to enter interrupt routine
3) Interrupt routine executes
4) –50 (206 in twos-compliment) is added to RTCC
5) RTCC rolls over again in exactly 19 additional
cycles (Path 1) or 32 additional cycles (Path 2)
W, #-8
Event
; 1 cycle
; 3 cycles
Table 21 - Interrupt Timing
Total Cycles = 31 + 19 =
(28 cycles)
RTCC = 237
RTCC = 31
RTCC = 0
RTCC = 3
Path 1
50
Total Cycles = 18 + 32 =
(15 cycles)
RTCC = 224
RTCC = 18
RTCC = 0
RTCC = 3
Path 2
50

Related parts for 45181