SN8P1700
8-bit micro-controller build-in 12-bit ADC
RAM BANK SELECTION
The RBANK is a 1-bit register located at 87H in RAM bank 0. The user can access RAM data by using this register
pointing to working RAM bank for ACC to read/write RAM data.
RBANK initial value = xxxx xxx0
087H
RBANK
Bit 7
0
-
Bit 6
0
-
Bit 5
0
-
Bit 4
0
-
Bit 3
0
-
Bit 2
0
-
Bit 1
0
-
Bit 0
RBNKS0
R/W
RBNKSn: RAM bank selecting control bit. 0 = bank 0, 1 = bank 1.
ꢃExample: RAM bank selecting.
; BANK 0
CLR
.
RBANK
; b0bclr FRBNKS0
; BANK 1
MOV
A, #1
; b0bset FRBNKS0
B0MOV
.
RBANK, A
ꢂ
Note: “B0MOV” instruction can access the RAM of bank 0 in other bank situation directly.
ꢃExample: Access RAM bank 0 in RAM bank 1.
; BANK 1
B0BSET
B0MOV
MOV
.
RBNKS0
A, BUF0
BUF1, A
; Get into RAM bank 1
; Read BUF0 data. BUF0 is in RAM bank0.
; Write BUF0 data to BUF1. BUF1 is in RAM bank1.
.
.
MOV
B0MOV
A, BUF1
BUF0, A
; Read BUF1(bank1) data and store in ACC.
; Write ACC data to BUF0(bank0).
Under bank 1 situation, using “B0MOV” instruction is an easy way to access RAM bank 0 data. User can make a habit
to read/write system register (0087H~00FFH). Then user can access system registers without switching RAM bank.
ꢃExample: To Access the system registers in bank 1 situation.
; BANK 1
B0BSET
.
RBNKS0
.
; Switch the Ram Bank into bank 1
MOV
B0MOV
.
B0MOV
MOV
A, #0FFH
P1, A
; Set all pins of P1 to be logic high.
; Operate the bank 0 special register by the b0mov instruction
; while the RAM system in the bank1.
; Read P0 data in the Bank 0 and store into BUF1 in the bank 1.
;
A, P0
BUF1, A
SONiX TECHNOLOGY CO., LTD
Page 35
Revision 1.94