45111 Parallax Inc, 45111 Datasheet - Page 101

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
The following code snippet demonstrates this:
Interrupt
Start
Main
The above code will cause the interrupt routine to be executed once every 256 clock cycles (when RTCC
rolls over from 255 to 0). A different return-from-interrupt command called RETIW can be used, how-
ever, to customize the time interval (cycle interval) in which the interrupt executes. RETIW, like RETI,
causes a return from the interrupt routine. RETIW has the additional effect of adding the contents of W
to the RTCC register upon return. By moving a negative number into W just before executing an
RETIW, the RTCC will be backed-off by the designated number of cycles. This method also has the
benefit of compensating for the number of cycles spent in the interrupt routine.
For example, if the interrupt routine should be executed once every 50 cycles, use the following two
lines of code in place of the RETI command in the listing above:
Of course, for this to work properly the interrupt routine must take 46 cycles or less (see below for cycle
bandwidth calculation). Even if the interrupt routine contained multiple paths of execution, due to com-
pare-jump instructions, and each path consumed a different number of clock cycles, the interrupt would
still execute once every 50 cycles. Table 21 – Interrupt Timing, below, demonstrates the effects on the
RTCC if the interrupt routine contained two possible paths of execution (path 1 is 28 cycles and path 2 is
15 cycles):
DEVICE STACKX
RESET Start
ORG
RETI
; RTCC Rollover Interrupt Configuration
;
MOV
NOP
JMP
MOV
RETIW
$0
!OPTION, #%10011111
Main
W, #-50
10 SX Special Features and Coding Tips
; Interrupt routine (must be at address $0)
; rest of interrupt routine goes here
; Enable RTCC rollover interrupt
; RTCC inc on clock, no prescale
; rest of main routine goes here
SX-Key/Blitz Development System Manual 2.0 Parallax, Inc. Page 101

Related parts for 45111