SN8P2318 Series
C-type LCD, RFC 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD
Page 73
Version 1.5
Example: LCD shared pin control methods.
;Enable P2.0~P2.3 GPIO function.
B0BCLR
FPSEG2
; Set PSEG[2:0]=001b
B0BCLR
FPSEG1
B0BSET
FPSEG0
MOV
A, #0X0F
; Set P2.0~P2.3 to output mode.
B0MOV
P2M, A
…
B0BCLR
P2M.0
; Set P2.0 to input mode.
;Enable P2.0~P2.7 GPIO function.
B0BCLR
FPSEG2
; Set PSEG[2:0]=010b
B0BSET
FPSEG1
B0BCLR
FPSEG0
MOV
A, #0XFF
; Set P2.0~P2.7 to output mode.
B0MOV
P2M, A
…
B0BCLR
P2M.0
; Set P2.0 to input mode.
;Enable P2.0~P2.7 and P3.0~P3.3 GPIO function.
B0BCLR
FPSEG2
; Set PSEG[2:0]=011b
B0BSET
FPSEG1
B0BSET
FPSEG0
MOV
A, #0XFF
; Set P2.0~P2.7 to output mode.
B0MOV
P2M, A
MOV
A, #0X0F
; Set P3.0~P3.3 to output mode.
B0MOV
P3M, A
…
B0BCLR
P2M.0
; Set P2.0 to input mode.
B0BCLR
P3M.0
; Set P3.0 to input mode.
;Enable P2.0~P2.7 and P3.0~P3.7 GPIO function.
B0BSET
FPSEG2
; Set PSEG[2:0]=100b
B0BCLR
FPSEG1
B0BCLR
FPSEG0
MOV
A, #0XFF
; Set P2.0~P2.7 and P3.0~P3.7 to output mode.
B0MOV
P2M, A
B0MOV
P3M, A
…
B0BCLR
P2M.0
; Set P2.0 to input mode.
B0BCLR
P3M.0
; Set P3.0 to input mode.
;Disable P2.0~P2.7 and P3.0~P3.7 GPIO function.
B0BCLR
FPSEG2
; Set PSEG[2:0]=000b
B0BCLR
FPSEG1
B0BCLR
FPSEG0