
SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 1 Version 0.9
SN8PC20
USER’S MANUAL
Version 0.9
SSO
O
N
NiiXX 88--
B
Biitt
M
Miiccrroo--
C
Coonnttrroolllleerr
SONIX reserves the right to make change without further notice to any products herein to improve reliability, function or design. SONIX does not
assume any liability arising out of the application or use of any product or circuit described herein; neither does it convey any license under its patent
rights nor the rights of others. SONIX products are not designed, intended, or authorized for us as components in systems intended, for surgical
implant into the body, or other applications intended to support or sustain life, or for any other application in which the failure of the SONIX product
could create a situation where personal injury or death may occur. Should Buyer purchase or use SONIX products for any such unintended or
unauthorized application. Buyer shall indemnify and hold SONIX and its officers, employees, subsidiaries, affiliates and distributors harmless against
all claims, cost, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death
associated with such unintended or unauthorized use even if such claim alleges that SONIX was negligent regarding the design or manufacture of
the part.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 2 Version 0.9
AMENDENT HISTORY
1. Modify 455KHz crystal application circuit.
2. Add “@GreenMode” macro to control system green mode.
3. Modify IR application circuit.
1. Add “Development Tool” section.
2. Modify internal low RC frequency to 10KHz @3V.
1. Modify some formals.
2. Add IHRC frequency curves.
1. Add external low clock crystal type 32KHz.
1. Add SN8PC2016S and SN8PC2014S package type.
1. Modify “ELECTRICAL CHARACTERISTIC” operating temperature range from 0~70
℃ to -20~70℃.
1. Modify “ELECTRICAL CHARACTERISTIC” Supply voltage
1. Modify “IR APPLICATION CIRCUIT“ section.
2. Modify ” ICE and EV-KIT APPLICATION NOTIC” section.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 3 Version 0.9
Table of Content
AMENDENT HISTORY ................................................................................................................................ 2
PRODUCT OVERVIEW ......................................................................................................................... 6
1.1 FEATURES ........................................................................................................................................ 6
1.2 SYSTEM BLOCK DIAGRAM .......................................................................................................... 7
1.3 PIN ASSIGNMENT ........................................................................................................................... 8
1.4 PIN DESCRIPTIONS ......................................................................................................................... 9
1.5 PIN CIRCUIT DIAGRAMS ............................................................................................................. 10
CENTRAL PROCESSOR UNIT (CPU) .............................................................................................. 11
2.1 PROGRAM MEMORY (ROM) ....................................................................................................... 11
2.1.1 RESET VECTOR (0000H) ...................................................................................................... 12
2.1.2 INTERRUPT VECTOR (0008H) ............................................................................................. 13
2.1.3 LOOK-UP TABLE DESCRIPTION ........................................................................................ 15
2.1.4 JUMP TABLE DESCRIPTION ............................................................................................... 17
2.1.5 CHECKSUM CALCULATION............................................................................................... 19
2.2 DATA MEMORY (RAM) ................................................................................................................ 20
2.2.1 SYSTEM REGISTER .............................................................................................................. 20
2.2.1.1 SYSTEM REGISTER TABLE ............................................................................................ 20
2.2.1.2 SYSTEM REGISTER DESCRIPTION ............................................................................... 20
2.2.1.3 BIT DEFINITION of SYSTEM REGISTER ....................................................................... 21
2.2.2 ACCUMULATOR ................................................................................................................... 22
2.2.3 PROGRAM FLAG ................................................................................................................... 23
2.2.4 PROGRAM COUNTER........................................................................................................... 24
2.2.5 H, L REGISTERS..................................................................................................................... 27
2.2.6 Y, Z REGISTERS..................................................................................................................... 28
2.2.7 R REGISTER ........................................................................................................................... 29
2.3 ADDRESSING MODE .................................................................................................................... 30
2.3.1 IMMEDIATE ADDRESSING MODE .................................................................................... 30
2.3.2 DIRECTLY ADDRESSING MODE ....................................................................................... 30
2.3.3 INDIRECTLY ADDRESSING MODE ................................................................................... 30
2.4 STACK OPERATION ...................................................................................................................... 31
2.4.1 OVERVIEW ............................................................................................................................. 31
2.4.2 STACK REGISTERS ............................................................................................................... 32
2.4.3 STACK OPERATION EXAMPLE.......................................................................................... 33
2.5 CODE OPTION TABLE .................................................................................................................. 34
2.5.1 Reset_Pin code option .............................................................................................................. 34
2.5.2 Security code option ................................................................................................................. 34
RESET ..................................................................................................................................................... 35
3.1 OVERVIEW ..................................................................................................................................... 35
3.2 POWER ON RESET ......................................................................................................................... 36
3.3 WATCHDOG RESET ...................................................................................................................... 36
3.4 BROWN OUT RESET ..................................................................................................................... 37
3.4.1 THE SYSTEM OPERATING VOLTAGE .............................................................................. 38
3.4.2 LOW VOLTAGE DETECTOR (LVD) ................................................................................... 38
3.4.3 BROWN OUT RESET IMPROVEMENT............................................................................... 39
3.5 EXTERNAL RESET ........................................................................................................................ 40
3.6 EXTERNAL RESET CIRCUIT ....................................................................................................... 40
3.6.1 Simply RC Reset Circuit .......................................................................................................... 40
3.6.2 Diode & RC Reset Circuit ........................................................................................................ 41

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 4 Version 0.9
3.6.3 Zener Diode Reset Circuit ........................................................................................................ 41
3.6.4 Voltage Bias Reset Circuit ....................................................................................................... 42
3.6.5 External Reset IC ...................................................................................................................... 42
SYSTEM CLOCK .................................................................................................................................. 43
4.1 OVERVIEW ..................................................................................................................................... 43
4.2 FCPU (INSTRUCTION CYCLE) ...................................................................................................... 43
4.3 SYSTEM HIGH-SPEED CLOCK .................................................................................................... 44
4.3.1 HIGH_CLK CODE OPTION ................................................................................................... 44
4.3.2 INTERNAL HIGH-SPEED OSCILLATOR RC TYPE (IHRC) ............................................. 44
4.3.3 EXTERNAL HIGH-SPEED OSCILLATOR ........................................................................... 44
4.3.4 EXTERNAL OSCILLATOR APPLICATION CIRCUIT ....................................................... 45
4.4 SYSTEM LOW-SPEED CLOCK ..................................................................................................... 46
4.5 OSCM REGISTER ........................................................................................................................... 47
4.6 SYSTEM CLOCK MEASUREMENT ............................................................................................. 47
4.7 SYSTEM CLOCK TIMING ............................................................................................................. 48
SYSTEM OPERATION MODE ........................................................................................................... 50
5.1 OVERVIEW ..................................................................................................................................... 50
5.2 NORMAL MODE ............................................................................................................................ 51
5.3 SLOW MODE .................................................................................................................................. 51
5.4 POWER DOWN MDOE .................................................................................................................. 51
5.5 GREEN MODE ................................................................................................................................ 52
5.6 OPERATING MODE CONTROL MACRO .................................................................................... 53
5.7 WAKEUP ......................................................................................................................................... 54
5.7.1 OVERVIEW ............................................................................................................................. 54
5.7.2 WAKEUP TIME ...................................................................................................................... 54
5.7.3 P1W WAKEUP CONTROL REGISTER ................................................................................ 55
INTERRUPT ........................................................................................................................................... 56
6.1 OVERVIEW ..................................................................................................................................... 56
6.2 INTEN INTERRUPT ENABLE REGISTER ................................................................................... 56
6.3 INTRQ INTERRUPT REQUEST REGISTER ................................................................................ 57
6.4 GIE GLOBAL INTERRUPT OPERATION .................................................................................... 57
6.5 PUSH, POP ROUTINE..................................................................................................................... 58
6.6 EXTERNAL INTERRUPT OPERATION (INT0) ........................................................................... 59
6.7 T0 INTERRUPT OPERATION........................................................................................................ 60
6.8 MULTI-INTERRUPT OPERATION ............................................................................................... 61
I/O PORT ................................................................................................................................................ 62
7.1 OVERVIEW ..................................................................................................................................... 62
7.2 I/O PORT MODE ............................................................................................................................. 63
7.3 I/O PULL UP REGISTER ................................................................................................................ 64
7.4 I/O PORT DATA REGISTER .......................................................................................................... 65
TIMERS .................................................................................................................................................. 66
8.1 WATCHDOG TIMER ...................................................................................................................... 66
8.2 TIMER 0 (T0) ................................................................................................................................... 68
8.2.1 OVERVIEW ............................................................................................................................. 68
8.2.2 T0 Timer Operation .................................................................................................................. 68
8.2.3 T0M MODE REGISTER ......................................................................................................... 69
8.2.4 T0C COUNTING REGISTER ................................................................................................. 69
8.2.5 T0 TIMER OPERATION SEQUENCE ................................................................................... 70
IR OUTPUT ............................................................................................................................................ 71
9.1 OVERVIEW ..................................................................................................................................... 71
9.2 IR CONTROL REGISTER ............................................................................................................... 71
9.2.1 IRM MODE REGISTER .......................................................................................................... 71

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 5 Version 0.9
9.2.2 IRC COUNTING REGISTER.................................................................................................. 72
9.2.3 IRR AUTO-LOAD REGISTER ............................................................................................... 72
9.2.4 IRD IR DUTY CONTROL REGISTER .................................................................................. 73
9.3 IR OUTPUT OPERATION SEQUENCE......................................................................................... 74
9.4 IR APPLICATION CIRCUIT .......................................................................................................... 75
INSTRUCTION TABLE ................................................................................................................... 76
ELECTRICAL CHARACTERISTIC .............................................................................................. 77
11.1 ABSOLUTE MAXIMUM RATING ................................................................................................ 77
11.2 ELECTRICAL CHARACTERISTIC ............................................................................................... 77
11.3 CHARACTERISTIC GRAPHS ................................................................................................................. 78
DEVELOPMENT TOOL .................................................................................................................. 79
12.1 SN8PC20 EV-KIT ............................................................................................................................. 79
12.2 ICE AND EV-KIT APPLICATION NOTIC ...................................................................................... 80
OTP PROGRAMMING PIN ............................................................................................................. 81
13.1 THE PIN ASSIGNMENT OF EASY WRITER TRANSITION BOARD SOCKET: .............................................. 81
13.2 PROGRAMMING PIN MAPPING: .......................................................................................................... 82
MARKING DEFINITION ................................................................................................................. 83
14.1 INTRODUCTION ............................................................................................................................ 83
14.2 MARKING INDETIFICATION SYSTEM ...................................................................................... 83
14.3 MARKING EXAMPLE ................................................................................................................... 84
14.4 DATECODE SYSTEM .................................................................................................................... 84
PACKAGE INFORMATION ........................................................................................................... 85
15.1 P-DIP 20 PIN .................................................................................................................................... 85
15.2 SOP 20 PIN ....................................................................................................................................... 86
15.3 SSOP 20 PIN ..................................................................................................................................... 87
15.4 SOP 16 PIN ....................................................................................................................................... 88
15.5 SOP 14 PIN ....................................................................................................................................... 89

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 6 Version 0.9
PRODUCT OVERVIEW
1.1 FEATURES
Features Selection Table
Fix 38KHz,
Normal current
Duty/cycle programmable,
Normal current
Duty/cycle programmable,
400mA sink current
Duty/cycle programmable,
400mA sink current
Duty/cycle programmable,
400mA sink current
OTP ROM size: 2K * 16 bits.
1 internal interrupts: T0
1 external interrupts: INT0
Bi-directional: P0, P1, P5.
One channel duty/cycle programmable IR output.
400mA IR output pin: P5.4/IROUT
Wakeup: P0, P1 level change trigger.
Pull-up resisters: P0, P1, P5.
External high clock: RC type up to 8 MHz
External Interrupt trigger edge: P0.0
External high clock: Crystal type up to 8 MHz
controlled by PEDGE register.
External low clock: Crystal type 32KHz and 455KHz
Internal high clock: RC type 8MHz
Internal low clock: RC type 10KHz(3V)
Fcpu = Fosc/1, Fpsc/2, Fosc/4, Fosc/8
Normal mode: Both high and low clock active
Slow mode: Low clock only
Sleep mode: Both high and low clock stop
One clocks per instruction cycle (1T)
Green mode: Periodical wakeup by timer
Most of instructions are one cycle only.
All ROM area JMP instruction.
Package (Chip form support)
All ROM area CALL address instruction.
All ROM area lookup table function (MOVC).

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 7 Version 0.9
1.2 SYSTEM BLOCK DIAGRAM
INTERRUPT
CONTROL
EXTERNAL
HIGH OSC.
ACC
INTERNAL
LOW RC
TIMING GENERATOR
RAM
SYSTEM REGISTERS
1-Level LVD
(Low Voltage Detector)
WATCHDOG TIMER
TIMER & COUNTER
P0 P5P1
IR Generator
ALU
PC
FLAGS
IR
OTP
ROM
INTERNAL HIGH
RC 8MHz
IR Output

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 8 Version 0.9
1.3 PIN ASSIGNMENT
SN8PC20P (PDIP 20 pins)
SN8PC20S (SOP 20 pins)
SN8PC20X (SSOP 20 pins)

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 9 Version 0.9
1.4 PIN DESCRIPTIONS
Power supply input pins for digital and analog circuit.
RST: System external reset input pin. Schmitt trigger structure, active “low”, normal stay to
“high”.
VPP: OTP power input pin in programming mode.
P0.2: Input only pin with Schmitt trigger structure and no pull-up resistor.
XIN: Oscillator input pin while external oscillator enable (crystal and RC).
P0.3: Bi-direction pin. Schmitt trigger structure. Built-in pull-up resistors and level change
wake-up function as input mode.
XOUT: Oscillator output pin while external crystal enable.
P0.4: Bi-direction pin. Schmitt trigger structure. Built-in pull-up resistors and level change
wake-up function as input mode.
P0.0: Bi-direction pin. Schmitt trigger structure. Built-in pull-up resistors and level change
wake-up function as input mode.
INT0: External interrupt 0 input pin.
P0: Bi-direction pin. Schmitt trigger structure. Built-in pull-up resistors and level change wake-up
function as input mode.
P1: Bi-direction pin. Schmitt trigger structure. Built-in pull-up resistors and level change wake-up
function controlled by P1W register as input mode.
P5.0: Bi-direction pin. Schmitt trigger structure. Built-in pull-up resistors as input mode.
P5.4: Bi-direction pin. Schmitt trigger structure. Built-in pull-up resistors as input mode.
IROUT: Duty/cycle programmable IR signal output pin.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 10 Version 0.9
1.5 PIN CIRCUIT DIAGRAMS
I/O with Schmitt-trigger (ViH=0.7*Vdd, ViL=0.3*Vdd) and Pull-up Resistor(200KΩ@3V):
Pull-Up
Resistor
Output
Latch
Pin
PnUR
PnM
Input Bus
Output Bus
Input Only with Schmitt-trigger (ViH=0.7*Vdd, ViL=0.3*Vdd) and Vpp High Voltage:
Pin
OTP Program Mode
Input Bus
OTP Vpp Input
Reset Pin Code Option
Reset Trigger
Oscillator shared I/O with Schmitt-trigger (ViH=0.7*Vdd, ViL=0.3*Vdd) and Pull-up Resistor(200KΩ@3V):
Pull-Up
Resistor
Output
Latch
Pin
PnUR
PnM
Input Bus
Output Bus
Oscillator
Code Option
Oscillator
IR output shared I/O with Schmitt-trigger (ViH=0.7*Vdd, ViL=0.3*Vdd) and Pull-up Resistor(200KΩ@3V):
Pull-Up
Resistor
Output
Latch
Pin
PnUR
PnM
Input Bus
Output Bus
IREN
IR Signal

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 11 Version 0.9
CENTRAL PROCESSOR UNIT (CPU)
2.1 PROGRAM MEMORY (ROM)
2K words ROM
User reset vector
Jump to user start address
The ROM includes Reset vector, Interrupt vector, General purpose area and Reserved area. The Reset vector is
program beginning address. The Interrupt vector is the head of interrupt service routine when any interrupt occurring.
The General purpose area is main program area including main loop, sub-routines and data table.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 12 Version 0.9
2.1.1 RESET VECTOR (0000H)
A one-word vector address area is used to execute system reset.
Power On Reset (NT0=1, NPD=0).
Watchdog Reset (NT0=0, NPD=0).
External Reset (NT0=1, NPD=1).
After power on reset, external reset or watchdog timer overflow reset, then the chip will restart the program from
address 0000h and all system registers will be set as default values. It is easy to know reset status from NT0, NPD
flags of PFLAG register. The following example shows the way to define the reset vector in the program memory.
Example: Defining Reset Vector
; Jump to user program address.
; 0010H, The head of user program.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 13 Version 0.9
2.1.2 INTERRUPT VECTOR (0008H)
A 1-word vector address area is used to execute interrupt request. If any interrupt service executes, the program
counter (PC) value is stored in stack buffer and jump to 0008h of program memory to execute the vectored interrupt.
Users have to define the interrupt vector. The following example shows the way to define the interrupt vector in the
program memory.
Note: ”PUSH”, “POP” instructions save and load ACC/PFLAG without (NT0, NPD). PUSH/POP buffer is a
unique buffer and only one level.
Example: Defining Interrupt Vector. The interrupt service routine is following ORG 8.
; Jump to user program address.
; Save ACC and PFLAG register to buffers.
; Load ACC and PFLAG register from buffers.
; End of interrupt service routine
; The head of user program.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 14 Version 0.9
Example: Defining Interrupt Vector. The interrupt service routine is following user program.
; Jump to user program address.
; 0008H, Jump to interrupt service routine address.
; 0010H, The head of user program.
;The head of interrupt service routine.
; Save ACC and PFLAG register to buffers.
; Load ACC and PFLAG register from buffers.
; End of interrupt service routine.
Note: It is easy to understand the rules of SONIX program from demo programs given above. These
points are as following:
1. The address 0000H is a “JMP” instruction to make the program starts from the beginning.
2. The address 0008H is interrupt vector.
3. User’s program is a loop routine for main purpose application.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 15 Version 0.9
2.1.3 LOOK-UP TABLE DESCRIPTION
In the ROM’s data lookup function, Y register is pointed to middle byte address (bit 8~bit 15) and Z register is pointed
to low byte address (bit 0~bit 7) of ROM. After MOVC instruction executed, the low-byte data will be stored in ACC and
high-byte data stored in R register.
Example: To look up the ROM data located “TABLE1”.
; To set lookup table1’s middle address
; To set lookup table1’s low address.
; To lookup data, R = 00H, ACC = 35H
; Increment the index address for next address.
; Z overflow (FFH 00), Y=Y+1
; To lookup data, R = 51H, ACC = 05H.
; To define a word (16 bits) data.
Note: The Y register will not increase automatically when Z register crosses boundary from 0xFF to
0x00. Therefore, user must be take care such situation to avoid look-up table errors. If Z register is
overflow, Y register must be added one. The following INC_YZ macro shows a simple method to process
Y and Z registers automatically.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 16 Version 0.9
Example: Modify above example by “INC_YZ” macro.
; To set lookup table1’s middle address
; To set lookup table1’s low address.
; To lookup data, R = 00H, ACC = 35H
; Increment the index address for next address.
; To lookup data, R = 51H, ACC = 05H.
; To define a word (16 bits) data.
The other example of look-up table is to add Y or Z index register by accumulator. Please be careful if “carry” happen.
Example: Increase Y and Z register by B0ADD/ADD instruction.
; To set lookup table’s middle address.
; To set lookup table’s low address.
; To lookup data. If BUF = 0, data is 0x0035
; If BUF = 1, data is 0x5105
; If BUF = 2, data is 0x2012
; To define a word (16 bits) data.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 17 Version 0.9
2.1.4 JUMP TABLE DESCRIPTION
The jump table operation is one of multi-address jumping function. Add low-byte program counter (PCL) and ACC
value to get one new PCL. If PCL is overflow after PCL+ACC, PCH adds one automatically. The new program counter
(PC) points to a series jump instructions as a listing table. It is easy to make a multi-jump program depends on the
value of the accumulator (A).
Note: PCH only support PC up counting result and doesn’t support PC down counting. When PCL is
carry after PCL+ACC, PCH adds one automatically. If PCL borrow after PCL–ACC, PCH keeps value and
not change.
; The jump table is from the head of the ROM boundary
; PCL = PCL + ACC, PCH + 1 when PCL overflow occurs.
; ACC = 0, jump to A0POINT
; ACC = 1, jump to A1POINT
; ACC = 2, jump to A2POINT
; ACC = 3, jump to A3POINT
SONIX provides a macro for safe jump table function. This macro will check the ROM boundary and move the jump
table to the right position automatically. The side effect of this macro maybe wastes some ROM size.
Example: If “jump table” crosses over ROM boundary will cause errors.
(($+1) !& 0XFF00) !!= (($+(VAL)) !& 0XFF00)
Note: “VAL” is the number of the jump table listing number.
Example: “@JMP_A” application in SONIX macro file called “MACRO3.H”.
; The number of the jump table listing is five.
; ACC = 0, jump to A0POINT
; ACC = 1, jump to A1POINT
; ACC = 2, jump to A2POINT
; ACC = 3, jump to A3POINT
; ACC = 4, jump to A4POINT

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 18 Version 0.9
If the jump table position is across a ROM boundary (0x00FF~0x0100), the “@JMP_A” macro will adjust the jump table
routine begin from next RAM boundary (0x0100).
Example: “@JMP_A” operation.
; Before compiling program.
; The number of the jump table listing is five.
; ACC = 0, jump to A0POINT
; ACC = 1, jump to A1POINT
; ACC = 2, jump to A2POINT
; ACC = 3, jump to A3POINT
; ACC = 4, jump to A4POINT
; After compiling program.
; The number of the jump table listing is five.
; ACC = 0, jump to A0POINT
; ACC = 1, jump to A1POINT
; ACC = 2, jump to A2POINT
; ACC = 3, jump to A3POINT
; ACC = 4, jump to A4POINT

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 19 Version 0.9
2.1.5 CHECKSUM CALCULATION
The last ROM address are reserved area. User should avoid these addresses (last address) when calculate the
Checksum value.
Example: The demo program shows how to calculated Checksum from 00H to the end of user’s code.
; Save low end address to end_addr1
; Save middle end address to end_addr2
; Check if the YZ address = the end of code
; If Z != 00H calculate to next address
; Check if Z = low end address
; If Not jump to checksum calculate
; If Yes, check if Y = middle end address
; If Not jump to checksum calculate
; If Yes checksum calculated is done.
; Jump to checksum calculate

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 20 Version 0.9
2.2 DATA MEMORY (RAM)
56 X 8-bit RAM
080h~0FFh of Bank 0 store system
registers (128 bytes).
Sonix provides “Bank 0” type instructions (e.g. b0mov, b0add, b0bts1, b0bset…) to control Bank 0 RAM directly.
2.2.1 SYSTEM REGISTER
2.2.1.1 SYSTEM REGISTER TABLE
0 1 2 3 4 5 6 7 8 9 A B C D E F
L H R Z Y - PFLAG - - - - - - - -
- 9 - - - - - - - - - - - - - - -
- A - - - - - - - - - - - - - - -
- B - - - - - - - - P0M - - - -
2.2.1.2 SYSTEM REGISTER DESCRIPTION
Working, @HL addressing register.
Working, @YZ and ROM addressing register.
Working register and ROM look-up data buffer.
ROM page and special flag register.
Port n input/output mode register.
P0.0 edge direction register.
Interrupt request register.
Interrupt enable register.
Oscillator mode register.
Watchdog timer clear register.
IR counter auto-reload data buffer.
Port n pull-up resister control register.
RAM HL indirect addressing index pointer.
RAM YZ indirect addressing index pointer.
IR duty control register.
Stack 0 ~ stack 3 buffer.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 21 Version 0.9
2.2.1.3 BIT DEFINITION of SYSTEM REGISTER
Note:
1. To avoid system error, make sure to put all the “0” and “1” as it indicates in the above table.
2. All of register names had been declared in SN8ASM assembler.
3. One-bit name had been declared in SN8ASM assembler with “F” prefix code.
4. “b0bset”, “b0bclr”, ”bset”, ”bclr” instructions are only available to the “R/W” registers.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 22 Version 0.9
2.2.2 ACCUMULATOR
The ACC is an 8-bit data register responsible for transferring or manipulating data between ALU and data memory. If
the result of operating is zero (Z) or there is carry (C or DC) occurrence, then these flags will be set to PFLAG register.
ACC is not in data memory (RAM), so ACC can’t be access by “B0MOV” instruction during the instant addressing
mode.
Example: Read and write ACC value.
; Read ACC data and store in BUF data memory.
; Write a immediate data into ACC.
; Write ACC data from BUF data memory.
The system doesn’t store ACC and PFLAG value when interrupt executed. ACC and PFLAG data must be saved to
other data memories. “PUSH”, “POP” save and load ACC, PFLAG data into buffers.
Example: Protect ACC and working registers.
; Save ACC and PFLAG to buffers.
; Load ACC and PFLAG from buffers.
; Exit interrupt service vector

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 23 Version 0.9
2.2.3 PROGRAM FLAG
The PFLAG register contains the arithmetic status of ALU operation, system reset status and LVD detecting status.
NT0, NPD bits indicate system reset status including power on reset, LVD reset, reset by external pin active and
watchdog reset. C, DC, Z bits indicate the result status of ALU operation.
Bit [7:6] NT0, NPD: Reset status flag.
Reset by external Reset Pin
Bit 2 C: Carry flag
1 = Addition with carry, subtraction without borrowing, rotation with shifting out logic “1”, comparison result
≥ 0.
0 = Addition without carry, subtraction with borrowing signal, rotation with shifting out logic “0”, comparison
result < 0.
Bit 1 DC: Decimal carry flag
1 = Addition with carry from low nibble, subtraction without borrow from high nibble.
0 = Addition without carry from low nibble, subtraction with borrow from high nibble.
Bit 0 Z: Zero flag
1 = The result of an arithmetic/logic/branch operation is zero.
0 = The result of an arithmetic/logic/branch operation is not zero.
Note: Refer to instruction set table for detailed information of C, DC and Z flags.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 24 Version 0.9
2.2.4 PROGRAM COUNTER
The program counter (PC) is a 11-bit binary counter separated into the high-byte 3 and the low-byte 8 bits. This
counter is responsible for pointing a location in order to fetch an instruction for kernel circuit. Normally, the program
counter is automatically incremented with each instruction during program execution.
Besides, it can be replaced with specific address by executing CALL or JMP instruction. When JMP or CALL instruction
is executed, the destination address will be inserted to bit 0 ~ bit 10.
- - - - - 0 0 0 0 0 0 0 0 0 0
ONE ADDRESS SKIPPING
There are nine instructions (CMPRS, INCS, INCMS, DECS, DECMS, BTS0, BTS1, B0BTS0, B0BTS1) with one
address skipping function. If the result of these instructions is true, the PC will add 2 steps to skip next instruction.
If the condition of bit test instruction is true, the PC will add 2 steps to skip next instruction.
; To skip, if Carry_flag = 1
; Move BUF0 value to ACC.
; To skip, if Zero flag = 0.
If the ACC is equal to the immediate data or memory, the PC will add 2 steps to skip next instruction.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 25 Version 0.9
If the destination increased by 1, which results overflow of 0xFF to 0x00, the PC will add 2 steps to skip next
instruction.
INCS instruction:
; Jump to C0STEP if ACC is not zero.
; Jump to C0STEP if BUF0 is not zero.
If the destination decreased by 1, which results underflow of 0x01 to 0x00, the PC will add 2 steps to skip next
instruction.
DECS instruction:
; Jump to C0STEP if ACC is not zero.
; Jump to C0STEP if BUF0 is not zero.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 26 Version 0.9
MULTI-ADDRESS JUMPING
Users can jump around the multi-address by either JMP instruction or ADD M, A instruction (M = PCL) to activate
multi-address jumping function. Program Counter supports “ADD M,A”, ”ADC M,A” and “B0ADD M,A” instructions
for carry to PCH when PCL overflow automatically. For jump table or others applications, users can calculate PC value
by the three instructions and don’t care PCL overflow problem.
Note: PCH only support PC up counting result and doesn’t support PC down counting. When PCL is
carry after PCL+ACC, PCH adds one automatically. If PCL borrow after PCL–ACC, PCH keeps value and
not change.
Example: If PC = 0323H (PCH = 03H, PCL = 23H)
Example: If PC = 0323H (PCH = 03H, PCL = 23H)
; PCL = PCL + ACC, the PCH cannot be changed.
; If ACC = 0, jump to A0POINT
; ACC = 1, jump to A1POINT
; ACC = 2, jump to A2POINT
; ACC = 3, jump to A3POINT

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 27 Version 0.9
2.2.5 H, L REGISTERS
The H and L registers are the 8-bit buffers. There are two major functions of these registers.
Can be used as general working registers
Can be used as RAM data pointers with @HL register
Example: If want to read a data from RAM address 20H of bank_0, it can use indirectly addressing mode
to access data as following.
; To set RAM bank 0 for H register
; To set location 20H for L register
; To read a data into ACC
Example: Clear general-purpose data memory area of bank 0 using @HL register.
; L = 7FH, the last address of the data memory area
; L – 1, if L = 0, finish the routine
; End of clear general purpose data memory area of bank 0

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 28 Version 0.9
2.2.6 Y, Z REGISTERS
The Y and Z registers are the 8-bit buffers. There are three major functions of these registers.
Can be used as general working registers
Can be used as RAM data pointers with @YZ register
Can be used as ROM data pointer with the MOVC instruction for look-up table
Example: Uses Y, Z register as the data pointer to access data in the RAM address 025H of bank0.
; To set RAM bank 0 for Y register
; To set location 25H for Z register
; To read a data into ACC
Example: Uses the Y, Z register as data pointer to clear the RAM data.
; Z = 7FH, the last address of the data memory area
; Z – 1, if Z= 0, finish the routine
; End of clear general purpose data memory area of bank 0

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 29 Version 0.9
2.2.7 R REGISTER
R register is an 8-bit buffer. There are two major functions of the register.
Can be used as working register
For store high-byte data of look-up table
(MOVC instruction executed, the high-byte data of specified ROM address will be stored in R register and the
low-byte data will be stored in ACC).
Note: Please refer to the “LOOK-UP TABLE DESCRIPTION” about R register look-up table application.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 30 Version 0.9
2.3 ADDRESSING MODE
2.3.1 IMMEDIATE ADDRESSING MODE
The immediate addressing mode uses an immediate data to set up the location in ACC or specific RAM.
Example: Move the immediate data 12H to ACC.
; To set an immediate data 12H into ACC.
Example: Move the immediate data 12H to R register.
; To set an immediate data 12H into R register.
Note: In immediate addressing mode application, the specific RAM must be 0x80~0x87 working register.
2.3.2 DIRECTLY ADDRESSING MODE
The directly addressing mode moves the content of RAM location in or out of ACC.
Example: Move 0x12 RAM location data into ACC.
; To get a content of RAM location 0x12 of bank 0 and save in
ACC.
Example: Move ACC data into 0x12 RAM location.
; To get a content of ACC and save in RAM location 12H of
bank 0.
2.3.3 INDIRECTLY ADDRESSING MODE
The indirectly addressing mode is to access the memory by the data pointer registers (H/L, Y/Z).
Example: Indirectly addressing mode with @HL register
; To clear H register to access RAM bank 0.
; To set an immediate data 12H into L register.
; Use data pointer @HL reads a data from RAM location
Example: Indirectly addressing mode with @YZ register
; To clear Y register to access RAM bank 0.
; To set an immediate data 12H into Z register.
; Use data pointer @YZ reads a data from RAM location

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 31 Version 0.9
2.4 STACK OPERATION
2.4.1 OVERVIEW
The stack buffer has 4-level. These buffers are designed to push and pop up program counter’s (PC) data when
interrupt service routine and “CALL” instruction are executed. The STKP register is a pointer designed to point active
level in order to push or pop up data from stack buffer. The STKnH and STKnL are the stack buffers to store program
counter (PC) data.
RET /
RETI
CALL /
INTERRUPT
STKP = 3
STKP = 2
STKP = 1
STKP = 0
STACK Level
STK3H
STK2H
STK1H
STK0H
STACK Buffer
High Byte
PCH
STKP
STK3L
STK2L
STK1L
STK0L
STACK Buffer
Low Byte
PCL
STKP
STKP - 1STKP + 1

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 32 Version 0.9
2.4.2 STACK REGISTERS
The stack pointer (STKP) is a 2-bit register to store the address used to access the stack buffer, 9-bit data memory
(STKnH and STKnL) set aside for temporary storage of stack addresses.
The two stack operations are writing to the top of the stack (push) and reading from the top of stack (pop). Push
operation decrements the STKP and the pop operation increments each time. That makes the STKP always point to
the top address of stack buffer and write the last program counter value (PC) into the stack buffer.
The program counter (PC) value is stored in the stack buffer before a CALL instruction executed or during interrupt
service routine. Stack operation is a LIFO type (Last in and first out). The stack pointer (STKP) and stack buffer
(STKnH and STKnL) are located in the system register area bank 0.
Bit[2:0] STKPBn: Stack pointer (n = 0 ~ 1)
Bit 7 GIE: Global interrupt control bit.
0 = Disable.
1 = Enable. Please refer to the interrupt chapter.
Example: Stack pointer (STKP) reset, we strongly recommended to clear the stack pointers in the
beginning of the program.
STKn = STKnH , STKnL (n = 3 ~ 0)

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 33 Version 0.9
2.4.3 STACK OPERATION EXAMPLE
The two kinds of Stack-Save operations refer to the stack pointer (STKP) and write the content of program counter (PC)
to the stack buffer are CALL instruction and interrupt service. Under each condition, the STKP decreases and points to
the next available stack location. The stack buffer stores the program counter about the op-code address. The
Stack-Save operation is as the following table.
There are Stack-Restore operations correspond to each push operation to restore the program counter (PC). The RETI
instruction uses for interrupt service routine. The RET instruction is for CALL instruction. When a pop operation occurs,
the STKP is incremented and points to the next free stack location. The stack buffer restores the last program counter
(PC) to the program counter registers. The Stack-Restore operation is as the following table.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 34 Version 0.9
2.5 CODE OPTION TABLE
The code option is the system hardware configurations including oscillator type, watchdog timer operation, reset pin
option and OTP ROM security control. The code option items are as following table:
High speed internal 8MHz RC. XIN/XOUT pins are bi-direction GPIO
mode.
Low cost RC for external high clock oscillator. XIN pin is connected to RC
oscillator. XOUT pin is bi-direction GPIO mode.
Low frequency 32KHz and 455KHz, power saving crystal for external high
clock oscillator.
32KHz: XIN connects 20pF capacitor, XOUT connects 20pF
capacitor.
455KHz: XIN connects 47pF capacitor, XOUT connects 20pF
capacitor.
High speed crystal/resonator (e.g. 8MHz) for external high clock
oscillator.
Standard crystal /resonator (e.g. 4M) for external high clock oscillator.
Instruction cycle is oscillator clock.
Instruction cycle is 2 oscillator clocks.
Instruction cycle is 4 oscillator clocks.
Instruction cycle is 8 oscillator clocks.
Watchdog timer is always on enable even in power down and green
mode.
Enable watchdog timer. Watchdog timer stops in power down mode and
green mode.
Disable Watchdog function.
Enable External reset pin.
Enable P0.2 input only without pull-up resister.
Enable ROM code Security function.
Disable ROM code Security function.
2.5.1 Reset_Pin code option
The reset pin is shared with general input only pin controlled by code option.
Reset: The reset pin is external reset function. When falling edge trigger occurring, the system will be reset.
P02: Set reset pin to general input only pin (P0.2). The external reset function is disabled and the pin is input pin.
2.5.2 Security code option
Security code option is OTP ROM protection. When enable security code option, the ROM code is secured and not
dumped complete ROM contents.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 35 Version 0.9
RESET
3.1 OVERVIEW
The system would be reset in three conditions as following.
Power on reset
Watchdog reset
Brown out reset
External reset (only supports external reset pin enable situation)
When any reset condition occurs, all system registers keep initial status, program stops and program counter is cleared.
After reset status released, the system boots up and program starts to execute from ORG 0. The NT0, NPD flags
indicate system reset status. The system can depend on NT0, NPD status and go to different paths by program.
Bit [7:6] NT0, NPD: Reset status flag.
Power on reset and LVD reset.
Power voltage is lower than LVD detecting level.
External reset pin detect low level status.
Finishing any reset sequence needs some time. The system provides complete procedures to make the power on reset
successful. For different oscillator types, the reset time is different. That causes the VDD rise rate and start-up time of
different oscillator is not fixed. RC type oscillator’s start-up time is very short, but the crystal type is longer. Under client
terminal application, users have to take care the power on reset time for the master terminal requirement. The reset
timing diagram is as following.
VDD
VSS
VDD
VSS
Watchdog Normal Run
Watchdog Stop
System Normal Run
System Stop
LVD Detect Level
External Reset
Low Detect
External Reset
High Detect
Watchdog
Overflow
Watchdog
Reset Delay
Time
External
Reset Delay
Time
Power On
Delay Time
Power
External Reset
Watchdog Reset
System Status

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 36 Version 0.9
3.2 POWER ON RESET
The power on reset depend no LVD operation for most power-up situations. The power supplying to system is a rising
curve and needs some time to achieve the normal voltage. Power on reset sequence is as following.
Power-up: System detects the power voltage up and waits for power stable.
External reset (only external reset pin enable): System checks external reset pin status. If external reset pin is
not high level, the system keeps reset status and waits external reset pin released.
System initialization: All system registers is set as initial conditions and system is ready.
Oscillator warm up: Oscillator operation is successfully and supply to system clock.
Program executing: Power on sequence is finished and program executes from ORG 0.
3.3 WATCHDOG RESET
Watchdog reset is a system protection. In normal condition, system works well and clears watchdog timer by program.
Under error condition, system is in unknown situation and watchdog can’t be clear by program before watchdog timer
overflow. Watchdog timer overflow occurs and the system is reset. After watchdog reset, the system restarts and
returns normal mode. Watchdog reset sequence is as following.
Watchdog timer status: System checks watchdog timer overflow status. If watchdog timer overflow occurs, the
system is reset.
System initialization: All system registers is set as initial conditions and system is ready.
Oscillator warm up: Oscillator operation is successfully and supply to system clock.
Program executing: Power on sequence is finished and program executes from ORG 0.
Watchdog reset is a system protection. In normal condition, system works well and clears watchdog timer by program.
Under error condition, system is in unknown situation and watchdog can’t be clear by program before watchdog timer
overflow. Watchdog timer overflow occurs and the system is reset. After watchdog reset, the system restarts and
returns normal mode. Watchdog reset sequence is as following.
Watchdog timer status: System checks watchdog timer overflow status. If watchdog timer overflow occurs, the
system is reset.
System initialization: All system registers is set as initial conditions and system is ready.
Oscillator warm up: Oscillator operation is successfully and supply to system clock.
Program executing: Power on sequence is finished and program executes from ORG 0.
Watchdog timer application note is as following.
Before clearing watchdog timer, check I/O status and check RAM contents can improve system error.
Don’t clear watchdog timer in interrupt vector and interrupt service routine. That can improve main routine fail.
Clearing watchdog timer program is only at one part of the program. This way is the best structure to enhance the
watchdog timer function.
Note: Please refer to the “WATCHDOG TIMER” about watchdog timer detail information.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 37 Version 0.9
3.4 BROWN OUT RESET
The brown out reset is a power dropping condition. The power drops from normal voltage to low voltage by external
factors (e.g. EFT interference or external loading changed). The brown out reset would make the system not work well
or executing program error.
VDD
VSS
V1
V2
V3
System Work
Well Area
System Work
Error Area
Brown Out Reset Diagram
The power dropping might through the voltage range that’s the system dead-band. The dead-band means the power
range can’t offer the system minimum operation power requirement. The above diagram is a typical brown out reset
diagram. There is a serious noise under the VDD, and VDD voltage drops very deep. There is a dotted line to separate
the system working area. The above area is the system work well area. The below area is the system work error area
called dead-band. V1 doesn’t touch the below area and not effect the system operation. But the V2 and V3 is under the
below area and may induce the system error occurrence. Let system under dead-band includes some conditions.
DC application:
The power source of DC application is usually using battery. When low battery condition and MCU drive any loading,
the power drops and keeps in dead-band. Under the situation, the power won’t drop deeper and not touch the system
reset voltage. That makes the system under dead-band.
AC application:
In AC power application, the DC power is regulated from AC power source. This kind of power usually couples with AC
noise that makes the DC power dirty. Or the external loading is very heavy, e.g. driving motor. The loading operating
induces noise and overlaps with the DC power. VDD drops by the noise, and the system works under unstable power
situation.
The power on duration and power down duration are longer in AC application. The system power on sequence protects
the power on successful, but the power down situation is like DC low battery condition. When turn off the AC power,
the VDD drops slowly and through the dead-band for a while.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 38 Version 0.9
3.4.1 THE SYSTEM OPERATING VOLTAGE
To improve the brown out reset needs to know the system minimum operating voltage which is depend on the system
executing rate and power level. Different system executing rates have different system minimum operating voltage.
The electrical characteristic section shows the system voltage to executing rate relationship.
Vdd (V)
System Rate (Fcpu)
System Mini.
Operating Voltage.
System Reset
Voltage.
Dead-Band Area
Normal Operating
Area
Reset Area
Normally the system operation voltage area is higher than the system reset voltage to VDD, and the reset voltage is
decided by LVD detect level. The system minimum operating voltage rises when the system executing rate upper even
higher than system reset voltage. The dead-band definition is the system minimum operating voltage above the system
reset voltage.
3.4.2 LOW VOLTAGE DETECTOR (LVD)
VDD
VSS
System Normal Run
System Stop
LVD Detect Voltage
Power On
Delay Time
Power
System Status
Power is below LVD Detect
Voltage and System Reset.
The LVD (low voltage detector) is built-in Sonix 8-bit MCU to be brown out reset protection. When the VDD drops and
is below LVD detect voltage, the LVD would be triggered, and the system is reset. The LVD detect level is different by
each MCU. The LVD voltage level is a point of voltage and not easy to cover all dead-band range. Using LVD to
improve brown out reset is depend on application requirement and environment. If the power variation is very deep,
violent and trigger the LVD, the LVD can be the protection. If the power variation can touch the LVD detect level and
make system work error, the LVD can’t be the protection and need to other reset methods. More detail LVD information
is in the electrical characteristic section.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 39 Version 0.9
3.4.3 BROWN OUT RESET IMPROVEMENT
How to improve the brown reset condition? There are some methods to improve brown out reset as following.
LVD reset
Watchdog reset
Reduce the system executing rate
External reset circuit. (Zener diode reset circuit, Voltage bias reset circuit, External reset IC)
Note:
1. The “ Zener diode reset circuit”, “Voltage bias reset circuit” and “External reset IC” can completely
improve the brown out reset, DC low battery and AC slow power down conditions.
2. For AC power application and enhance EFT performance, the system clock is 4MHz/4 (1 mips) and use
external reset (“ Zener diode reset circuit”, “Voltage bias reset circuit”, “External reset IC”). The
structure can improve noise effective and get good EFT characteristic.
Watchdog reset:
The watchdog timer is a protection to make sure the system executes well. Normally the watchdog timer would be clear
at one point of program. Don’t clear the watchdog timer in several addresses. The system executes normally and the
watchdog won’t reset system. When the system is under dead-band and the execution error, the watchdog timer can’t
be clear by program. The watchdog is continuously counting until overflow occurrence. The overflow signal of
watchdog timer triggers the system to reset, and the system return to normal mode after reset sequence. This method
also can improve brown out reset condition and make sure the system to return normal mode.
If the system reset by watchdog and the power is still in dead-band, the system reset sequence won’t be successful
and the system stays in reset status until the power return to normal range.
Reduce the system executing rate:
If the system rate is fast and the dead-band exists, to reduce the system executing rate can improve the dead-band.
The lower system rate is with lower minimum operating voltage. Select the power voltage that’s no dead-band issue
and find out the mapping system rate. Adjust the system rate to the value and the system exits the dead-band issue.
This way needs to modify whole program timing to fit the application requirement.
External reset circuit:
The external reset methods also can improve brown out reset and is the complete solution. There are three external
reset circuits to improve brown out reset including “Zener diode reset circuit”, “Voltage bias reset circuit” and “External
reset IC”. These three reset structures use external reset signal and control to make sure the MCU be reset under
power dropping and under dead-band. The external reset information is described in the next section.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 40 Version 0.9
3.5 EXTERNAL RESET
External reset function is controlled by “Reset_Pin” code option. Set the code option as “Reset” option to enable
external reset function. External reset pin is Schmitt Trigger structure and low level active. The system is running when
reset pin is high level voltage input. The reset pin receives the low voltage and the system is reset. The external reset
operation actives in power on and normal running mode. During system power-up, the external reset pin must be high
level input, or the system keeps in reset status. External reset sequence is as following.
External reset (only external reset pin enable): System checks external reset pin status. If external reset pin is
not high level, the system keeps reset status and waits external reset pin released.
System initialization: All system registers is set as initial conditions and system is ready.
Oscillator warm up: Oscillator operation is successfully and supply to system clock.
Program executing: Power on sequence is finished and program executes from ORG 0.
The external reset can reset the system during power on duration, and good external reset circuit can protect the
system to avoid working at unusual power condition, e.g. brown out reset in AC power application…
3.6 EXTERNAL RESET CIRCUIT
3.6.1 Simply RC Reset Circuit
MCU
VDD
VSS
VCC
GND
R
S
T
R1
47K ohm
C1
0.1uF
R2
100 ohm
This is the basic reset circuit, and only includes R1 and C1. The RC circuit operation makes a slow rising signal into
reset pin as power up. The reset signal is slower than VDD power up timing, and system occurs a power on signal from
the timing difference.
Note: The reset circuit is no any protection against unusual power or brown out reset.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 41 Version 0.9
3.6.2 Diode & RC Reset Circuit
MCU
VDD
VSS
VCC
GND
R
S
T
R1
47K ohm
C1
0.1uF
DIODE
R2
100 ohm
This is the better reset circuit. The R1 and C1 circuit operation is like the simply reset circuit to make a power on signal.
The reset circuit has a simply protection against unusual power. The diode offers a power positive path to conduct
higher power to VDD. It is can make reset pin voltage level to synchronize with VDD voltage. The structure can
improve slight brown out reset condition.
Note: The R2 100 ohm resistor of “Simply reset circuit” and “Diode & RC reset circuit” is necessary to
limit any current flowing into reset pin from external capacitor C in the event of reset pin breakdown due
to Electrostatic Discharge (ESD) or Electrical Over-stress (EOS).
3.6.3 Zener Diode Reset Circuit
MCU
VDD
VSS
VCC
GND
R
S
T
R1
33K ohm
R3
40K ohm
R2
10K ohm
Vz
Q1
E
C
B
The zener diode reset circuit is a simple low voltage detector and can improve brown out reset condition
completely. Use zener voltage to be the active level. When VDD voltage level is above “Vz + 0.7V”, the C terminal of
the PNP transistor outputs high voltage and MCU operates normally. When VDD is below “Vz + 0.7V”, the C terminal of
the PNP transistor outputs low voltage and MCU is in reset mode. Decide the reset detect voltage by zener
specification. Select the right zener voltage to conform the application.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 42 Version 0.9
3.6.4 Voltage Bias Reset Circuit
MCU
VDD
VSS
VCC
GND
R
S
T
R1
47K ohm
R3
2K ohm
R2
10K ohm
Q1
E
C
B
The voltage bias reset circuit is a low cost voltage detector and can improve brown out reset condition completely.
The operating voltage is not accurate as zener diode reset circuit. Use R1, R2 bias voltage to be the active level. When
VDD voltage level is above or equal to “0.7V x (R1 + R2) / R1”, the C terminal of the PNP transistor outputs high
voltage and MCU operates normally. When VDD is below “0.7V x (R1 + R2) / R1”, the C terminal of the PNP transistor
outputs low voltage and MCU is in reset mode.
Decide the reset detect voltage by R1, R2 resistances. Select the right R1, R2 value to conform the application. In the
circuit diagram condition, the MCU’s reset pin level varies with VDD voltage variation, and the differential voltage is
0.7V. If the VDD drops and the voltage lower than reset pin detect level, the system would be reset. If want to make the
reset active earlier, set the R2 > R1 and the cap between VDD and C terminal voltage is larger than 0.7V. The external
reset circuit is with a stable current through R1 and R2. For power consumption issue application, e.g. DC power
system, the current must be considered to whole system power consumption.
Note: Under unstable power condition as brown out reset, “Zener diode rest circuit” and “Voltage bias
reset circuit” can protects system no any error occurrence as power dropping. When power drops below
the reset detect voltage, the system reset would be triggered, and then system executes reset sequence.
That makes sure the system work well under unstable power situation.
MCU
VDD
VSS
VCC
GND
R
S
T
Reset
IC
VDD
VSS
RST
Bypass
Capacitor
0.1uF
The external reset circuit also use external reset IC to enhance MCU reset performance. This is a high cost and good
effect solution. By different application and system requirement to select suitable reset IC. The reset circuit can
improve all power variation.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 43 Version 0.9
SYSTEM CLOCK
4.1 OVERVIEW
The micro-controller is a dual clock system including high-speed and low-speed clocks. The high-speed clock includes
internal high-speed oscillator and external oscillators selected by “High_CLK” code option. The low-speed clock is from
internal low-speed oscillator controlled by “CLKMD” bit of OSCM register. Both high-speed clock and low-speed clock
can be system clock source through a divider to decide the system clock rate.
High-speed oscillator
Internal high-speed oscillator is 8MHz RC type called “IHRC”.
External high-speed oscillator includes crystal/ceramic (4MHz, 8MHz, 455KHz) and RC type.
Low-speed oscillator
Internal low-speed oscillator is 10KHz @3V RC type called “ILRC”.
System clock block diagram
Fhosc. Fcpu = Fhosc/1 ~ Fhosc/8
Flosc. Fcpu = Flosc/4
CPUM[1:0]
XIN
XOUT
STPHX HOSC
Fcpu Code Option
Fosc
Fosc
CLKMD
Fcpu
HOSC: High_Clk code option.
Fhosc: External high-speed clock / Internal high-speed RC clock.
Flosc: Internal low-speed RC clock (about 10KHz@3V).
Fosc: System clock source.
Fcpu: Instruction cycle.
4.2 FCPU (INSTRUCTION CYCLE)
The system clock rate is instruction cycle called “Fcpu” which is divided from the system clock source and decides the
system operating rate. Fcpu rate is selected by Fcpu code option and the range is Fhosc/1~Fhosc/8 under system
normal mode. If the system high clock source is external 4MHz crystal, and the Fcpu code option is Fhosc/4, the Fcpu
frequency is 4MHz/4 = 1MHz. Under system slow mode, the Fcpu is fixed Flosc/4, 10KHz/4=2.5KHz @3V.
In high noisy environment, below “Fhosc/4” of Fcpu code option is the strongly recommendation to reduce
high frequency noise effect.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 44 Version 0.9
4.3 SYSTEM HIGH-SPEED CLOCK
The system high-speed clock has internal and external two-type. The external high-speed clock includes 4MHz, 8MHz,
455KHz crystal/ceramic and RC type. These high-speed oscillators are selected by “High_CLK” code option.
4.3.1 HIGH_CLK CODE OPTION
For difference clock functions, Sonix provides multi-type system high clock options controlled by “High_CLK” code
option. The High_CLK code option defines the system oscillator types including IHRC_8M, RC, 455K X’tal, 8M X’tal
and 4M X’tal. These oscillator options support different bandwidth oscillator.
IHRC_8M: The system high-speed clock source is internal high-speed 8MHz RC type oscillator. In the mode, XIN
and XOUT pins are bi-direction GPIO mode, and not to connect any external oscillator device.
RC: The system high-speed clock source is external low cost RC type oscillator. The RC oscillator circuit only
connects to XIN pin, and the XOUT pin is bi-direction GPIO mode.
455K X’tal: The system high-speed clock source is external low-speed crystal. The option support 32KHz and
455KHz crystals.
8M X’tal: The system high-speed clock source is external high-speed crystal/ceramic. The oscillator bandwidth is
4MHz~8MHz.
4M X’tal: The system high-speed clock source is external high-speed crystal/resonator. The oscillator bandwidth
is 1MHz~4MHz.
4.3.2 INTERNAL HIGH-SPEED OSCILLATOR RC TYPE (IHRC)
The internal high-speed oscillator is 8MHz RC type. The accuracy is ±2% under commercial condition. When the
“High_CLK” code option is “IHRC_8M”, the internal high-speed oscillator is enabled.
IHRC_8M: The system high-speed clock is internal 8MHz oscillator RC type. XIN/XOUT pins are general purpose
I/O pins.
4.3.3 EXTERNAL HIGH-SPEED OSCILLATOR
The external high-speed oscillator includes 4MHz, 8MHz, 455KHz and RC type. The 4MHz, 8MHz and 455KHz
oscillators support crystal and ceramic types connected to XIN/XOUT pins with 20pF capacitors to ground. The RC
type is a low cost RC circuit only connected to XIN pin. The capacitance is not below 100pF, and use the resistance to
decide the frequency.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 45 Version 0.9
4.3.4 EXTERNAL OSCILLATOR APPLICATION CIRCUIT
MCU
VCC
GND
C
20pF
XIN
X
O
U
T
VDD
VSS
C
20pF
CRYSTAL
R
MCU
VCC
GND
XIN
X
O
U
T
V
D
D
VSS
C
MCU
VCC
GND
C
47pF
XIN
XOUT
VDD
VSS
C
20pF
455KHz
X’tal
455K code option crystal’s capacitors are 47pF to
XIN pin and 20pF to XOUT pin.
MCU
VCC
GND
C
20pF
XIN
XOUT
VDD
VSS
C
20pF
32KHz
X’tal
455K code option crystal’s capacitors are 20pF to
XIN pin and 20pF to XOUT pin.
Note: Connect the Crystal/Ceramic and C as near as possible to the XIN/XOUT/VSS pins of
micro-controller. Connect the R and C as near as possible to the VDD pin of micro-controller.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 46 Version 0.9
4.4 SYSTEM LOW-SPEED CLOCK
The system low clock source is the internal low-speed oscillator built in the micro-controller. The low-speed oscillator
uses RC type oscillator circuit. The frequency is affected by the voltage and temperature of the system. In common
condition, the frequency of the RC oscillator is about 10KHz at 3V. The relation between the RC frequency and voltage
is as the following figure.
The internal low RC supports watchdog clock source and system slow mode controlled by “CLKMD” bit of OSCM
register.
Flosc = Internal low RC oscillator (about 10KHz @3V).
Slow mode Fcpu = Flosc / 4
There are two conditions to stop internal low RC. One is power down mode, and the other is green mode of 455K
mode and watchdog disable. If system is in 455K mode and watchdog disable, only 455K oscillator actives and system
is under low power consumption.
Example: Stop internal low-speed oscillator by power down mode.
; To stop external high-speed oscillator and internal low-speed
; oscillator called power down mode (sleep mode).
Note: The internal low-speed clock can’t be turned off individually. It is controlled by CPUM0, CPUM1
(455K, watchdog disable) bits of OSCM register.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 47 Version 0.9
4.5 OSCM REGISTER
The OSCM register is an oscillator control register. It controls oscillator status, system mode.
Bit 1 STPHX: External high-speed oscillator control bit.
0 = External high-speed oscillator free run.
1 = External high-speed oscillator free run stop. Internal low-speed RC oscillator is still running.
Bit 2 CLKMD: System high/Low clock mode control bit.
0 = Normal (dual) mode. System clock is high clock.
1 = Slow mode. System clock is internal low clock.
Bit[4:3] CPUM[1:0]: CPU operating mode control bits.
00 = normal.
01 = sleep (power down) mode.
10 = green mode.
11 = reserved.
“STPHX” bit controls internal high speed RC type oscillator and external oscillator operations. When “STPHX=0”, the
external oscillator or internal high speed RC type oscillator active. When “STPHX=1”, the external oscillator or internal
high speed RC type oscillator are disabled. The STPHX function is depend on different high clock options to do
different controls.
IHRC_8M: “STPHX=1” disables internal high speed RC type oscillator.
RC, 4M, 8M, 455K: “STPHX=1” disables external oscillator.
4.6 SYSTEM CLOCK MEASUREMENT
Under design period, the users can measure system clock speed by software instruction cycle (Fcpu). This way is
useful in RC mode.
Example: Fcpu instruction cycle of external oscillator.
; Set P0.0 to be output mode for outputting Fcpu toggle signal.
; Output Fcpu toggle signal in low-speed clock mode.
; Measure the Fcpu frequency by oscilloscope.
Note: Do not measure the RC frequency directly from XIN; the probe impendence will affect the RC
frequency.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 48 Version 0.9
4.7 SYSTEM CLOCK TIMING
Hardware configuration time
64ms @ F
ILRC
= 32KHz
128ms @ F
ILRC
= 16KHz
The start-up time is depended on oscillator’s material,
factory and architecture. Normally, the low-speed
oscillator’s start-up time is lower than high-speed
oscillator. The RC type oscillator’s start-up time is faster
than crystal type oscillator.
Oscillator warm-up time of reset condition.
2048*F
hosc
(Power on reset, LVD reset, watchdog reset, external
reset pin active.)
64ms @ F
hosc
= 32KHz
512us @ F
hosc
= 4MHz
256us @ F
hosc
= 8MHz
Oscillator warm-up time of power down mode wake-up
condition.
2048*F
hosc
……Crystal/resonator type oscillator, e.g.
32768Hz crystal, 4MHz crystal, 16MHz crystal…
32*F
hosc
……RC type oscillator, e.g. external RC type
oscillator, internal high-speed RC type oscillator.
64ms @ F
hosc
= 32KHz
512us @ F
hosc
= 4MHz
256us @ F
hosc
= 8MHz
Vdd
Power On Reset
Flag
Oscillator
Fcpu
(Instruction Cycle)
Tcfg Tost
Tosp
Vp
External Reset Pin Reset Timing
External Reset Pin
Oscillator
Fcpu
(Instruction Cycle)
Tcfg Tost
Tosp
Reset pin falling edge trigger system reset.
Reset pin returns to high status.
System is under reset
status.
External Reset
Flag
Watchdog Reset
Flag
Oscillator
Fcpu
(Instruction Cycle)
Tcfg Tost
Tosp
Watchdog timer overflow.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 49 Version 0.9
Power Down Mode Wake-up Timing
Wake-up Pin
Rising Edge
Oscillator
Fcpu
(Instruction Cycle)
Tosp
Tost
Wake-up Pin
Falling Edge
System inserts into power down mode.
Edge trigger system wake-up.
Green Mode Wake-up Timing
Wake-up Pin
Rising Edge
Oscillator
Fcpu
(Instruction Cycle)
Wake-up Pin
Falling Edge
System inserts into green mode.
Edge trigger system wake-up.
0x000xFF0xFE 0x01 0x02 ...0xFD... ... ... ... ...Timer
Timer overflow.
Oscillator Start-up Time
The start-up time is depended on oscillator’s material, factory and architecture. Normally, the low-speed oscillator’s
start-up time is lower than high-speed oscillator. The RC type oscillator’s start-up time is faster than crystal type
oscillator.
Low Speed Crystal
(32K, 455K)
Tost
Crystal
Tost
External RC
Tost
Ceramic/Resonator
Tost

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 50 Version 0.9
SYSTEM OPERATION MODE
5.1 OVERVIEW
The chip builds in four operating mode for difference clock rate and power saving reason. These modes control
oscillators, op-code operation and analog peripheral devices’ operation.
Normal mode: System high-speed operating mode.
Slow mode: System low-speed operating mode.
Power down mode: System power saving mode (Sleep mode).
Green mode: System ideal mode.
Operating Mode Control Block
Power Down Mode
Slow Mode
CLKMD = 1
CLKMD = 0
CPUM1, CPUM0 = 01.
Wake-up condition:
P0, P1 input status is level changing.
T0 timer counter is overflow.
CPUM1, CPUM0 = 10.
Normal Mode
Green Mode
Wake-up condition:
P0, P1 input status is level changing.
T0 timer counter is overflow.
Wake-up condition:
P0, P1 input status is level changing.
Reset Control Block
One of reset trigger sources actives.
One of reset trigger sources actives.
One of reset trigger sources actives.
Operating Mode Clock Control Table
EHOSC: External high-speed oscillator (XIN/XOUT).
IHRC: Internal high-speed oscillator RC type.
ILRC: Internal low-speed oscillator RC type.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 51 Version 0.9
5.2 NORMAL MODE
The Normal Mode is system high clock operating mode. The system clock source is from high speed oscillator. The
program is executed. After power on and any reset trigger released, the system inserts into normal mode to execute
program. When the system is wake-up from power down mode, the system also inserts into normal mode. In normal
mode, the high speed oscillator actives, and the power consumption is largest of all operating modes.
The program is executed, and full functions are controllable.
The system rate is high speed.
The high speed oscillator and internal low speed RC type oscillator active.
Normal mode can be switched to other operating modes through OSCM register.
Power down mode is wake-up to normal mode.
Slow mode is switched to normal mode.
Green mode from normal mode is wake-up to normal mode.
5.3 SLOW MODE
The slow mode is system low clock operating mode. The system clock source is from internal low speed RC type
oscillator. The slow mode is controlled by CLKMD bit of OSCM register. When CLKMD=0, the system is in normal
mode. When CLKMD=1, the system inserts into slow mode. The high speed oscillator won’t be disabled automatically
after switching to slow mode, and must be disabled by SPTHX bit to reduce power consumption. In slow mode, the
system rate is fixed Flosc/4 (Flosc is internal low speed RC type oscillator frequency).
The program is executed, and full functions are controllable.
The system rate is low speed (Flosc/4).
The internal low speed RC type oscillator actives, and the high speed oscillator is controlled by STPHX=1. In slow
mode, to stop high speed oscillator is strongly recommendation.
Slow mode can be switched to other operating modes through OSCM register.
Power down mode from slow mode is wake-up to normal mode.
Normal mode is switched to slow mode.
Green mode from slow mode is wake-up to slow mode.
5.4 POWER DOWN MDOE
The power down mode is the system ideal status. No program execution and oscillator operation. Whole chip is under
low power consumption status under 1uA. The power down mode is waked up by P0, P1 hardware level change trigger.
P1 wake-up function is controlled by P1W register. Any operating modes into power down mode, the system is waked
up to normal mode. Inserting power down mode is controlled by CPUM0 bit of OSCM register. When CPUM0=1, the
system inserts into power down mode. After system wake-up from power down mode, the CPUM0 bit is disabled (zero
status) automatically.
The program stops executing, and full functions are disabled.
All oscillators including external high speed oscillator, internal high speed oscillator and internal low speed
oscillator stop.
The power consumption is under 1uA.
The system inserts into normal mode after wake-up from power down mode.
The power down mode wake-up source is P0 and P1 level change trigger.
Note: If the system is in normal mode, to set STPHX=1 to disable the high clock oscillator. The system is
under no system clock condition. This condition makes the system stay as power down mode, and can
be wake-up by P0, P1 level change trigger.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 52 Version 0.9
5.5 GREEN MODE
The green mode is another system ideal status not like power down mode. In power down mode, all functions and
hardware devices are disabled. But in green mode, the system clock source keeps running, so the power consumption
of green mode is larger than power down mode. In green mode, the program isn’t executed, but the timer with wake-up
function actives as enabled, and the timer clock source is the non-stop system clock. The green mode has 2 wake-up
sources. One is the P0, P1 level change trigger wake-up. The other one is internal timer with wake-up function
occurring overflow. That’s mean users can setup one fix period to timer, and the system is waked up until the time out.
Inserting green mode is controlled by CPUM1 bit of OSCM register. When CPUM1=1, the system inserts into green
mode. After system wake-up from green mode, the CPUM1 bit is disabled (zero status) automatically.
The program stops executing, and full functions are disabled.
Only the timer with wake-up function actives.
The oscillator to be the system clock source keeps running, and the other oscillators operation is depend on
system operation mode configuration.
If inserting green mode from normal mode, the system insets to normal mode after wake-up.
If inserting green mode from slow mode, the system insets to slow mode after wake-up.
The green mode wake-up sources are P0, P1 level change trigger and unique time overflow.
PWN and buzzer output functions active in green mode, but the timer can’t wake-up the system as overflow.
Note: Sonix provides “GreenMode” macro to control green mode operation. It is necessary to use
“GreenMode” macro to control system inserting green mode.
The macro includes three instructions. Please take care the macro length as using BRANCH type
instructions, e.g. bts0, bts1, b0bts0, b0bts1, ins, incms, decs, decms, cmprs, jmp, or the routine would
be error.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 53 Version 0.9
5.6 OPERATING MODE CONTROL MACRO
Sonix provides operating mode control macros to switch system operating mode easily.
The system insets into Sleep Mode (Power Down Mode).
The system inserts into Green Mode.
The system inserts into Slow Mode and stops high speed oscillator.
The system returns to Normal Mode from Slow Mode. The macro
includes operating mode switch, enable high speed oscillator, high
speed oscillator warm-up delay time.
Example: Switch normal/slow mode to power down (sleep) mode.
; Declare “SleepMode” macro directly.
Example: Switch normal mode to slow mode.
; Declare “SlowMode” macro directly.
Example: Switch slow mode to normal mode (The external high-speed oscillator stops).
; Declare “Slow2Normal” macro directly.
Example: Switch normal/slow mode to green mode.
; Declare “GreenMode” macro directly.
Example: Switch normal/slow mode to green mode and enable T0 wake-up function.
; Set T0 timer wakeup function.
; To disable T0 interrupt service
; To set T0 clock = Fcpu / 64
; To set T0C initial value = 74H (To set T0 interval = 10 ms)
; To disable T0 interrupt service
; To clear T0 interrupt request
; Declare “GreenMode” macro directly.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 54 Version 0.9
5.7 WAKEUP
5.7.1 OVERVIEW
Under power down mode (sleep mode) or green mode, program doesn’t execute. The wakeup trigger can wake the
system up to normal mode or slow mode. The wakeup trigger sources are external trigger (P0 level change) and
internal trigger (T0 timer overflow).
Power down mode is waked up to normal mode. The wakeup trigger is only external trigger (P0 level change)
Green mode is waked up to last mode (normal mode or slow mode). The wakeup triggers are external trigger (P0
level change) and internal trigger (T0 timer overflow).
5.7.2 WAKEUP TIME
When the system is in power down mode (sleep mode), the high clock oscillator stops. When waked up from power
down mode, MCU waits for 2048 external high-speed oscillator clocks as the wakeup time to stable the oscillator circuit.
After the wakeup time, the system goes into the normal mode.
Note: Wakeup from green mode is no wakeup time because the clock doesn’t stop in green mode.
The value of the wakeup time is as the following.
The Wakeup time = 1/Fosc * 2048 (sec) + high clock start-up time
Note: The high clock start-up time is depended on the VDD and oscillator type of high clock.
Example: In power down mode (sleep mode), the system is waked up. After the wakeup time, the system goes
into normal mode. The wakeup time is as the following.
The wakeup time = 1/Fosc * 2048 = 0.512 ms (Fosc = 4MHz)
The total wakeup time = 0.512 ms + oscillator start-up time

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 55 Version 0.9
5.7.3 P1W WAKEUP CONTROL REGISTER
Under power down mode (sleep mode) and green mode, the I/O ports with wakeup function are able to wake the
system up to normal mode. The wake-up trigger edge is level changing. When wake-up pin occurs rising edge or falling
edge, the system is waked up by the trigger edge. The Port 0 and Port 1 have wakeup function. Port 0 wakeup function
always enables, but the Port 1 is controlled by the P1W register.
Bit[7:0] P10W~P17W: Port 1 wakeup function control bits.
0 = Disable P1n wakeup function.
1 = Enable P1n wakeup function.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 56 Version 0.9
INTERRUPT
6.1 OVERVIEW
This MCU provides three interrupt sources, including one internal interrupt (T0) and one external interrupt (INT0). The
external interrupt can wake-up the chip while the system is switched from power down mode to high-speed normal
mode. Once interrupt service is executed, the GIE bit in STKP register will clear to “0” for stopping other interrupt
request. On the contrast, when interrupt service exits, the GIE bit will set to “1” to accept the next interrupts’ request. All
of the interrupt request signals are stored in INTRQ register.
INTEN Interrupt Enable Register
Interrupt
Enable
Gating
INTRQ
3-Bit
Latchs
P00IRQ
T0IRQ
Interrupt Vector Address (0008H)
Global Interrupt Request Signal
INT0 Trigger
T0 Time Out
Note: The GIE bit must enable during all interrupt operation.
6.2 INTEN INTERRUPT ENABLE REGISTER
INTEN is the interrupt request control register including one internal interrupts, one external interrupts enable control
bits. One of the register to be set “1” is to enable the interrupt request function. Once of the interrupt occur, the stack i s
incremented and program jump to ORG 8 to execute interrupt service routines. The program exits the interrupt service
routine when the returning interrupt service routine instruction (RETI) is executed.
Bit 0 P00IEN: External P0.0 interrupt (INT0) control bit.
0 = Disable INT0 interrupt function.
1 = Enable INT0 interrupt function.
Bit 4 T0IEN: T0 timer interrupt control bit.
0 = Disable T0 interrupt function.
1 = Enable T0 interrupt function.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 57 Version 0.9
6.3 INTRQ INTERRUPT REQUEST REGISTER
INTRQ is the interrupt request flag register. The register includes all interrupt request indication flags. Each one of the
interrupt requests occurs, the bit of the INTRQ register would be set “1”. The INTRQ value needs to be clear by
programming after detecting the flag. In the interrupt vector of program, users know the any interrupt requests
occurring by the register and do the routine corresponding of the interrupt request.
Bit 0 P00IRQ: External P0.0 interrupt (INT0) request flag.
0 = None INT0 interrupt request.
1 = INT0 interrupt request.
Bit 4 T0IRQ: T0 timer interrupt request flag.
0 = None T0 interrupt request.
1 = T0 interrupt request.
6.4 GIE GLOBAL INTERRUPT OPERATION
GIE is the global interrupt control bit. All interrupts start work after the GIE = 1 It is necessary for interrupt service
request. One of the interrupt requests occurs, and the program counter (PC) points to the interrupt vector (ORG 8) and
the stack add 1 level.
Bit 7 GIE: Global interrupt control bit.
0 = Disable global interrupt.
1 = Enable global interrupt.
Example: Set global interrupt control bit (GIE).
Note: The GIE bit must enable during all interrupt operation.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 58 Version 0.9
6.5 PUSH, POP ROUTINE
When any interrupt occurs, system will jump to ORG 8 and execute interrupt service routine. It is necessary to save
ACC, PFLAG data. The chip includes “PUSH”, “POP” for in/out interrupt service routine. The two instructions save and
load ACC, PFLAG data into buffers and avoid main routine error after interrupt service routine finishing.
Note: ”PUSH”, “POP” instructions save and load ACC/PFLAG without (NT0, NPD). PUSH/POP buffer is
an unique buffer and only one level.
Example: Store ACC and PAFLG data by PUSH, POP instructions when interrupt service routine
executed.
; Save ACC and PFLAG to buffers.
; Load ACC and PFLAG from buffers.
; Exit interrupt service vector

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 59 Version 0.9
6.6 EXTERNAL INTERRUPT OPERATION (INT0)
INT0 is external interrupt trigger source and builds in edge trigger configuration function. When the external edge
trigger occurs, the external interrupt request flag will be set to “1” no matter the external interrupt control bit enabled or
disable. When external interrupt control bit is enabled and external interrupt edge trigger is occurring, the program
counter will jump to the interrupt vector (ORG 8) and execute interrupt service routine.
The external interrupt builds in wake-up latch function. That means when the system is triggered wake-up from power
down mode, the wake-up source is external interrupt source (P0.0), and the trigger edge direction matches interrupt
edge configuration, the trigger edge will be latched, and the system executes interrupt service routine fist after
wake-up.
Bit[4:3] P00G[1:0]: INT0 edge trigger select bits.
00 = reserved,
01 = rising edge,
10 = falling edge,
11 = rising/falling bi-direction.
Example: Setup INT0 interrupt request and bi-direction edge trigger.
; Set INT0 interrupt trigger as bi-direction edge.
; Enable INT0 interrupt service
; Clear INT0 interrupt request flag
Example: INT0 interrupt service routine.
… ; Push routine to save ACC and PFLAG to buffers.
; P00IRQ = 0, exit interrupt vector
… ; INT0 interrupt service routine
… ; Pop routine to load ACC and PFLAG from buffers.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 60 Version 0.9
6.7 T0 INTERRUPT OPERATION
When the T0C counter occurs overflow, the T0IRQ will be set to “1” however the T0IEN is enable or disable. If the
T0IEN = 1, the trigger event will make the T0IRQ to be “1” and the system enter interrupt vector. If the T0IEN = 0, the
trigger event will make the T0IRQ to be “1” but the system will not enter interrupt vector. Users need to care for the
operation under multi-interrupt situation.
Example: T0 interrupt request setup.
; Disable T0 interrupt service
; Set T0 clock = Fcpu / 64
; Set T0C initial value = 74H
; Set T0 interval = 10 ms
; Enable T0 interrupt service
; Clear T0 interrupt request flag
Example: T0 interrupt service routine.
; Push routine to save ACC and PFLAG to buffers.
; T0IRQ = 0, exit interrupt vector
… ; T0 interrupt service routine
; Pop routine to load ACC and PFLAG from buffers.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 61 Version 0.9
6.8 MULTI-INTERRUPT OPERATION
Under certain condition, the software designer uses more than one interrupt requests. Processing multi-interrupt
request requires setting the priority of the interrupt requests. The IRQ flags of interrupts are controlled by the interrupt
event. Nevertheless, the IRQ flag “1” doesn’t mean the system will execute the interrupt vector. In addition, which
means the IRQ flags can be set “1” by the events without enable the interrupt. Once the event occurs, the IRQ will be
logic “1”. The IRQ and its trigger event relationship is as the below table.
Trigger Event Description
P0.0 trigger controlled by PEDGE
For multi-interrupt conditions, two things need to be taking care of. One is to set the priority for these interrupt requests.
Two is using IEN and IRQ flags to decide which interrupt to be executed. Users have to check interrupt control bit and
interrupt request flag in interrupt routine.
Example: Check the interrupt request under multi-interrupt operation
… ; Push routine to save ACC and PFLAG to buffers.
; Check INT0 interrupt request
; Jump check to next interrupt
; Check T0 interrupt request
; End of interrupt request checking
; Jump to T0 interrupt service routine
; Pop routine to load ACC and PFLAG from buffers.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 62 Version 0.9
I/O PORT
7.1 OVERVIEW
The micro-controller builds in 16 pin I/O. Some of the I/O pins are mixed with analog pins and special function pins.
The I/O shared pin list is as following.
Shared Pin Control Condition
Reset_Pin code option = Reset
High_CLK code option = 455K, 4M, 8M
High_CLK code option = RC, 455K, 4M, 8M
* DC: Digital Characteristic. AC: Analog Characteristic. HV: High Voltage Characteristic.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 63 Version 0.9
7.2 I/O PORT MODE
The port direction is programmed by PnM register. When the bit of PnM register is “0”, the pin is input mode. When the
bit of PnM register is “1”, the pin is output mode.
Bit[7:0] PnM[7:0]: Pn mode control bits. (n = 0~5).
0 = Pn is input mode.
1 = Pn is output mode.
Note:
1. Users can program them by bit control instructions (B0BSET, B0BCLR).
2. P0.2 input only pin, and the P0M.2 is undefined.
Example: I/O mode selecting
; Set all ports to be input mode.
; Set all ports to be output mode.
; Set P1.0 to be input mode.
; Set P1.0 to be output mode.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 64 Version 0.9
7.3 I/O PULL UP REGISTER
The I/O pins build in internal pull-up resistors and only support I/O input mode. The port internal pull-up resistor is
programmed by PnUR register. When the bit of PnUR register is “0”, the I/O pin’s pull-up is disabled. When the bit of
PnUR register is “1”, the I/O pin’s pull-up is enabled.
Note: P0.2 is input only pin and without pull-up resister. The P0UR.2 is undefined.
Example: I/O Pull up Register
; Enable Port 0, 1, 5 Pull-up register,

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 65 Version 0.9
7.4 I/O PORT DATA REGISTER
Note: The P02 keeps “1” when external reset enable by code option.
Example: Read data from input port.
Example: Write data to output port.
; Write data FFH to all Port.
Example: Write one bit data to output port.
; Set P1.0 and P5.3 to be “1”.
; Set P1.0 and P5.3 to be “0”.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 66 Version 0.9
TIMERS
8.1 WATCHDOG TIMER
The watchdog timer (WDT) is a binary up counter designed for monitoring program execution. If the program goes into
the unknown status by noise interference, WDT overflow signal raises and resets MCU. Watchdog clock controlled by
code option and the clock source is internal low-speed oscillator (10KHz @3V).
Watchdog overflow time = 8192 / Internal Low-Speed oscillator (sec).
The watchdog timer has three operating options controlled “WatchDog” code option.
Disable: Disable watchdog timer function.
Enable: Enable watchdog timer function. Watchdog timer actives in normal mode and slow mode. In power down
mode and green mode, the watchdog timer stops.
Always_On: Enable watchdog timer function. The watchdog timer actives and not stop in power down mode and
green mode.
In high noisy environment, the “Always_On” option of watchdog operations is the strongly recommendation
to make the system reset under error situations and re-start again.
Watchdog clear is controlled by WDTR register. Moving 0x5A data into WDTR is to reset watchdog timer.
Example: An operation of watchdog timer is as following. To clear the watchdog timer counter in the top
of the main routine of the program.
; Clear the watchdog timer.
Example: Clear watchdog timer by “@RST_WDT” macro of Sonix IDE.
; Clear the watchdog timer.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 67 Version 0.9
Watchdog timer application note is as following.
Before clearing watchdog timer, check I/O status and check RAM contents can improve system error.
Don’t clear watchdog timer in interrupt vector and interrupt service routine. That can improve main routine fail.
Clearing watchdog timer program is only at one part of the program. This way is the best structure to enhance the
watchdog timer function.
Example: An operation of watchdog timer is as following. To clear the watchdog timer counter in the top of the
main routine of the program.
; I/O or RAM error. Program jump here and don’t
; clear watchdog. Wait watchdog timer overflow to reset IC.
; I/O and RAM are correct. Clear watchdog timer and
; Clear the watchdog timer.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 68 Version 0.9
8.2 TIMER 0 (T0)
8.2.1 OVERVIEW
The T0 timer is an 8-bit binary up basic timer. If T0 timer occurs an overflow (from 0xFF to 0x00), it will continue
counting and issue a time-out signal to indicate T0 time out event. The T0 builds in green mode wake-up function.
When T0 timer overflow occurs under green mode, the system will be waked-up to last operating mode. The main
purposes of the T0 timer are as following.
8-bit programmable up counting timer: Generate time-out at specific time intervals based on the selected clock
frequency.
Interrupt function: T0 timer function supports interrupt function. When T0 timer occurs overflow, the T0IRQ
actives and the system points program counter to interrupt vector to do interrupt sequence.
Green mode function: T0 keeps running in green mode and can wake-up from green mode as T0ENB = 1.
System will be wake-up when T0IRQ actives after T0 timer overflow occurrence.
Fcpu
T0 Rate
(Fcpu/2~Fcpu/256)
T0ENB
CPUM0,1
T0C 8-Bit Binary Up Counting Counter
T0 Time Out
Load
Internal Data Bus
8.2.2 T0 Timer Operation
T0 timer is a basic 8-bit timer. T0 timer clock source is Fcpu. T0 unit time of Fcou clock source is decided by T0rate
register including Fcpu/2, Fcpu/4, Fcpu/8, Fcpu/16, Fcpu/32, Fcpu/64, Fcpu/128 and Fcpu/256. When T0ENB=1, T0
timer starts to count. If the T0 counter is from 0xFF to 0x00, the T0 timer overflow occurs and T0IRQ sets as “1”. If T0
interrupt function is enabled (T0IEN=1), the program counter is pointed to interrupt vector (ORG 8) to execute interrupt
service routine after T0 timer overflow occurrence. T0 timer builds in green mode wake-up function. T0 timer keeps
counting in green mode. When T0 timer overflow occurs, the system will be waked-up from green mode to last
operating mode. T0 counter doesn’t build in auto-reload function. Set the T0 interval time through setting T0C by
program and have to set again when T0 timer overflows, or T0 timer counts from 0x00 to 0xFF 256 counts. Not keep
the correct interval time.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 69 Version 0.9
8.2.3 T0M MODE REGISTER
Bit [6:4] T0RATE[2:0]: T0 internal clock select bits.
000 = fcpu/256.
001 = fcpu/128.
…
110 = fcpu/4.
111 = fcpu/2.
Bit 7 T0ENB: T0 counter control bit.
0 = Disable T0 timer.
1 = Enable T0 timer.
8.2.4 T0C COUNTING REGISTER
T0C is an 8-bit counter register for T0 interval time control.
The equation of T0C initial value is as following.
T0C initial value = 256 - (T0 interrupt interval time * input clock)
Example: To set 10ms interval time for T0 interrupt. High clock is external 4MHz. Fcpu=Fosc/4. Select
T0RATE=010 (Fcpu/64).
T0C initial value = 256 - (T0 interrupt interval time * input clock)
= 256 - (10ms * 4MHz / 4 / 64)
= 256 - (10-2 * 4 * 106 / 4 / 64)
= 100
= 64H
The basic timer table interval time of T0.
High speed mode (Fcpu = 4MHz / 4)
Low speed mode (Fcpu = 32768Hz / 4)

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 70 Version 0.9
8.2.5 T0 TIMER OPERATION SEQUENCE
T0 timer operation sequence of setup T0 timer is as following.
Stop T0 timer counting, disable T0 interrupt function and clear T0 interrupt request flag.
; T0 interrupt function is disabled.
; T0 interrupt request flag is cleared.
;The T0 rate control bits exist in bit4~bit6 of T0M. The
; value is from x000xxxxb~x111xxxxb.
Set T0 interrupt interval time.
Set T0 timer function mode.
; Enable T0 interrupt function.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 71 Version 0.9
IR OUTPUT
9.1 OVERVIEW
IR signal is generated by IR timer. The IR output pin is 400mA @Vss+0.5V sink type. When IREN bit of IRM is set as
logic “1”, IROUT pin exchanges from GPIO to IR output mode. If CREN = 0 or system is in power down mode, IROUT
pin is tied to high status. The IR timer is an 8-bit binary up counting timer for IR signal generator. The IR signal is
duty/cycle changeable type controlled by IRR and IRD. IRR decides IR’s cycle and IRD decides IR’s duty. IR counter
clock source is only from Fhosc (system high clock source), eg. IHRC_8M, 4MHz or 455KHz crystal. If Fhosc is 4MHz,
the IR counter clock rate is 4MHz. IR timer only generate IR output and no interrupt function. When enable IR output
function (CREN=1), IR output status is low level. IRC initial value is IRR and starts to count. When IRC=IRD, IR output
status change to high level and finishes low duty operation. When IRC overflow occurs (IRC changes from 0xFF to
0x00), IR output high duty operation stops. System loads IRR into IRC automatically and next cycle starts.
Fhosc
CREN
CPUM0
IRC
8-Bit Binary Up
Counting Counter
IRR Reload
Data Buffer
Up Counting
Reload Value
Compare
R
S
Output Low
IROUT pin
IR Signal
IREN
Load
IRD
Data Buffer
IRC Overflow
9.2 IR CONTROL REGISTER
9.2.1 IRM MODE REGISTER
Bit 1 IREN: IROUT pin control bit.
0 = Disable. IROUT pin is P5.4 GPIO mode.
1 = Enable. IROUT pin is output high status.
Bit 0 CREN: IR carry signal output control bit.
0 = Disable. IROUT pin is output high status.
1 = Enable. IROUT pin outputs IR carry signal.
Note: IR carry output condition is IREN=1 and CREN=1. If CREN=1 and IREN=0, the IROUT pin is P5.4
GPIO mode.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 72 Version 0.9
9.2.2 IRC COUNTING REGISTER
IRC is an 8-bit counter register for IR interval time control.
Note: Set IRC=IRR before IR output enable to make sure the first cycle correct.
9.2.3 IRR AUTO-LOAD REGISTER
IRR decides IR signal frequency. IR timer is with auto-load function. When IRC overflow occurs, IRR value will load
to IRC. It is easy to generate an accurate time for IR signal cycle, and users don’t reset IRC during interrupt service
routine.
IR is double buffer design. If new IRR value is set by program, the new value is stored in 1st buffer. Until IR overflow
occurs, the new value moves to real IRR buffer.
The equation of IRRinitial value is as following.
IRR initial value = 256 - (IR interrupt interval time * input clock)
Note: The input clock is 4MHz of external 4MHz oscillator.
Example: Set IR cycle frequency is 38KHz. Input clock is 4MHz.
IRR initial value = 256 - (IR interrupt interval time * input clock)
IR interval time = 1/38KHz = 26.3us
Input clock = external oscillator 4MHz.
IRR = 256 - (26.3us * 4MHz)
= 150.8
≈ 151
= 97h

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 73 Version 0.9
9.2.4 IRD IR DUTY CONTROL REGISTER
The IR signal is duty changeable by IRD. IRD decides the IR output signal low pulse width length. When IRC=IRD, the
IR signal changes from low pulse to high pulse. The low pulse stops when IRC overflow. The low pulse width is
IRD-IRR, and the high pulse width is 256-IRD. It is easy to modulate IR duty/cycle by IRR and IRD registers.
The equation of IRD initial value is as following.
IRD initial value = IRR + (256-IRR) / (1/IR duty)
Example: Set IRD for 38KHz IR and duty is 1/3. Input clock is 4MHz.
IRD initial value = IRR + (256-IRR) / (1/IR duty)
IRR of 38KHz = 151
IRD = 151 + (256-151)/(1/ (1/3))
= 186
= BAh
Common IR signal table. System clock is 4MHz.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 74 Version 0.9
9.3 IR OUTPUT OPERATION SEQUENCE
Set IRC and IRR for IR cycle.
;IRC, IRR value for IR cycle.
; Set IROUT pin to IR carry output function.
; Set IR carry signal output.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 75 Version 0.9
9.4 IR APPLICATION CIRCUIT
The IR sink current is 400mA @Vss+1.5V.
Crystal type, Max. 56 keys:
VCC
S7
S2 S51
S50S1
S55
S56
S6
C1
47uF
BT1
3V
KI3
KI2
KI1
KI5
KI4
KO1
KI7
KI6
KO4KO3KO2 KO6KO5
...
KO7 KO8
...
...
...
R1 3.75 ohm D1 IR
Y1 4MHz
C5
20pF
C4
20pF
R3
47k ohm
C2
0.1uF
VDD
VSS
U
U1
SN8PC20
VDD
1
P0.0
2
P0.1
3
P0.2/RST
4
P0.3/XIN
5
P0.4/XOUT
6
P0.5
7
P0.6
8
P0.7
9
P1.0
10
VSS
20
P5.4/IROUT
19
P5.0
18
P1.7
17
P1.6
16
P1.5
15
P1.4
14
P1.3
13
P1.2
12
P1.1
11
VDD
VSS
XOUT
XIN
VSS
VSSVDD
XIN
XOUT
IHRC_8M type, Max. 72 keys:
VCC
S9
S2 S66
S65S1
S71
S72
S8
C1
47uF
BT1
3V
KI1
KI5
KI3
KI2
KI7
KI6
KO2KO1
KI8
KO5KO4KO3 KO8KO6
...
...
KO7
...
...
R1 3.75 ohm D1 IR
R3
47k ohm
C2
0.1uF
VSS
VDD
U
U1
SN8PC20
VDD
1
P0.0
2
P0.1
3
P0.2/RST
4
P0.3/XIN
5
P0.4/XOUT
6
P0.5
7
P0.6
8
P0.7
9
P1.0
10
VSS
20
P5.4/IROUT
19
P5.0
18
P1.7
17
P1.6
16
P1.5
15
P1.4
14
P1.3
13
P1.2
12
P1.1
11
VSS
VDD
VDD VSS
KI4
KI4

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 76 Version 0.9
M I, “M” only supports 0x80~0x87 registers (e.g. PFLAG,R,Y,Z…)
A A + M + C, if occur carry, then C=1, else C=0
M A + M + C, if occur carry, then C=1, else C=0
A A + M, if occur carry, then C=1, else C=0
M A + M, if occur carry, then C=1, else C=0
M (bank 0) M (bank 0) + A, if occur carry, then C=1, else C=0
A A + I, if occur carry, then C=1, else C=0
A A - M - /C, if occur borrow, then C=0, else C=1
M A - M - /C, if occur borrow, then C=0, else C=1
A A - M, if occur borrow, then C=0, else C=1
M A - M, if occur borrow, then C=0, else C=1
A A - I, if occur borrow, then C=0, else C=1
A (b3~b0, b7~b4) M(b7~b4, b3~b0)
M(b3~b0, b7~b4) M(b7~b4, b3~b0)
ZF,C A - I, If A = I, then skip next instruction
ZF,C A – M, If A = M, then skip next instruction
A M + 1, If A = 0, then skip next instruction
M M + 1, If M = 0, then skip next instruction
A M - 1, If A = 0, then skip next instruction
M M - 1, If M = 0, then skip next instruction
If M.b = 0, then skip next instruction
If M.b = 1, then skip next instruction
If M(bank 0).b = 0, then skip next instruction
If M(bank 0).b = 1, then skip next instruction
PC15/14 RomPages1/0, PC13~PC0 d
Stack PC15~PC0, PC15/14 RomPages1/0, PC13~PC0 d
PC Stack, and to enable global interrupt
To push ACC and PFLAG (except NT0, NPD bit) into buffers.
POP To pop ACC and PFLAG (except NT0, NPD bit) from buffers.
1. “M” is system register or RAM. If “M” is system registers then “N” = 0, otherwise “N” = 1.
2. If branch condition is true then “S = 1”, otherwise “S = 0”.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 77 Version 0.9
ELECTRICAL CHARACTERISTIC
11.1 ABSOLUTE MAXIMUM RATING
Supply voltage (Vdd)…………………………………………………………………………………………………………………….……………… - 0.3V ~ 4.0V
Input in voltage (Vin)…………………………………………………………………………………………………………………….… Vss – 0.2V ~ Vdd + 0.2V
Operating ambient temperature (Topr)
SN8PC20P, SN8PC20S, SN8PC20X, SN8PC2016S, SN8P2014S..……………………………………………….………………….. -20C ~ + 70C
Storage ambient temperature (Tstor) ………………………………………………………………….………………………………………… –40C ~ + 125C
11.2 ELECTRICAL CHARACTERISTIC
DC CHARACTERISTIC
(All of voltages refer to Vss, Vdd = 3.0V, fosc = 4MHz, fcpu=1MHZ, ambient temperature is 25C unless otherwise note.)
Normal mode, Vpp = Vdd, 25C, Fcpu = 2mips.
RAM Data Retention voltage
Vdr 1.5 - - V Vdd rise rate
Vdd rise rate to ensure internal power-on reset
0.9Vdd - Vdd V Reset pin leakage current
I/O port pull-up resistor
I/O port input leakage current
Pull-up resistor disable, Vin = Vdd
I/O output source current
sink current
Vop = Vss + 1.5V, IR output pin
INT0 interrupt request pulse width
Run Mode
(No loading,
Fcpu = Fosc/4)
Slow Mode
(Internal low RC, Stop
high clock)
Green Mode
(No loading,
Fcpu = Fosc/4
Watchdog Disable)
Internal High Oscillator Freq.
25C,
Vdd= 3V,
Fcpu = 1MHz
“ *” These parameters are for design reference, not tested.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 78 Version 0.9
11.3 CHARACTERISTIC GRAPHS
The graphs in this section are for design guidance, not tested or guaranteed. In some graphs, the data
presented are outside specified operating range. This is for information only and devices are guaranteed to
operate properly only within the specified range.
Internal High RC Oscillator (MHz)
(Fcpu = IHRC/1~IHRC/8)
7.60
7.70
7.80
7.90
8.00
8.10
8.20
8.30
2.0V 2.5V 3.0V 3.5V 4.0V
Internal High RC Oscillator (MHz)
(Fcpu=IHRC/1~IHRC/8)
7.75
7.80
7.85
7.90
7.95
8.00
8.05
8.10
8.15
8.20
8.25
8.30
0 10 25 50 70

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 79 Version 0.9
DEVELOPMENT TOOL
SONIX provides ICE (in circuit emulation), IDE (Integrated Development Environment) and EV-kit for SN8PC20
development. ICE and EV-kit are external hardware devices, and IDE is a friendly user interface for firmware
development and emulation. These development tools’ version is as following.
ICE: SN8ICE2K
EV-kit: SN8PC20 EV-kit V1.0.
IDE: SONiX IDE M2IDE_V115.
Writer: MPIII WRITER-LV.
12.1 SN8PC20 EV-KIT
SN8PC20 EV-kit includes ICE interface , GPIO interface and IR driver module. The schematic of SN8PC20 EV-kit is as
following.
CON1: ICE interface connected to SN8ICE2K .
JP1: EV-Kit power connector between VCC and VDD. VCC is the power source from SN8ICE2K. VDD is the
power of KV-kit.
JP2: GPIO connector for test.
U1: SN8PC20 DIP and SSOP type connector for connecting to user’s target board.
U2/U3: Internal short connector. Don’t care them as emulating.
S1~S72: Remote key map.
D1/R1/R2/Q1: IR driving circuit for ICE emulation.
D2/R3: IR driving circuit for SN8PC20 real chip test. The two devices aren’t set on SN8PC20 EV-kit.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 80 Version 0.9
SN8PC20 EV-kit Circuit
P1.2
P0.0
P0.1
P0.4
S51
S59
P0.6
P0.7
S35
S3
S11
S19
P0.3
P1.2
JP2
HEADER 36X2
1 2
3 4
5 6
7 8
9 10
11 12
13 14
15 16
17 18
19 20
21 22
23 24
25 26
27 28
29 30
31 32
343633
35
P0.0
P0.1
P0.3
P0.2
S43
P0.5
S46S44
P0.5P0.5
P0.4
S45
P0.5 P0.5
S48S47
P1.7P0.5P1.4 P1.5 P1.6P1.2 P1. 3P1.0 P1. 1
S41
P0.5
S42
P0.5
P0.0
P1.3
P0.3
P0.2
P0.1
P0.0
S30
P0.3
P0.4
P0.2
S28
P0.0
S38
S22
P1.3
S61
P0.1
S37
S62
P1.5
P0.4
S54
S5
P0.0
P0.4P0.4
P1.4
P1.5
S13
S52
P0.7
S60
CON1
HEADER 30X2
1 2
3 4
5 6
7 8
9 10
11 12
13 14
15 16
17 18
19 20
21 22
23 24
25 26
27 28
29 30
31 32
33 34
35 36
37 38
39 40
41 42
43 44
45 46
47 48
49 50
51 52
53 54
55 56
57 58
59 60
P0.6
S21
P0.2
S6
P1.4
P0.7
P0.6
S36
S53
S4
S14
S29
S12
P0.1
P0.2
P0.6
P0.1
P1.5
S20
P0.7
P0.3
JP3
VDD
1
2
3
P1.3
P0.3
P1.4
VSSVDD
S32
P1.7
S15
S64
P0.4
P0.2
P1.6
S8
P0.3
P0.6
S7
S56
S31
P1.7
S23
P0.1
P0.7
P0.2
S63
P0.0
S16
S40
P0.0
S55
P0.4
P0.6
P0.7
P0.3
P1.6
S39
P1.7
P0.1
P1.6
S24
P1.7
P1.7
P1.7
P1.7
P1.6
P1.6
P1.6
P1.6
P1.5
P1.5
P1.5
P1.5
C4 20pF
R1 1K
P1.4
R2
330
P1.4
P1.4
C2
0.1uF
P1.4
P1.3
P1.3
P1.3
P1.3
C1
47uF
P1.2
P1.2
P1.2
P1.2
VDD
P1.1
P1.1
P1.1
P1.1
P1.0
P1.0
P1.0
P1.0
JP1
2 HEADER
1 2
VSS1
Y1
4MHz
VCC
C5 20pF
P5.0
P5.4
P0.3
P0.4
VSS2
S67
P5.0
P0.0
P1.0
P1.4
S69
P0.4
P1.2
P0.2
P1.6
S70
P5.0
S68
P5.0 P5.0
S72
P5.0
S71
P1.7P5.0P1.5 P1. 6P1.2 P1. 3 P1. 4
VSS
P1.0 P1. 1
S65
P0.6
P5.0P5.0
S66
P0.5
P1.3
VSS
P1.7
P0.1
P1.5
P0.7
P1.1
VCC
P0.3
S73 Reset
VDDVCC
P5.4
VDD2
P0.0
P0.1
P0.2
P0.3
VSS
P0.6
P0.5
P0.4
P0.7
P1.0
VSS2
U2
Short
112
2
P5.0
P5.4
P1.4
P1.5
P1.6
P1.7
U3
Short
112
2
P1.1
P1.2
P1.3
VDD1
Q1
PNP
D1 IR
C6 0.1uF
D2 IR R3 330
P5.4
R4
47k
C3
0.1uF
VDD
P5.4
VDD2
P5.4
P0.2
S1
S9
P0.6
S17
S25
JP4
VDD
1
2
3
S33
S49
P1.1
P0.7
P1.0
S57
P1.7
P1.2
P5.0
P1.4
P1.6
P1.5
P1.3
P0.0
P0.1
P0.2
P0.3
P0.4
P0.6
P0.5
P0.7
VSS
P5.0
P0.7
P1.0
P0.6
P1.6
P1.3
P1.7
P1.1
P1.2
P1.4
P1.5
P1.0
P1.0
P0.5
P1.0 P0. 2
P1.1
S26
P1.1
P0.1
P0.0
P0.4
S50
S58
P0.7
P0.6
S34
S2
S10
S18
P1.1
P0.3
U
U1
SN8PC20
VDD
1
P0.0
2
P0.1
3
P0.2/RST
4
P0.3/XIN
5
P0.4/XOUT
6
P0.5
7
P0.6
8
P0.7
9
P1.0
10
VSS
20
P5.4/IR OUT
19
P5.0
18
P1.7
17
P1.6
16
P1.5
15
P1.4
14
P1.3
13
P1.2
12
P1.1
11
P1.2
P0.2
S27
12.2 ICE AND EV-KIT APPLICATION NOTIC
SN8PC20 EV-kit includes matrix type key map and IR driving circuit module.
The IR driving circuit module includes two types. One is for ICE emulation to drive IR carry signal. The other one
is for SN8PC20 real chip test and disconnected with ICE. The EV-kit is like a real remote controller.
If the SN8PC20 real chip is set as 455KHz oscillator mode, the C4 (XIN) capacitance must be 47pF and C5
(XOUT) capacitance must be 20pF.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 81 Version 0.9
OTP PROGRAMMING PIN
13.1 THE PIN ASSIGNMENT OF EASY WRITER TRANSITION
BOARD SOCKET:
Easy Writer JP1/JP2 Easy Writer JP3 (Mapping to 48-pin text tool)
JP1 for MP transition board
JP3 for MP transition board

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 82 Version 0.9
13.2 PROGRAMMING PIN MAPPING:
Programming Information of SN8PC20
OTP IC / JP3 Pin Assignment
Note: It is necessary to connect a diode between P0.4/XOUT (Pin 6) and P1.1 (Pin 11) of the writer’s
transition board. The direction of diode is P0.4/XOUT to P1.1 as below graphic.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 83 Version 0.9
Marking Definition
14.1 INTRODUCTION
There are many different types in Sonix 8-bit MCU production line. This note listed the production definition of all 8-bit
MCU for order or obtain information. This definition is only for Blank OTP MCU.
14.2 MARKING INDETIFICATION SYSTEM
Title
SONiX 8-bit MCU Production
ROM Type
P=OTP
A=MASK
Material
B = PB-Free Package
G = Green Package
Temperature
Range
- = -20℃ ~ 70℃
Shipping
Package
W = Wafer
H = Dice
P = P-DIP
S = SOP
X = SSOP
Device
Device Part No.
SN8 X Part No. X X X
Note: SN8PC20 doesn’t support -40ºC~85ºC temperature range.

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 84 Version 0.9
14.3 MARKING EXAMPLE
X X X X XXXXX
Year
Month
1=January
2=February
. . . .
9=September
A=October
B=November
C=December
SONiX Internal Use
Day
1=01
2=02
. . . .
9=09
A=10
B=11
. . . .
03= 2003
04= 2004
05= 2005
06= 2006
. . . .

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 85 Version 0.9
PACKAGE INFORMATION
15.1 P-DIP 20 PIN

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 86 Version 0.9
15.2 SOP 20 PIN

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 87 Version 0.9
15.3 SSOP 20 PIN

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 88 Version 0.9
15.4 SOP 16 PIN

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 89 Version 0.9
15.5 SOP 14 PIN

SN8PC20
Remote Control 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD Page 90 Version 0.9
SONIX reserves the right to make change without further notice to any products herein to improve reliability, function or
design. SONIX does not assume any liability arising out of the application or use of any product or circuit described herein;
neither does it convey any license under its patent rights nor the rights of others. SONIX products are not designed,
intended, or authorized for us as components in systems intended, for surgical implant into the body, or other applications
intended to support or sustain life, or for any other application in which the failure of the SONIX product could create a
situation where personal injury or death may occur. Should Buyer purchase or use SONIX products for any such
unintended or unauthorized application. Buyer shall indemnify and hold SONIX and its officers , employees, subsidiaries,
affiliates and distributors harmless against all claims, cost, damages, and expenses, and reasonable attorney fees arising
out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use
even if such claim alleges that SONIX was negligent regarding the design or manufacture of the part.
Main Office:
Address: 10F-1, No.36, Taiyuan Street, Chupei City, Hsinchu, Taiwan.
Tel: 886-3-5600 888
Fax: 886-3-5600 889
Taipei Office:
Address: 15F-2, No.171 Song Ted Road, Taipei, Taiwan
Tel: 886-2-2759 1980
Fax: 886-2-2759 8180
Hong Kong Office:
Unit 1519, Chevalier Commercial Centre, NO.8 Wang Hoi Road, Kowloon Bay,
Hong Kong.
Tel: 852-2723-8086
Fax: 852-2723-9179
Technical Support by Email:
Sn8fae@sonix.com.tw