English
Language : 

SN8P1800 Datasheet, PDF (27/129 Pages) SONiX Technology Company – 8-Bit Micro-Controller
SN8P1800
8-bit micro-controller build-in 12-bit ADC + 72 dots LCD driver
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 0000
087H
Bit 7
Bit 6
Bit 5
Bit 4
RBANK
-
-
-
-
-
-
-
-
RBNKn: RAM bank selecting control bit. 0 = bank 0, 1 = bank 1.
Bit 3
RBNKS3
R/W
Bit 2
RBNKS2
R/W
Bit 1
RBNKS1
R/W
Bit 0
RBNKS0
R/W
Example: RAM bank selecting.
; BANK 0
; BANK 1
CLR
.
MOV
B0MOV
.
RBANK
A, #1
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
.
.
MOV
B0MOV
RBNKS0
A, BUF0
BUF1, A
.
A, BUF1
BUF0, A
; Get into RAM bank 1
; Read BUF0 data. BUF0 is in RAM bank0.
; Write BUF0 data to BUF1. BUF1 is in RAM bank1.
; Read BUF1 data and store in ACC.
; Write ACC data to BUF0.
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
.
MOV
B0MOV
.
B0MOV
MOV
RBNKS0
.
A, #0FFH
P1, A
A, P0
BUF1, A
; Get into RAM bank 1
; Set all pins of P1 to be logic high.
; Read P0 data and store into BUF1 of RAM bank 1.
SONiX TECHNOLOGY CO., LTD
Page 27
Revision 1.94