45181 Parallax Inc, 45181 Datasheet - Page 161

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
This example for the SX20/28 will clear every General Purpose RAM register on every bank using
indirect addressing.
15.2.12 The Bank Instruction
Often it is desirable to set the bank select bits of the FSR with one instruction cycle (the MOV FSR,
#literal commands above take two cycles). The SX instruction set offers such an instruction called Bank.
The Bank instruction sets the upper bits of the FSR to point to the RAM bank required. Note: On the
SX48/52, the BANK instruction only selects one of 8 banks in either the lower 8 or upper 8 banks. FSR.7 selects
the lower or upper group of 8 banks. To select a bank, use MOV FSR, #literal or add an SETB FSR.7 instruction
after the BANK instruction. Here’s an example of how to use the Bank instruction on the SX20/28:
Init
Loop
$00-
$01-
$02-
$0F-
4
fr (5-bit address in instruction)
mov FSR, #$10
clr
inc
setb FSR.4
cjne FSR, #$10, Loop ; Repeat until all registers
Global
RTCC
IND
$0F
PC
3
Figure 29 - SX48/52 Indirect register addressing
Must be = $00
IND
FSR
2
7
$10-
$11-
$12-
$1F-
Bank Selection Bits
1
6
Bank 0
$0
$1
$2
$F
; FSR = addr of 1
; Clear register
; Point to next register
; Keep us on G.P. RAM area
; have been cleared
SX-Key/Blitz Development System Manual 2.0 Parallax, Inc. Page 161
0
5
Bank 1
$0
$1
$2
$F
15 Appendix E: SX Data Sheet
FSR ($04)
4
Bank 2
$F
$0
$1
$2
st
3
$00
RAM Reg.
$01 - $FF
Register Address
———
2
Bank 15
1
$0
$1
$2
$F
0

Related parts for 45181