Page 1
MF297-07 CMOS 4 - BIT SINGLE CHIP MICROCOMPUTER S1C6200/6200A Core CPU Manual...
Page 2
No part of this material may be reproduced or duplicated in any form or by any means without the written permission of Seiko Epson. Seiko Epson reserves the right to make changes to this material without notice. Seiko Epson does not assume any...
Page 3
The information of the product number change Starting April 1, 2001, the product number will be changed as listed below. To order from April 1, 2001 please use the new product number. For further information, please contact Epson sales representative.
S1C6200/6200A Core CPU Manual ____________________________________________________ 1 ESCRIPTION 1.1 System Features ... 1 1.2 Instruction Set Features ... 1 1.3 Differences between S1C6200 and S1C6200A ... 1 EMORY AND PERATIONS 2.1 Program Memory (ROM) ... 3 2.1.1 Program counter block ... 4 2.1.2 Flags ...
• Interrupt circuit – Interrupt timing (refer to Section 2.5.3, "Operation during interrupt generation".) – Writing to interrupt mask registers and reading of interrupt flags (refer to Appendix A, "S1C6200A (Advanced S1C6200) Core CPU".) S1C6200/6200A CORE CPU MANUAL EPSON 1 DESCRIPTION...
Page 8
Instruction Register (12) Program Memory (8,192 12-bit words max.) 4-bit address bus RP (4) YHL (8) XHL (8) Stack Pointer (8) 12-bit data bus Fig. 1.1 Block diagram EPSON XP (4) YP (4) Oscillator Interrupt Timing Controller Generator A (4) B (4)
Step 0 Step 1 (within bank) Step 254 Step 255 (between banks) Program or data code area Fig. 2.1.1 Program memory configuration EPSON 2 MEMORY AND OPERATIONS Bank 1 Page 15 Bank 1 Bank 1 Page 14 Step 0 Step 1...
Page 1 Bank 1 Page 0 Step 0 Step 1 Step 254 Step 255 Fig. 2.1.4.1 The PSET and jump instructions EPSON 2 MEMORY AND OPERATIONS Jump can go between banks Bank 1 Page 15 Bank 1 Page 14 Step 0...
The data set by PSET is canceled, and the program jumps to bank 0, page 1, step 9. Bank 0 Page 0 EEE... Bank 0 Page 2 PSET Not effect on destination CALZ of CALZ Fig. 2.1.7.1 The use of the CALZ instruction EPSON S1C6200/6200A CORE CPU MANUAL...
Step 255 Bank 0 Page 0 Program memory PSET CALL Bank 0 Page 10 Program memory DDD... RETS EPSON 2 MEMORY AND OPERATIONS Bank 1 Page 15 Bank 1 Bank 1 Page 14 Step 0 Step 1 CALL Bank 1...
Fig. 2.2.1 Data memory configuration Register/Pointer Mnemonic Index Register X Index Register Y Stack Pointer Register Fig. 2.2.1.1 The configuration of the index register IX EPSON XHL or YHL (within page) Memory or I/O Register area Size (bits) S1C6200/6200A CORE CPU MANUAL...
Page 15
As the register area can also be indirectly accessed M(n) – 1 using IX, IY or SP, the stack area should not grow to address 000H to 00FH when RP is used. EPSON 2 MEMORY AND OPERATIONS Table 2.2.1.2 Stack usage Instruction...
D = 1 : Result of Actual D = 0 : Result of decimal operation result hexadecimal operation ALU output EPSON X: Don't care. Subtraction D = 1 : Result of decimal operation ALU output ALU output S1C6200/6200A CORE CPU MANUAL...
HALT or SLP, otherwise they will hang waiting for an interrupt. S1C6200/6200A CORE CPU MANUAL Execute Fetch State State State State Execute State State State State Fig. 2.4.1 Instruction execution timing EPSON 2 MEMORY AND OPERATIONS Execute State State State State...
HALT or SLP. <Differences between S1C6200 and S1C6200A> In the S1C6200 and the S1C6200A, the time it takes to complete interrupt processing by hardware after the Core CPU receives the interrupt request is different as follows: Table 2.5.3.1 Required interrupt processing time...
Page 19
S1C6200 Clock Status Instruction 5-clock Instrruction S1C6200A Clock Status Instruction 5-clock Instrruction Status: Fetch S1C6200/6200A System clock CPU clock Status Instruction 5-clock Instrruction Status: Fetch S1C6200/6200A CORE CPU MANUAL 12-clock Instrruction Interrupt Interrupt processing: 12-clock instruction 7-clock instruction 5-clock instruction...
Page 20
System clock CPU clock Status Instruction 5-clock Instrruction Status: Fetch S1C6200 Clock Status Instruction PSET Interrupt processing: S1C6200A Clock Status Instruction PSET Status: Fetch SLEEP Interrupt Interrupt processing: 14 to 15 clock cycles Execute Note: (*1) INT1 and INT2 are dummy instructions...
Interrupt Flag Decimal Flag Zero Flag Carry Flag <Difference between S1C6200 and S1C6200A> There is a difference in the setting value of the D (decimal) flag at initial reset between the S1C6200 and the S1C6200A. D (decimal) flag setting When using the model loaded with the S1C6200 Core CPU, set or reset the D flag in the user's initial routine before using an arithmetic instruction.
7. Arithmetic and logical operation b. Index in alphabetical order The instructions are arranged in alphabetical order. Page number references are provided. c. Index by operation code The instructions are arranged in numerical order by operation code. EPSON S1C6200/6200A CORE CPU MANUAL...
YL XH, i XL, i YH, i YL, i S1C6200/6200A CORE CPU MANUAL Operation Code Flag Clock I D Z C EPSON 3 INSTRUCTION SET Operation p4, NPP p3~p0 NBP, PCP NPP, PCS s7~s0 NBP, PCP NPP, PCS s7~s0 if C=1...
Page 24
LBPX MX, e Flag F, i operation F, i instructions Stack operation instructions PUSH Operation Code Flag Clock I D Z C EPSON Operation XH-i3~i0 XL-i3~i0 YH-i3~i0 YL-i3~i0 i3~i0 M(n3~n0) M(n3~n0) M(n3~n0) M(n3~n0) M(X) i3~i0, X q, X M(Y) i3~i0, Y...
Page 25
MX, r ACPY MY, r SCPX MX, r SCPY MY, r S1C6200/6200A CORE CPU MANUAL Operation Code Flag Clock I D Z C EPSON 3 INSTRUCTION SET Operation M(SP), SP SP+1 M(SP), SP SP+1 M(SP), SP SP+1 r+i3~i0 r+i3~i0+C r+q+C...
Page 27
M(n3~n0) M(n3~n0) i3~i0 M(X) q, X M(Y) q, Y No operation (5 clock cycles) No operation (7 clock cycles) rVi3~i0 M(SP), SP EPSON 3 INSTRUCTION SET Operation M(n3~n0) M(n3~n0) e7~e4, XL e3~e0 e7~e4, YL e3~e0 i3~i0, X i3~i0, Y M(SP), SP...
Page 28
Flag Clock I D Z C PCSL PCSL PCSL r-i3~i0-C r-q-C M(X) M(Y) SLEEP (stop oscillation) r i3~i0 EPSON Operation p4, NPP p3~p0 SP-1, M(SP) SP-1, M(SP) SP-1, M(SP) SP-1, M(SP) SP-1, M(SP) SP-1, M(SP) SP-1, M(SP) SP-1, M(SP) 0 (Decimal Adjuster OFF)
D80 to DBF r, i DC0 to DFF r, i E00 to E3F r, i S1C6200/6200A CORE CPU MANUAL Flag Clock I D Z C EPSON 3 INSTRUCTION SET Operation NBP, PCP NPP, PCS s7~s0 PCSL M(SP), PCSH M(SP+1), PCP SP+3, M(X)
Page 30
F50 to F5F F, i F60 to F6F F70 to F7F F80 to F8F Mn, A Operation Code Flag Clock I D Z C EPSON Operation p4, NPP p3~p0 M(X) i3~i0, X M(Y) i3~i0, Y C, d2 d3, d1 d2, d0...
Page 31
FF0 to FF3 SPL, r FF4 to FF7 r, SPL HALT NOP5 NOP7 S1C6200/6200A CORE CPU MANUAL Flag Clock I D Z C EPSON 3 INSTRUCTION SET Operation M(n3~n0) M(n3~n0) M(n3~n0) SP-1, M(SP) SP-1, M(SP) SP-1, M(SP) SP-1, M(SP) SP-1, M(SP)
POP F instruction. When an interrupt is generated, the I flag is automatically reset. It is not automatically set at the end of the interrupt service routine. Table 3.2.1 Values of r and q r1 or q1 r0 or q0 EPSON S1C6200/6200A CORE CPU MANUAL...
3.5 Instruction Descriptions This section describes S1C6200/6200A instructions in alphabetical order. S1C6200/6200A CORE CPU MANUAL 8-bit operand 6-bit operand 5-bit operand 4-bit operand 2-bit operand Op-code EPSON 3 INSTRUCTION SET CALL LBPX MX,e etc. r, i r, i r, i etc.
Page 35
S1C6200/6200A CORE CPU MANUAL to i ADC MX,3 0100 1000 1001 1001 ADC MY,A 0101 0101 0001 0001 0111 0111 1011 0001 EPSON 3 INSTRUCTION SET C40H to C7FH ADC B,7 1000 0000 A90H to A9FH ADC MX,B 0101 0001 1001 0001...
Page 36
Adds the carry bit and immediate data i to XL, the four low-order bits of XHL. Example: XL register C flag Z flag to i ADC XH,2 ADC XH,4 1001 1100 to i ADC XL,3 ADC XL,0EH 0000 0100 EPSON A00H to A0FH 0000 A10H to A1FH 0010 S1C6200/6200A CORE CPU MANUAL...
Page 37
Adds the carry bit and immediate data i to YL, the four low-order bits of YHL. Example: YL register C flag Z flag S1C6200/6200A CORE CPU MANUAL to i ADC YH,3 ADC YH,6 1010 1110 to i ADC YL,3 ADC YL,2 1010 1110 EPSON 3 INSTRUCTION SET A20H to A2FH 0100 A30H to A3FH 0000...
Page 38
Z flag to i ADD A,5 1010 1111 0110 0110 ADD A,MY 0010 1111 0100 0100 0111 0111 1101 1101 EPSON C00H to C3FH ADD MY,2 1111 1000 A80H to A8FH ADD MX,B 1111 0100 1011 1101 S1C6200/6200A CORE CPU MANUAL...
S1C6200/6200A CORE CPU MANUAL to i AND A,5 0110 0100 1000 1000 AND MX,A 0100 0100 1011 1011 1010 0000 0010 0010 EPSON 3 INSTRUCTION SET C80H to CBFH AND MX,3 0100 0000 AC0H to ACFH AND B,MY 0100 0010 0000 0010...
CP YH,0AH CP YH,3 1010 1010 to i ; otherwise, reset. to i ; otherwise, reset. CP YL,5 CP YL,1 0100 0100 EPSON 3 INSTRUCTION SET A60H to A6FH CP YH,0FH 1010 1010 A70H to A7FH CP YL,4 0100 0100...
Page 44
Z flag to n ) - 1 DEC M0 DEC M2 1001 1000 0000 0000 0001 0001 DEC SP 1011 0001 1011 0000 EPSON F70H to F7FH DEC M0FH 1000 1000 1111 1111 0001 0000 FCBH S1C6200/6200A CORE CPU MANUAL...
Clock Cycles: Flag: C – Not affected Z – Not affected D – Not affected I – Description: Enables all interrupts. Example: C flag Z flag D flag I flag S1C6200/6200A CORE CPU MANUAL F57H F48H EPSON 3 INSTRUCTION SET...
Page 46
1000 1000 0100 0100 1000 1000 FAN A,B FAN MX,B 1000 1000 1010 1010 0101 0101 1110 1110 EPSON D80H to DBFH FAN B,2 1000 1000 0100 0100 1000 1000 F10H to F1FH FAN A,MY 1000 1000 1010 1010 0101...
Page 47
0001 0001 to n ) + 1 INC M1 INC M3 0100 0101 1111 1111 0111 0111 EPSON 3 INSTRUCTION SET FF8H I flag 0011 0011 0011 0100 Interrupt vector address F60H to F6FH INC M0DH 0101 0101 0000 0000...
Increments the contents of register X by 1. This operation does not affect the flags. Example: X register C flag Z flag FDBH INC SP 1110 1111 1111 0000 EE0H INC X 1111 1110 1111 1111 EPSON S1C6200/6200A CORE CPU MANUAL...
Increments the program counter by 1. Has no other effect for 7 clock cycles. Example: S1C6200/6200A CORE CPU MANUAL 1 0 1 1 FFBH NOP5 0011 0011 0001 0011 0001 0100 1 1 1 1 FFFH NOP7 1010 1010 1001 1001 1001 1010 EPSON 3 INSTRUCTION SET...
Page 68
Memory (MX) Z flag 1 1 1 1 NOT A 1001 0110 1111 1111 to i OR B,5 0100 0101 0011 0011 EPSON D0FH to D3FH NOT MY 0110 0000 CC0H to CFFH OR MX,0BH 0101 0111 S1C6200/6200A CORE CPU MANUAL...
S1C6200/6200A CORE CPU MANUAL OR MY,0 0011 0011 0000 0000 SP + 1 1 0 1 0 POP F 1001 1001 0001 1001 EPSON 3 INSTRUCTION SET AD0H to ADFH OR A,0CH 1111 0000 FDAH M(SP) = flag flag flag flag...
Page 70
SP + 1 0 0 r FD0H to FD3H M(SP) = POP B 1001 1001 0101 1001 SP + 1 0 1 0 1 FD5H M(SP) = POP XH 0110 0110 0010 0110 EPSON = r-register = XH S1C6200/6200A CORE CPU MANUAL...
Page 73
0 1 1 1 POP YP 0000 0000 0001 0000 , NPP to p PSET 1FH 1000 1000 0001 1111 0010 0011 0010 0100 EPSON 3 INSTRUCTION SET FD7H M(SP) = = YP E40H to E5FH JP 00H 1111 1111 0000 0000...
Page 74
A register 1 0 1 0 FCAH M(SP) = PUSH F 0100 0001 0001 0001 0 0 r FC0H to FC3H PUSH A M(SP) = 1000 0010 0010 0010 EPSON flag flag flag flag = r-register S1C6200/6200A CORE CPU MANUAL...
Example: A register D flag C flag Z flag 1 1 1 0 F5EH ADD A,4 1101 0001 0001 1 0 1 1 F5BH ADD A,8 LD A,6 0110 0100 0100 EPSON ADD A,8 0110 1110 S1C6200/6200A CORE CPU MANUAL...
Page 80
1 1 1 0 RETS 0110 0000 1001 0000 0000 0111 0110 0110 0000 0000 0000 0000 C, C r-register RLC A 0011 0111 EPSON M(SP+2), SP SP + 3, PC FDEH AF0H to AFFH r-register S1C6200/6200A CORE CPU MANUAL PC + 1...
Page 81
RRC MY 1010 1101 to i is zero; otherwise, not affected. is zero; otherwise, not affected. is zero; otherwise, not affected. is zero; otherwise, not affected. RST F,2 1010 0010 EPSON 3 INSTRUCTION SET E8CH to E8FH F50H to F5FH...
Page 82
Subtracts the carry flag and immediate data i from the r-register. Example: A register Memory (MY) C flag Z flag 1 1 0 1 ADD A,3 1101 0000 to i SBC A,9 SBC MY,0DH 1000 1111 1110 1110 EPSON F5DH 0000 D40H to D7FH 1111 0000 S1C6200/6200A CORE CPU MANUAL...
S1C6200/6200A CORE CPU MANUAL 0 1 0 0 to i is 1; otherwise, not affected. is 1; otherwise, not affected. is 1; otherwise, not affected. is 1; otherwise, not affected. SET F,0DH 0011 1111 EPSON 3 INSTRUCTION SET F44H F40H to F4FH...
Page 86
B register C flag Z flag 1 0 0 1 FF9H Instruction State 0100 0011 0000 0100 0011 0001 SLEEP NOP5 0001 0000 0001 AA0H to AAFH SUB A,B 1100 1001 0011 0011 EPSON I flag S1C6200/6200A CORE CPU MANUAL...
The result is stored in the r-register. Example: A register Memory (MX) Z flag S1C6200/6200A CORE CPU MANUAL 0 0 1 0 to i XOR A,12 0110 1010 0001 0001 EPSON 3 INSTRUCTION SET F42H D00H to D3FH XOR MX,1 1010 0000...
Page 88
Operation: OP-Code: Type: Clock Cycles: Flag: C – Z – D – I – Description: Example: XOR A,MY 0100 1100 1111 1111 0111 0111 1000 1000 EPSON AE0H to AEFH XOR MX,B 1100 1111 1000 1000 S1C6200/6200A CORE CPU MANUAL...
Page 89
Logical AND Clock Cycles: ... Logical OR Flag: C – ... Exclusive-OR Z – ... Reset flag D – ... Set flag I – ... Set/reset flag Description: ... Decimal addition/subtraction Example: S1C6200/6200A CORE CPU MANUAL EPSON 3 INSTRUCTION SET...
S1C6200. It is recommended that users of S1C6200A read this section. S1C6200A is a Core CPU which has been made easier to integrate software by improving the parts of the S1C6200 CPU which are difficult to use.
Page 91
Status: Fetch Clock Status Instruction PSET Interrupt processing: Status: Fetch Fig. A2.2.1 Timing chart of S1C6200A interrupt S1C6200/6200A CORE CPU MANUAL APPENDIX A. S1C6200A (ADVANCED S1C6200) CORE CPU 12-clock Instrruction Interrupt Interrupt processing: 12-clock instruction 7-clock instruction 5-clock instruction Execute...
This section describes the operation for reading the interrupt factor flag during EI (enable interrupt flag) in the regular 1-chip micro controller which uses S1C6200 Core CPU and in the regular 1-chip micro control- ler which uses S1C6200A Core CPU. For information on accurate operation, see the respective hardware manuals of the S1C62 Family.
Indirect jump using registers A and B ... 43 Jump if carry flag is set ... 44 Jump if not carry ... 44 Jump if not zero ... 45 Jump ... 45 Jump if zero ... 46 EPSON APPENDIX B. INSTRUCTION INDEX...
Page 94
Pop stack data into XP ... 65 Pop stack data into YH ... 66 Pop stack data into YL ... 66 Pop stack data into YP ... 67 Page set ... 67 Push flag onto stack ... 68 EPSON S1C6200/6200A CORE CPU MANUAL...
Page 95
Set flags using immediate data i ... 79 Sleep ... 80 Subtract q-register from r-register ... 80 Set zero flag ... 81 Exclusive-OR immediate data i with r-register ... 81 Exclusive-OR q-register with r-register ... 82 EPSON APPENDIX B. INSTRUCTION INDEX...
Page 96
EPSON HONG KONG LTD. 20/F., Harbour Centre, 25 Harbour Road Wanchai, Hong Kong Phone: +852-2585-4600 Fax: +852-2827-4346 Telex: 65542 EPSCO HX EPSON TAIWAN TECHNOLOGY & TRADING LTD. 10F, No. 287, Nanking East Road, Sec. 3 Taipei Phone: 02-2717-7360 Fax: 02-2712-9164 Telex: 24444 EPSONTB HSINCHU OFFICE 13F-3, No.
Page 97
In pursuit of “Saving” Technology, Epson electronic devices. Our lineup of semiconductors, liquid crystal displays and quartz devices assists in creating the products of our customers’ dreams. Epson IS energy savings.
Page 98
S1C6200/6200A Core CPU Manual ELECTRONIC DEVICES MARKETING DIVISION EPSON Electronic Devices Website http://www.epson.co.jp/device/ First issue February, 1989 Printed February, 2001 in Japan...