SN8P2602B
8-Bit Micro-Controller
SN8P2602B
USER’S MANUAL
Version 1.1
SONiX 8-Bit Micro-Controller
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.
SONiX TECHNOLOGY CO., LTD
Page 1
Version 1.1
SN8P2602B
8-Bit Micro-Controller
AMENDMENT HISTORY
Version
VER 0.1
VER 0.2
Date
Jun 2005
Nov. 2005
Dec 2005
Description
First issue
ADD Brown-Out reset circuit.
1.
Modify Topr value.
2.
Modify Brown-Out Reset description
3.
Remove power consumption(Pc).
4.
Add Fcpu limitation by noise filter enable.
5.
Modify ELECTRICAL CHARACTERISTIC.
1.
Add Marking Definition.
2.
Modify ELECTRICAL CHARACTERISTIC.
3.
Modify RST/P1.5/VPP PIN DISCRIPTION.
1.
Add Instruction Table.
1. Version update and the others.
2. Modify “WATCHDOG TIMER” chapter example program fail.
B0BSET FWDRST >> MOV A, #5AH
B0MOV WDTR,A
3. Adjust Chapter sequence.
4. Modify “TC0 CLOCK FREQUENCY OUTPUT (BUZZER)” chapter description :
TC0 Setup TC0OUT output from TC0 to TC0OUT (P5.4). The external
high-speed clock is 4MHz.. The TC0OUT frequency is 0.5KHz. Because the
TC0OUT signal is divided by 2, set the TC0 clock to 1KHz. The TC0 clock source
is from external oscillator clock. TC0 rate is Fcpu/4. The TC0RATE2~TC0RATE1
= 110. TC0C = TC0R = 131.
>>
TC0 Setup TC0OUT output from TC0 to TC0OUT (P5.4). The external
high-speed clock is 4MHz.. Fcpu = Fosc/4 = 1MIPS. The TC0OUT frequency is
1KHz. Because the TC0OUT signal is divided by 2, set the TC0 clock to 2KHz.
The TC0 clock source is from external oscillator clock. TC0 rate is Fcpu/4. The
TC0RATE2~TC0RATE1 = 110. TC0C = TC0R = 131.
Modify “ELECTRICAL CHARACTERICS” chapter operating temperature from -10~70℃
to -20~85℃ and others.
VER 0.3
Jan.2007
VER 0.4
VER 1.0
Mar.2007
Oct. 2011
VER 1.1
Aug. 2012
SONiX TECHNOLOGY CO., LTD
Page 2
Version 1.1
SN8P2602B
8-Bit Micro-Controller
Table of Content
1
1
AMENDMENT 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
MEMORY MAP ............................................................................................................................... 11
2.1.1
PROGRAM MEMORY (ROM) ............................................................................................... 11
2.1.1.1 RESET VECTOR (0000H) .................................................................................................. 12
2.1.1.2 INTERRUPT VECTOR (0008H) ......................................................................................... 13
2.1.1.3 LOOK-UP TABLE DESCRIPTION .................................................................................... 15
2.1.1.4 JUMP TABLE DESCRIPTION ........................................................................................... 17
2.1.1.5 CHECKSUM CALCULATION........................................................................................... 19
2.1.2
CODE OPTION TABLE .......................................................................................................... 20
2.1.3
DATA MEMORY (RAM) ....................................................................................................... 21
2.1.4
SYSTEM REGISTER .............................................................................................................. 22
2.1.4.1 SYSTEM REGISTER TABLE ............................................................................................ 22
2.1.4.2 SYSTEM REGISTER DESCRIPTION ............................................................................... 22
2.1.4.3 BIT DEFINITION of SYSTEM REGISTER ....................................................................... 23
2.1.4.4 ACCUMULATOR ............................................................................................................... 24
2.1.4.5 PROGRAM FLAG ............................................................................................................... 25
2.1.4.6 PROGRAM COUNTER....................................................................................................... 26
2.1.4.7 Y, Z REGISTERS................................................................................................................. 29
2.1.4.8 R REGISTERS ..................................................................................................................... 30
2.2
ADDRESSING MODE .................................................................................................................... 31
2.2.1
IMMEDIATE ADDRESSING MODE .................................................................................... 31
2.2.2
DIRECTLY ADDRESSING MODE ....................................................................................... 31
2.2.3
INDIRECTLY ADDRESSING MODE ................................................................................... 31
2.3
STACK OPERATION ...................................................................................................................... 32
2.3.1
OVERVIEW ............................................................................................................................. 32
2.3.2
STACK REGISTERS ............................................................................................................... 33
2.3.3
STACK OPERATION EXAMPLE.......................................................................................... 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
BROWN OUT DESCRIPTION ............................................................................................... 37
3.4.2
THE SYSTEM OPERATING VOLTAGE .............................................................................. 38
3.4.3
LOW VOLTAGE DETECTOR (LVD) ................................................................................... 38
3.4.4
BROWN OUT RESET IMPROVEMENT............................................................................... 40
3.5
EXTERNAL RESET ........................................................................................................................ 41
3.6
EXTERNAL RESET CIRCUIT ....................................................................................................... 41
3.6.1
Simply RC Reset Circuit .......................................................................................................... 41
3.6.2
Diode & RC Reset Circuit ........................................................................................................ 42
3.6.3
Zener Diode Reset Circuit ........................................................................................................ 42
Page 3
2
2
3
3
SONiX TECHNOLOGY CO., LTD
Version 1.1
SN8P2602B
8-Bit Micro-Controller
4
4
5
5
6
6
7
7
8
8
3.6.4
Voltage Bias Reset Circuit ....................................................................................................... 43
3.6.5
External Reset IC ...................................................................................................................... 44
SYSTEM CLOCK .................................................................................................................................. 45
4.1
OVERVIEW ..................................................................................................................................... 45
4.2
CLOCK BLOCK DIAGRAM .......................................................................................................... 45
4.3
OSCM REGISTER ........................................................................................................................... 46
4.4
SYSTEM HIGH CLOCK ................................................................................................................. 47
4.4.1
EXTERNAL HIGH CLOCK.................................................................................................... 47
4.4.1.1 CRYSTAL/CERAMIC ......................................................................................................... 48
4.4.1.2 RC ......................................................................................................................................... 48
4.4.1.3 EXTERNAL CLOCK SIGNAL ........................................................................................... 49
4.5
SYSTEM LOW CLOCK .................................................................................................................. 50
4.5.1
SYSTEM CLOCK MEASUREMENT .................................................................................... 51
SYSTEM OPERATION MODE ........................................................................................................... 52
5.1
OVERVIEW ..................................................................................................................................... 52
5.2
SYSTEM MODE SWITCHING ....................................................................................................... 53
5.3
WAKEUP ......................................................................................................................................... 55
5.3.1
OVERVIEW ............................................................................................................................. 55
5.3.2
WAKEUP TIME ...................................................................................................................... 55
5.3.3
P1W WAKEUP CONTROL REGISTER ................................................................................ 56
INTERRUPT ........................................................................................................................................... 57
6.1
OVERVIEW ..................................................................................................................................... 57
6.2
INTEN INTERRUPT ENABLE REGISTER ................................................................................... 58
6.3
INTRQ INTERRUPT REQUEST REGISTER ................................................................................ 59
6.4
GIE GLOBAL INTERRUPT OPERATION .................................................................................... 59
6.5
PUSH, POP ROUTINE..................................................................................................................... 60
6.6
INT0 (P0.0) INTERRUPT OPERATION ......................................................................................... 61
6.7
T0 INTERRUPT OPERATION........................................................................................................ 62
6.8
TC0 INTERRUPT OPERATION ..................................................................................................... 63
6.9
MULTI-INTERRUPT OPERATION ............................................................................................... 64
I/O PORT ................................................................................................................................................ 65
7.1
I/O PORT MODE ............................................................................................................................. 65
7.2
I/O PULL UP REGISTER ................................................................................................................ 66
7.3
I/O OPEN-DRAIN REGISTER ........................................................................................................ 67
7.4
I/O PORT DATA REGISTER .......................................................................................................... 68
TIMERS .................................................................................................................................................. 69
8.1
WATCHDOG TIMER ...................................................................................................................... 69
8.2
TIMER 0 (T0) ................................................................................................................................... 71
8.2.1
OVERVIEW ............................................................................................................................. 71
8.2.2
T0M MODE REGISTER ......................................................................................................... 71
8.2.3
T0C COUNTING REGISTER ................................................................................................. 72
8.2.4
T0 TIMER OPERATION SEQUENCE ................................................................................... 73
8.3
TIMER/COUNTER 0 (TC0) ............................................................................................................ 74
8.3.1
OVERVIEW ............................................................................................................................. 74
8.3.2
TC0M MODE REGISTER ....................................................................................................... 75
8.3.3
TC0C COUNTING REGISTER .............................................................................................. 76
8.3.4
TC0R AUTO-LOAD REGISTER ............................................................................................ 77
8.3.5
TC0 CLOCK FREQUENCY OUTPUT (BUZZER)................................................................ 78
8.3.6
TC0 TIMER OPERATION SEQUENCE ................................................................................ 79
8.4
PWM0 MODE .................................................................................................................................. 81
8.4.1
OVERVIEW ............................................................................................................................. 81
8.4.2
TC0IRQ and PWM Duty .......................................................................................................... 82
Page 4
SONiX TECHNOLOGY CO., LTD
Version 1.1
SN8P2602B
8-Bit Micro-Controller
8.4.3
PWM Duty with TC0R Changing ............................................................................................ 83
8.4.4
PWM PROGRAM EXAMPLE ................................................................................................ 84
9
9
INSTRUCTION TABLE ....................................................................................................................... 85
10
10
ELECTRICAL CHARACTERISTIC .............................................................................................. 86
10.1 ABSOLUTE MAXIMUM RATING ................................................................................................ 86
10.2 ELECTRICAL CHARACTERISTIC ............................................................................................... 86
11
11
OTP PROGRAMMING PIN ............................................................................................................. 87
11.1 T
HE PIN ASSIGNMENT OF
E
ASY
W
RITER TRANSITION BOARD SOCKET
: .............................................. 87
11.2 P
ROGRAMMING
P
IN
M
APPING
: .......................................................................................................... 88
12
12
PACKAGE INFORMATION ........................................................................................................... 89
12.1 P-DIP 18 PIN .................................................................................................................................... 89
12.2 SOP 18 PIN ....................................................................................................................................... 90
12.3 SSOP 20 PIN..................................................................................................................................... 91
13
13
MARKING DEFINITION ................................................................................................................. 92
13.1 INTRODUCTION ............................................................................................................................ 92
13.2 MARKING INDETIFICATION SYSTEM ...................................................................................... 92
13.3 MARKING EXAMPLE ................................................................................................................... 93
13.4 DATECODE SYSTEM .................................................................................................................... 93
SONiX TECHNOLOGY CO., LTD
Page 5
Version 1.1