SN8P1700
8-bit micro-controller build-in 12-bit ADC
SONiX TECHNOLOGY CO., LTD
Page 160
Revision 1.93
PULL-UP RESISTERS
SN8P1700 series chips built-in pull-up resisters in port 0, port 1, port4 and port 5. For MASK type compatible issues,
SONIX 8-bit MCU assembler provide a @SET_PUR macro to control pull-up resisters. @SET_PUR macro only
allows enable or disable pull-up resisters as a whole port.
SN8P1702 / SN8P1704:
@SET_PUR VAL
I/O Port
Port 7
Port 6
Port 5
Port 4
Port 3
Port 2
Port 1
Port 0
VAL
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Disable
Pull-up
0 0
0 0
Enable Pull-up
Fixed “0”
Fixed “0”
1 1
Fixed “0”
Fixed “0”
1 1
SN8P1706 / SN8P1707 / SN8P1708:
@SET_PUR VAL
I/O Port
Port 7
Port 6
Port 5
Port 4
Port 3
Port 2
Port 1
Port 0
VAL
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Disable
Pull-up
0 0
0 0 0
Enable Pull-up
Fixed “0”
Fixed “0”
1 1
Fixed “0”
1 1 1
Example 1: Enable port 0 and port 1 pull-up resisters and disable others
CHIP SN8P1708
ORG
0x10
Main:
.
.
@SET_PUR
0x03
; Enable port 0 and port 1 pull-up resisters
Example 2: Enable all pull-up resisters
CHIP SN8P1708
ORG
0x10
Main:
.
.
@SET_PUR
0x37
; Enable port 0, port 1, port 4 and port 5 pull-up resisters
Note:
a. Enable on-chip pull-up resisters of port 0 and port 1 to avoid unpredicted wakeup in sleep mode.
b. SN8P1704 and SN8P1702 must call @SET_PUR at least one time to avoid sleep mode fail.