Bm-Atom1 0-V1 6
Bm-Atom1 0-V1 6
Bm-Atom1 0-V1 6
ATOM Family
BM-ATOM1.0-V1.6
4-bit Microcontrollers
with Reduced 8051 Architecture
V1.6
July 2008
CORERIVER Semiconductor reserves the right to make corrections, modifications, enhancements, improvements, and other
changes to its products and services at any time.
CORERIVER shall give customers at least a three month advance notice of intended discontinuation of a product or a
service through its homepage.
Customers should obtain the latest relevant information before placing orders and should verify that such information is
current and complete.
The CORERIVER products listed in this document are intended for usage in general electronics applications. These
CORERIVER products are neither intended nor warranted for usage in equipment that requires extraordinarily high quality
and/or reliability or a malfunction or failure of which may cause loss of human life or bodily injury.
ATOM1.0 Family - GC49C501 Series (Low Cost, Low Power Application MCU)
Mask-ROM FLASH EEPROM RAM Volt Freq. T/C Serial REM IR. LED I/O Available
Product WDT Package Others
(byte) (byte) (byte) (Nibble) (V) (MHz) (16bits) I/O Output Drive Tr. Pins Time
10 18 POR/LVD
GC49C501G0-SO24I - 1K (128) 64 1.8~5.5 - - 1 1 Yes 24-SOIC Ring OSC NOW
(5) (20) ISP/IAP
10 14 20-SOIC POR/LVD
GC49C501G0-SO20I - 1K (128) 64 1.8~5.5 - - 1 1 Yes Ring OSC NOW
(5) (16) (Narrow) ISP/IAP
10 14 20-SOIC POR/LVD
GC49C501G0-SJ20I - 1K (128) 64 1.8~5.5 - - 1 1 Yes Ring OSC NOW
(5) (16) (JEDEC) ISP/IAP
POR/LVD
10 18 Calibrated
GC49C501R0-SO24I - 1K (128) 64 1.8~5.5 - - 1 1 Yes 24-SOIC NOW
(5) (20) Ring OSC
ISP/IAP
POR/LVD
10 14 20-SOIC Calibrated
GC49C501R0-SO20I - 1K (128) 64 1.8~5.5 - - 1 1 Yes NOW
(5) (16) (Narrow) Ring OSC
ISP/IAP
POR/LVD
10 14 220-SOIC Calibrated
GC49C501R0-SJ20I - 1K (128) 64 1.8~5.5 - - 1 1 Yes NOW
(5) (16) (JEDEC) Ring OSC
ISP/IAP
POR/LVD
10 Calibrated
GC49C501RP-SO8I - 1K (128) 64 1.8~5.5 - - 1 - - 6 8-SOIC NOW
(5) Ring OSC
ISP/IAP
POR/LVD
10 Calibrated
GC49C501RP-SP8I - 1K (128) 64 1.8~5.5 - - 1 - - 6 8-SPDIP NOW
(5) Ring OSC
ISP/IAP
* User may use part of program area (128 bytes) as EEPROM, which can be modified by IAP function during S/W operation.
* Max. operating frequency of ATOM1.0 family is 5 MHz when VDD is less than 2.7 V.
ATOM1.0 Family - GC49C501 Series (Low Cost, Low Power Application MCU)
Mask-ROM FLASH EEPROM RAM Volt Freq. T/C Serial REM IR. LED I/O Available
Product WDT Package Others
(byte) (byte) (byte) (Nibble) (V) (MHz) (16bits) I/O Output Drive Tr. Pins Time
POR/LVD
10 18
GC41C501G0-SO24I 1K - - 64 1.8~5.5 - - 1 1 Yes 24-SOIC Ring OSC NOW
(5) (20)
POR/LVD
10 14 20-SOIC
GC41C501G0-SO20I 1K - - 64 1.8~5.5 - - 1 1 Yes Ring OSC NOW
(5) (16) (Narrow)
POR/LVD
10 14 20-SOIC
GC41C501G0-SJ20I 1K - - 64 1.8~5.5 - - 1 1 Yes Ring OSC NOW
(5) (16) (JEDEC)
POR/LVD
10
GC41C501G0-SO8I 1K - - 64 1.8~5.5 - - 1 - - 6 8-SOIC Ring OSC NOW
(5)
POR/LVD
10
GC41C501G0-SP8I 1K - - 64 1.8~5.5 - - 1 - - 6 8-SPDIP Ring OSC NOW
(5)
* User may use part of program area (128 bytes) as EEPROM, which can be modified by IAP function during S/W operation.
* Max. operating frequency of ATOM1.0 family is 5 MHz when VDD is less than 2.7 V.
Power Consumption
9 Stop mode : <0.1uA (Typ.) at 2.0V
1 uA (Max.) at 5.0V
9 Normal mode : 400 uA (Typ.) at 2.0V, FSYS = 4 MHz
Operating frequency vs. voltage
9 Max. FOSC= 10 MHz (2.7 V ≤ VDD ≤ 5.5V)
9 Max. FOSC= 5 MHz (1.8 V ≤ VDD < 2.7V)
Operating temperature : -40 °C ~ 85 °C
ESD protection up to 2,000V
Latch-up protection up to ±200mA
Package
9 24-pin SOIC
9 20-pin SOIC
9 8-pin SOIC/SPDIP
Instruction RomAddr( )
10
FLASH Program
Decoder
1K Bytes Counter
(IR) RomOut( ) RomOut( )
8
8
4 4
CPU BUS(4)
4 4 4
WDT
Data Address RAM
ALU
(SPH,SPL, 64 X 4
6
(C, ACC)
POR/LVD DPH, DPL) bits
VSS
REM IR LED
OSC. SFR & Ports IFF
Generation Driver TR VDD
Instruction RomAddr( )
10
FLASH Program
Decoder
1K Bytes Counter
(IR) RomOut( ) RomOut( )
8
8
4 4
CPU BUS(4)
4 4 4
WDT
Data Address RAM
ALU
(SPH,SPL, 64 X 4
6
(C, ACC)
POR/LVD DPH, DPL) bits
VSS
REM IR LED
OSC. SFR & Ports IFF
Generation Driver TR VDD
Instruction RomAddr( )
10
FLASH Program
Decoder
1K Bytes Counter
(IR) RomOut( ) RomOut( )
8
8
4 4
CPU BUS(4)
4 4 4
6
(C, ACC)
WDT DPH, DPL) bits
POR/LVD 4 DPL 4
VSS
RING OSC. SFR & Ports IFF
VDD
P0[2:0] P2[2:0]
GC49C501G0-SO20IP
GC49C501R0-SO20IP
GC49C501G0-SJ20IP
GC49C501R0-SJ20IP
GC49C501G0-SO24IP
GC49C501R0-SO24IP
XO / P4.1 3 18 TVSS XO / P4.1 3 22 TVSS
P0.0 4 17 P2.0/SCLK P4.2 4 21 P2.0/SCLK
P0.1 5 16 P2.1/SDAT P0.0 5 20 P2.1/SDAT
P0.2 6 15 P2.2 P0.1 6 19 P2.2
P0.3 7 14 P2.3 P0.2 7 18 P2.3
P1.0 8 13 P3.0 P0.3 8 17 P4.3
P1.1 9 12 P3.1 P1.0 9 16 P3.0
P3.3 10 11 P3.2 P1.1 10 15 P3.1
P1.2 11 14 P3.2
P1.3 12 13 P3.3
[ 20-SOIC]
GC49C501G0-SO20I [ 24-SOIC]
GC49C501R0-SO20I GC49C501G0-SO24I
GC49C501G0-SJ20I GC49C501R0-SO24I
GC49C501R0-SJ20I
VDD 1 8 VSS
AT10RP
P0.0 2 7 P2.0/SCLK
P0.1 3 6 P2.1/SDAT
P0.2 4 5 P2.2
[ 8-SOIC/SPDIP]
GC49C501RP-SO8I
GC49C501RP-SP8I
REM Output Output for IR LED drive Transistor. The transistor is n-channel device.
Address Space
9 Program memory : 1K Bytes.
[RAM Map]
Continuously addressed by Byte.
9 Indirect data memory : 64 Nibbles. 3FH
... Page 3
Bit accessible.
30H
9 Special function registers : 16 Registers.
2FH Stack Pointer (SP)
Directly addressed.
... Page 2 SPH SPL
9 Indirect function flags : 16 bits. 20H
Bit position is selected by DPL.
1FH DPH DPL
... Page 1 Data Pointer (DPTR)
10H
[Program Memory Map]
0FH
3FFH ... Page 0
... Internal FLASH 00H
... 1K Bytes
000H
08H P2 IAPCON GDL GDH STOP SLEEP WDTE WDTR MAP1 MAP0 P4.2 P4.3
00H P0 P4 DPL DPH P3.3 P3.2 P3.1 P3.0 P2.3 P2.2 P2.1 P2.0
Power-On Other
Register Address Description
Reset Value Reset Value
P0 00H Port 0 output register. 1111 1111
DPL 02H The low nibble of data pointer (DPTR). 0000 0000
DPH 03H The high nibble of data pointer (DPTR). --00 --00
SPL 06H The low nibble of stack pointer (SP). 1111 1111
SPH 07H The high nibble of stack pointer (SP). --01 --01
GDH 0BH The high nibble of general purpose data register 0000 0000
CKCFG 0DH The clock configuration register. Initialized only by power-on-reset. 0000 uuuu
IOCFG 0EH The I/O port configuration register. Initialized only by power-on-reset. 0000 uu0u
LVCFG 0FH The LVD configuration register. Initialized only by power-on-reset. 1x00 uxuu
Enable flag of WDT. If this flag is cleared, WDT stops running and holds the state.
WDTE 13 This flag can be modified if and only if MAP1 bit is set and MAP0 bit is cleared. 1
This flag is also set by H/W when user sets SLEEP flag or writes IAPCON SFR.
WDTR 12 Reset Watch Dog Timer. Set by S/W. Cleared by H/W after WDT is reset. 0
MAP0 10 Address map extension bit 0 for SFR/IFF. Do not set this flag for the future compatibility. 0
System Clock
CPU State S1 S2 S3 S4 S5 S6 S1 S2 S3 S4 S5 S6
Instruction
Op. Code (N-1) Op. Code (N)
Register
P2OEN
30 KΩ
30 KΩ
Q P0.1
CPU Write Q P2.1
P0.1 CPU Write
P2.1
SFR
SFR
QB
QB
CPU Read
CPU Read
CPU Write Q XO
IOMAP1 IOMAP0 Ports Mapping P4.1
SFR / P4.1
0 0 Default. QB
0 1 Optional 20-pin I/O Port Mapping
GC49C501G0-SO20IP
GC49C501R0-SO20IP
GC49C501R0-SO20IP
GC49C501G0-SJ20IP
GC49C501G0-SJ20IP
GC49C501R0-SJ20IP
GC49C501R0-SJ20IP
IOCFG[3:2] == 0 IOCFG[3:2] == 2
GC49C501G0-SO24IP
GC49C501R0-SO24IP
GC49C501R0-SO24IP
0 0 0 FOSC
z XT/RG : System clock source selection.
0 = Internal Ring oscillator is selected as system clock. 0 0 1 FOSC/2
External clock osc. is disabled. 0 1 0 FOSC/4
1 = External clock is selected as system clock.
Internal Ring oscillator is disabled. 0 1 1 FOSC/8
Do not set this bit for 8-pin devices. 1 0 0 FOSC/16
z DIV[2:0] : System clock divider selection.
1 0 1 FOSC/32
1 1 0 FOSC/64
Internal Clock
0
FOSC FSYS 1 1 1 -
Divider System Clock
External Clock 1
8.00 5.00
7.00
0.00
6.00
-5.00
5.00
4.00 -10.00
3.00
-15.00
2.00
-20.00
1.00
0.00 -25.00
5.5V
5.3V
5.1V
4.9V
4.7V
4.5V
4.3V
4.1V
3.9V
3.7V
3.5V
3.3V
3.1V
2.9V
2.7V
2.5V
2.3V
2.1V
1.9V
5.5V
5.3V
5.1V
4.9V
4.7V
4.5V
4.3V
4.1V
3.9V
3.7V
3.5V
3.3V
3.1V
2.9V
2.7V
2.5V
2.3V
2.1V
1.9V
VOLTAGE-FREQUENCY GRAPH
Ring
XI XI XI
OSC.
OSC
Support 7 types of carrier frequency. REME PG2 PG1 PG0 Transmission Control ( REMI )
0 X X X 0 (Disable)
1 1 1 1 1 (No Carrier)
I.R. LED
Drive Tr.
REM
FSYS Pulse REMI*
Generator
N-CH
T1
Waveform Example
9 REM output is the inverse of REMI*
9 Since the IR. LED drive transistor in ATOM is a N-Type, IR. LED is turned on when REMI* is high.
System Clock
(FSYS)
REME
REMI*
(FSYS/12, 1/3 Duty)
REMI*
(FSYS/8, 1/2 Duty)
REMI*
(FSYS/12, 1/4 Duty)
REMI*
(No Carrier)
REMI*
(FSYS/12, 1/2 Duty)
REMI*
(FSYS/8, 1/4 Duty)
REMI*
(FSYS/11, 4/11 Duty)
10 pF
3.3
VDD [V]
POR
A
1.7 STOP
B 1 MΩ
1.6
0 POR Reset
LVD_OFF
TIME
1.7V 1.6V LVD Pulse
LVD
LVD Pulse
Power-on Reset Power-fail Reset LVD-POR Block
Voltage
Power slope = 1.0 V / 1 us
VDD
Yellow Region : Only RC-POR operates.
Blue Region : Only LVD-POR operates.
Green Region : Both POR's operate at the same time.
time
VDD=2V
1V
0.5V
0V
time
T >10us T > 20us T > 40us
When VDD fails for a short time, the duration of notch (T) has limitation like
above for the successful POR operation.
The duration (T) will be changed by the VDD value and the transition time
ATOM1.0 Family [28]
6.9. WDT (Watchdog Timer) Preliminary
XT/RG DIV2 DIV1 DIV0 FOSC (MHz) FSYS WDT Period (ms)
0 0 0 0 7.28 FOSC 18
Reset Sources
9 Power-on Reset (POR) when Power-Up.
9 Power-fail Reset
9 STOP mode Wake-up by changes in input port P0 or P1.
9 WDT Overflow for abnormal condition or SLEEP mode.
9 Clock source change (State change of CKCFG[3]).
Device Reset Timer
9 Once set, internal reset remains high until the DRT (Device Reset Timer) is expired.
9 The reset time depends on the configuration of system clock in CKCFG SFR.
9 For an instance, the period for 212 is 9 ms when FSYS is 455 KHz.
9 Note that CKCFG is not affected by internal reset.
9 For power-on reset, the reset time is about 4.5 ms.
P0,P1
Changes to Low Wake-Up
STOP mode S Q Internal RESET
R
WDT Overflow DRT Time
FSYS
Counter Reset Out
XT/RG
Clock Change Device Reset
FOSC Timer (212)
Generation FSYS
Active Mode
9 CPU and peripheral are running.
Sleep Mode
9 Only WDT is running.
9 I/O ports hold the state before sleep mode.
9 Wake-up by WDT overflow.
9 The longest period of WDT overflow is 1.1 second when the internal RING clock is used.
9 Device is reset.
Stop Mode
9 All of the device function including external clock oscillator stops running.
9 I/O ports hold the state before stop mode.
9 Wake-up by input pin (P0, P1) changes.
9 Device is reset.
9 DPH / DPL : Least significant 6-bit address for IAP. 0 1 EEP1 (0x3C0 ~ 0x3FF)
9 GDH / GDL : 8-bit data buffer for read or write by 1 0 INFO (0x0 ~ 0x7)
IAP. 1 1 Reserved
9 IAPCON : IAP control SFR. Automatically cleared to
OPS1 OPS0 IAP Function
zero after IAP is done.
0 0 No operation
0 1 Byte Read
1 0 Byte Erase
1 1 Byte Write
Value
Parameter Symbol Pin Conditions Unit
Min. Typ. Max.
Input High
IIH All pins except XI, XO VIN = VDD -1 - +1 μA
Leakage Current
Value
Parameter Symbol Pin Conditions Unit
Min. Typ. Max.
External Input Width tINT P0, P1, P2, P3, P4 1.8 V ≤ VDD ≤ 5.5 V 12 - - FSYS
tINT
0.8VDD 0.8VDD
External Input to Port 0.2VDD 0.2VDD
tINT
[20-SOIC (Narrow)]
HD Dimension in Inches Dimension in mm
Symbol
Min. Nom. Max. Min. Nom. Max.
D
A - - 0.890 - - 2.25
A1 0.002 - - 0.05 - -
20 11 b 0.014 0.018 0.022 0.35 0.45 0.55
D - 0.450 - - 11.43 -
E 0.197 0.209 0.220 5.00 5.30 5.60
HD 0.492 0.500 0.510 12.50 12.70 12.95
20 pins E HE a HE 0.291 0.307 0.323 7.40 7.80 8.20
L 0.012 - 0.031 0.30 - 0.80
a 0̊ - 8̊ 0̊ - 8̊
L e 0.050 BSC 1.27 BSC
1 10
Notes:
A 1. Dimension D & E include mold mismatch and are determined at the mold
parting line.
Seating Plane A1 2. General appearance spec. should be based on final visual inspection spec.
b e
[20-SOIC (JEDEC)]
HD Dimension in Inches Dimension in mm
Symbol
Min. Nom. Max. Min. Nom. Max.
A - - 0.106 - - 2.7
A1 0.004 - - 0.1 - -
20 11
b 0.013 0.016 0.020 0.324 0.4 0.51
E 0.264 0.295 0.324 6.71 7.5 8.23
HD 0.495 0.504 0.512 12.57 12.8 13
HE 0.394 0.406 0.419 10.0 10.3 10.643
20 pins E HE a
L 0.016 - 0.052 0.406 - 1.32
a 0̊ - 8̊ 0̊ - 8̊
L e 0.050 BSC 1.27 BSC
1 10
Notes:
A 1. Dimension D & E include mold mismatch and are determined at the mold
parting line.
Seating Plane A1 2. General appearance spec. should be based on final visual inspection spec.
b e
[24-SOIC]
HD Dimension in Inches Dimension in mm
Symbol
Min. Nom. Max. Min. Nom. Max.
D
A 0.094 0.098 0.102 2.40 2.50 2.60
A1 0.004 0.008 0.012 0.10 0.20 0.30
20 11 b 0.014 0.017 0.019 0.36 0.42 0.49
D - 0.550 - - 13.97 -
E 0.291 0.295 0.299 7.40 7.50 7.60
HD 0.598 0.606 0.614 15.20 15.40 15.60
24 pins E HE a HE 0.398 0.406 0.413 10.10 10.30 10.50
L 0.004 0.010 0.016 0.10 0.25 0.40
a 0̊ - 8̊ 0̊ - 8̊
L e 0.050 BSC 1.27 BSC
1 10
Notes:
A 1. Dimension D & E include mold mismatch and are determined at the mold
parting line.
Seating Plane A1 2. General appearance spec. should be based on final visual inspection spec.
b e
[8-SPDIP]
Dimension in Inches Dimension in mm
D Symbol
Min. Nom. Max. Min. Nom. Max.
A - 0.155 - - 3.93 -
8 5
A1 0.015 - - 0.380 - -
c A2 - 0.140 - - 3.55 -
E1 8 pins B 0.015 0.019 0.022 0.38 0.47 0.56
B1 0.050 0.057 0.065 1.27 1.46 1.65
c 0.008 0.011 0.014 0.20 0.28 0.36
1 4 D 0.367 0.377 0.387 9.33 9.58 9.83
E - 0.299 - - 7.60 -
E1 0.240 0.250 0.260 6.10 6.35 6.60
e1 - 0.100 - - 2.54 -
E L 0.120 0.130 0.140 3.05 3.30 3.55
a 0̊ - 15 ̊ 0̊ - 15 ̊
A1 eA 0.330 0.350 0.370 8.382 8.89 9.398
A A2 Base Plane
Notes:
L Seating Plane 1. Dimension D Max. & S include mold flash or tie bar Burns.
2. Dimension E1 dose not include interlead flash.
e1 eA
3. Dimension D & E1 include mold mismatch and are determined at the mold
a parting line.
4. Dimension B1 does not include dambar protrusion/intrusion.
B 5. General appearance spec. should be based on final visual inspection spec.
B1
[8-SOIC]
HD Dimension in Inches Dimension in mm
Symbol
Min. Nom. Max. Min. Nom. Max.
D A 0.068 0.072 0.075 1.73 1.82 1.90
8 5 A1 0.004 0.007 0.010 0.10 0.18 0.26
b 0.012 0.016 0.020 0.31 0.41 0.51
D - 0.150 - - 3.81 -
8 pins E HE E 0.146 0.154 0.161 3.70 3.90 4.10
HD 0.185 0.193 0.201 4.70 4.90 5.10
a HE 0.224 0.236 0.248 5.70 6.00 6.30
1 4 L 0.017 0.026 0.035 0.42 0.65 0.88
a 0̊ - 8̊ 0̊ - 8̊
L e 0.050 BSC 1.27 BSC
Notes:
A 1. Dimension D & E include mold mismatch and are determined at the mold
parting line.
Seating Plane A1 2. General appearance spec. should be based on final visual inspection spec.
e
G C X X X X X X X X - X X X X X X X X
General Core Version
MCU Series 0-9 = Revision P = Pb-Free
P = Power position
Core Type
Temperature
4 = 4 bits
C = -20oC ~ 85oC
8 = 8 bits
I = -40oC ~ 85oC
16 = 16 bits
E = -40oC ~ 125oC
32 = 32 bits
ROM Type
0 = ROMless Package Pins
1 = Mask ROM
7 = EPROM Package Type
8 = EEPROM P = PDIP TS = TSSOP DF = DFN
9 = FLASH SP = SPDIP LQ = LQFP ML = MLF
PL = PLCC MQ = MQFP WL = WLCSP
SO = SOP/SOIC TQ = TQFP W = Wafer Biz.
Operating Voltage SS = SSOP CO = COB C = Chip Biz.
C = Common
(1.8V ~ 5.5V)
L = Low Voltage Custom ROM Code
(1.2V ~ 2.7V) Application (Option)
G = General
ROM Size A = ADC
320 = ROMless R = RCLK Calibration
500 = 2KB B = Battery
501 = 1KB L = LCD
510 = 4KB U = USB
520 = 8KB P = Printer
54X = 16KB E = Edu./Toy
58X = 32KB T = Telecom
59X = 64KB H = Home Application
Easy-to-Use GUI
User-Friendly
User-Friendly
Development
Development
Environment
Environment
ROM Writer
Application System
OPCODE Map
H L 0 1 2 3 4 5 6 7 8 9 A B C D E F
DEC
1 CLR C INC A ADD A, #data
A
2 MOV L, #data
3 MOV H, #data
6 MOV dir, A
7 MOV A, dir
MOV
MOV XCH MOV MOV MOVI
D CLR SETB
8 A, A, L, @DP, @DP, CLR bit SETB bit
@DP, @L @L
@DP @DP @DP A A
A
CJNE CJLE
DJNZ JNC
9 RET A,@D A,@D JC rel JNB bit, rel JB bit, rel
A, rel rel
P, rel P, rel
E JMP addr
F CALL addr
Description Adds the 4-bit data to the Accumulator. Description Simultaneously adds the contents of indirect
The result is stored in Accumulator. data memory, the carry flag and the
When adding unsigned integers, the carry flag Accumulator. The result is stored in
indicates an overflow. Accumulator.
When adding unsigned integers, the carry flag
Operation (A) ← (A) + #data indicates an overflow.
Carry Flag Set if a carry occurred, cleared otherwise. Operation (A) ← (A) + M[DP] + (C)
Bytes 1 Carry Flag Set if a carry occurred, cleared otherwise.
Cycles 1 Bytes 1
Example CLR A ; Clear ACC Cycles 1
ADD A, #2 ; Add 2 to ACC. ACC contains 2.
Example ; Assumes M[DP] contains 2 and C is 1.
ADD A, @DP MOV A, #8 ; Set ACC as 8.
ADDC A, @DP ; The result, 11 is stored in ACC.
Binary Code 0000 1000
Description ANL performs the bitwise logical-AND operation Description Unconditionally calls a subroutine located at the
between the indirect data memory and ACC. indicated 12-bit address. The instruction
The result is stored in Accumulator. increments the PC twice to obtain the address
of the following instruction, then push the
Operation (A) ← (A) & M[DP]
result onto the stack (low-order nibble first).
Carry Flag Not affected. The stack pointer is incremented three times.
The destination address is obtained by
Bytes 1 concatenating four low-order bits of the
Cycles 1 opcode byte and the second byte of the
instruction.
Example ; Assumes M[DP] contains 2
MOV A, #0xA ; Set ACC as 10. Operation (PC) ← (PC) + 2
ANL A, @DP ; The result, 2 is stored in ACC. (SP) ← (SP) + 1
M[SP] ← (PC3-0)
(SP) ← (SP) + 1
M[SP] ← (PC7-4)
(SP) ← (SP) + 1
M[SP] ← (PC11-8)
(PC) ← addr
Carry Flag Not affected.
Bytes 2
Cycles 2
Example CALL SUBR ; Call subroutine located
; at the label SUBR.
Description Compares the contents of ACC and the indirect Description Compares the contents of the indirect memory
memory, and branches if the value in ACC is and data in four low-order bits of opcode, and
less than or equal to that in memory. branches if their values are not equal.
The branch destination is computed by adding The branch destination is computed by adding
the signed relative-displacement in the the signed relative-displacement in the
second byte of the instruction to the PC, after second byte of the instruction to the PC, after
incrementing the PC to the start of the next incrementing the PC to the start of the next
instruction. The contents of both operands are instruction. The contents of indirect memory is
not affected by comparison. not affected.
The carry flag is set if the contents are equal. The carry flag is set if the unsigned integer
value of M[DP] is less than the unsigned
Operation (PC) ← (PC) + 2
integer value of the data; otherwise, the carry
IF (A) ≤ M[DP] THEN (PC) ← (PC) + rel is cleared.
Carry Flag IF (A) = M[DP] THEN (C) ← 1 Operation (PC) ← (PC) + 2
ELSE (C) ← 0.
IF M[DP] ≠ #data THEN (PC) ← (PC) + rel
Bytes 2
Carry Flag IF M[DP] < #data THEN (C) ← 1
Cycles 2 ELSE (C) ← 0.
Example ; Assumes M[DP] contains 11, ACC 5. Bytes 2
CJLE A, @DP, CMP_LE; Branches to CMP_LE
Cycles 2
...... ; IF (A) > M[DP]
CMP_LE: JC CMP_EQ ; Example ; Assumes M[DP] contains 2.
...... ; IF (A) < M[DP] CJNE @DP, #8, CMP_NE; Branches to CMP_NE
CMP_EQ: ...... ; IF (A) = M[DP] ...... ; IF M[DP] = 8
CMP_NE: JC CMP_LT ; Branches to CMP_LT
...... ; IF M[DP] > 8
CMP_LT: ...... ; IF M[DP] < 8
Description Compares the contents of Accumulator and Description Compares the contents of ACC and the indirect
data in four low-order bits of opcode, and memory, and branches if their values are not
branches if their values are not equal. equal.
The branch destination is computed by adding The branch destination is computed by adding
the signed relative-displacement in the the signed relative-displacement in the
second byte of the instruction to the PC, after second byte of the instruction to the PC, after
incrementing the PC to the start of the next incrementing the PC to the start of the next
instruction. The contents of ACC is not affected. instruction. The contents of both operands are
The carry flag is set if the unsigned integer not affected by comparison.
value of ACC is less than the unsigned The carry flag is set if the unsigned integer
integer value of the data; otherwise, the carry value of ACC is less than the unsigned
is cleared. integer value of M[DP]; otherwise, the carry is
cleared.
Operation (PC) ← (PC) + 2
IF (A) ≠ #data THEN (PC) ← (PC) + rel Operation (PC) ← (PC) + 2
IF (A) ≠ M[DP] THEN (PC) ← (PC) + rel
Carry Flag IF (A) < #data THEN (C) ← 1
ELSE (C) ← 0. Carry Flag IF (A) < M[DP] THEN (C) ← 1
ELSE (C) ← 0.
Bytes 2
Bytes 2
Cycles 2
Cycles 2
Example ; Assumes ACC contains 11.
CJNE A, #8, CMP_NE ; Branches to CMP_NE Example ; Assumes M[DP] and ACC contain 15.
...... ; IF (A) = 8 CJNE A, @DP, CMP_NE ; Branch is not taken.
CMP_NE: JC CMP_LT ; Branch is not taken. ...... ; IF (A) = M[DP]
...... ; IF (A) > 8 CMP_NE: JNC CMP_GT ; IF (A) ≠ M[DP]
CMP_LT: ...... ; IF (A) < 8 ...... ; IF (A) < M[DP]
CMP_GT: ...... ; IF (A) > M[DP]
Description Compares the contents of ACC and that of SFR Description Compares the contents of DPL and data in four
addressed by four low-order bits of opcode, and low-order bits of opcode, and branches if their
branches if their values are not equal. values are not equal.
The branch destination is computed by adding The branch destination is computed by adding
the signed relative-displacement in the the signed relative-displacement in the
second byte of the instruction to the PC, after second byte of the instruction to the PC, after
incrementing the PC to the start of the next incrementing the PC to the start of the next
instruction. The contents of both operands are instruction. The contents of DPL is not affected.
not affected by comparison. The carry flag is set if the unsigned integer
The carry flag is set if the unsigned integer value of DPL is less than the unsigned
value of ACC is less than the unsigned integer integer value of the data; otherwise, the carry
value of the SFR; otherwise, the carry is cleared. is cleared.
Operation (PC) ← (PC) + 2 Operation (PC) ← (PC) + 2
IF (A) ≠ R[dir] THEN (PC) ← (PC) + rel IF (L) ≠ #data THEN (PC) ← (PC) + rel
Carry Flag IF (A) < R[dir] THEN (C) ← 1 Carry Flag IF (L) < #data THEN (C) ← 1
ELSE (C) ← 0. ELSE (C) ← 0.
Bytes 2 Bytes 2
Cycles 2 Cycles 2
Example ; Wait until P0 (Port 0) is 0xE. Example ; Looping with DPL
MOV A, #0xE MOV L, #9 ; (L) ← 9
CJNE A, P0, . ; Self looping with "." LOOP_L: ...... ; Operations in loop
...... ; Operations in loop
DEC DPTR ; (DP) ← (DP) - 1
CJNE L, #0, LOOP_L ; Repeat until (L) is 0.
CLR @L CLR C
Binary Code 1000 0110 Binary Code 0001 0000
Description Clears the indirect function flag Description Clears the carry flag.
addressed by DPL. This is the same as "ADD A, #0".
Operation F[L] ← 0 Operation (A) ← (A) + 0
Carry Flag Not affected. Carry Flag (C) ← 0
Bytes 1 Bytes 1
Cycles 1 Cycles 1
Example ; Assumes P2 contains 0xF. Example CLR C
MOV L, #1 ; (L) ← 1
CLR @L ; P2.1 ← 0
MOV A, #0xD ; (A) ← 13
CJNE A, P2, ERROR ; Check if P2.1 is 0.
Description Clears the accumulator. Description Clears a bit in data memory addressed by
This is an abbreviation of MOV A, #0. DPTR. The bit position of the nibble is obtained
by the least significant two bits of opcode.
Operation (A) ← 0
Operation M[DP].bit ← 0
Carry Flag Not affected.
Carry Flag Not affected.
Bytes 1
Bytes 1
Cycles 1
Cycles 1
Example CLR A
Example ; Assumes M[DP] contains 7.
CLR 2 ; M[DP].2 ← 0
CJNE @DP, #3, ERROR ; Check result
ATOM1.0 Family [49]
Appendix A : Instruction Set (9/19) Preliminary
CPL A DEC A
Binary Code 0000 1010 Binary Code 0001 1111
Description Complements the contents of ACC. Description Decrements the contents of ACC.
Operation (A) ← ~(A) This is the same as "ADD A, #15".
Carry is cleared when the borrow occurs;
Carry Flag Not affected. otherwise, carry is set.
Bytes 1 Operation (A) ← (A) + 15
Cycles 1 Carry Flag IF (A) = 0 THEN C ← 0
Example MOV A, P0 ; (A) ← P0 ELSE C ← 1.
CPL A ; ACC contains 1's Bytes 1
; complement of P0
Cycles 1
Example DEC A
Description Decrements the value of data memory Description Decrements the data pointer.
addressed indirectly by DPTR. Operation (DP) ← (DP) - 1
Operation M[DP] ← M[DP] - 1 Carry Flag Not affected.
Carry Flag Not affected. Bytes 1
Bytes 1 Cycles 1
Cycles 1 Example ; Assumes DPTR contains 0.
Example DEC @DP DEC DPTR ; By underflow, all bits
; of DPH and DPL are set.
DEC DP ; This is also valid.
Description Decrements the contents of ACC, and Description Increments the value of data memory
branches if the result is not zero. addressed indirectly by DPTR.
The branch destination is computed by adding
the signed relative-displacement in the Operation M[DP] ← M[DP] + 1
second byte of the instruction to the PC, after Carry Flag Not affected.
incrementing the PC to the start of the next
instruction. Bytes 1
Carry is cleared when the borrow occurs; Cycles 1
otherwise, carry is set. Example INC @DP
Operation (PC) ← (PC) + 2
(A) ← (A) - 1
IF (A) ≠ 0 THEN (PC) ← (PC) + rel INC A
Description Increments the data pointer. Description Branches if the bit in data memory is 1. The
address is given by DPTR and bit position is
Operation (DP) ← (DP) + 1 given by two least significant bits of opcode .
Carry Flag Not affected. The branch destination is computed by adding
the signed relative-displacement in the
Bytes 1
second byte of the instruction to the PC, after
Cycles 1 incrementing the PC to the start of the next
instruction. The contents of memory is not
Example ; Assumes all bits of DPTR is 1. affected.
INC DPTR ; By roll over, all bits
; of DPH and DPL are cleared. Operation (PC) ← (PC) + 2
INC DP ; This is also valid. IF M[DP].bit = 1 THEN (PC) ← (PC) + rel
Carry Flag Not affected.
Bytes 2
Cycles 2
Example JB 0, L_BIT_SET
...... ; IF M[DP].0 = 0
L_BIT_SET: ...... ; IF M[DP].0 = 1
Description Branches if the carry flag is 1. Description Transfers program execution to the indicated
The branch destination is computed by adding 12-bit address.
the signed relative-displacement in the The destination address is obtained by
second byte of the instruction to the PC, after concatenating the four low-order bits of the
incrementing the PC to the start of the next opcode byte and the second byte of the
instruction. instruction.
Operation (PC) ← (PC) + 2 Operation (PC) ← addr
IF (C) = 1 THEN (PC) ← (PC) + rel
Carry Flag Not affected.
Carry Flag Not affected.
Bytes 2
Bytes 2
Cycles 2
Cycles 2
Example JMP LABEL ; Jumps to LABEL.
Example JC L_C_SET ......
...... ; IF (C) = 0 JMP . ; Infinite loop
L_C_SET: ...... ; IF (C) = 1
Description Branches if the bit in data memory is 0. Description Branches if the carry flag is 0.
The address of memory is given by DPTR and The branch destination is computed by adding
bit position is given by two least significant bits the signed relative-displacement in the
of opcode . second byte of the instruction to the PC, after
The branch destination is computed by adding incrementing the PC to the start of the next
the signed relative-displacement in the instruction.
second byte of the instruction to the PC, after Operation (PC) ← (PC) + 2
incrementing the PC to the start of the next
instruction. The contents of memory is not IF (C) = 0 THEN (PC) ← (PC) + rel
affected. Carry Flag Not affected.
Operation (PC) ← (PC) + 2 Bytes 2
IF M[DP].bit = 0 THEN (PC) ← (PC) + rel
Cycles 2
Carry Flag Not affected.
Example JNC L_C_ZERO
Bytes 2 ...... ; IF (C) = 1
Cycles 2 L_C_ZERO: ...... ; IF (C) = 0
Description The contents of ACC is copied to data memory Description Copies the contents of data memory to ACC.
whose address is given by DPTR. The address of memory is given by DPTR.
Operation M[DP] ← (A) Operation (A) ← M[DP]
Carry Flag Not affected. Carry Flag Not affected.
Bytes 1 Bytes 1
Cycles 1 Cycles 1
Example MOV H, #2 ; (H) ← 2 Example MOV H, #1 ; (H) ← 1
MOV L, #14 ; (L) ← 14 MOV L, #0 ; (L) ← 0
MOV @DP, A MOV A, @DP
Description Sets ACC with the data given Description The contents of SFR is copied to ACC.
in four low-order bits of opcode. The address of SFR is given by four low-order
bits of opcode.
Operation (A) ← #data
Operation (A) ← R[dir]
Carry Flag Not affected.
Carry Flag Not affected.
Bytes 1
Bytes 1
Cycles 1
Cycles 1
Example MOV A, #-1 ; (A) ← 15
MOV A, #0xC ; (A) ← 12 Example MOV A, P0 ; Read Port-0 into ACC.
MOV A, L ; Move DPL to ACC.
MOV A, SPH ; Move SPH to ACC.
Description Sets DPH with the data given Description Copies the contents of data memory to DPL.
in four low-order bits of opcode. The address of memory is given by DPTR.
Bytes 1 Bytes 1
Cycles 1 Cycles 1
Description Sets DPL with the data given Description The contents of ACC is copied to SFR.
in four low-order bits of opcode. The address of SFR is given by four low-order
bits of opcode.
Operation (L) ← #data
Operation R[dir] ← (A)
Carry Flag Not affected.
Carry Flag Not affected.
Bytes 1
Bytes 1
Cycles 1
Cycles 1
Example MOV L, #5 ; (L) ← 5
Example MOV P0, A ; Output ACC to Port-0.
MOV H, A ; Move ACC to DPH.
MOV DPH, A ; Move ACC to DPH.
MOV SPL, A ; Move ACC to SPL.
Description The contents of ACC is copied to data memory Description Set data memory whose address is given by
whose address is given by DPTR. After that the DPTR with the data given in four low-order bits
data pointer is decremented. of opcode. After that the data pointer is
incremented.
Operation M[DP] ← (A)
(DP) ← (DP) - 1 Operation M[DP] ← #data
(DP) ← (DP) + 1
Carry Flag Not affected.
Carry Flag Not affected.
Bytes 1
Bytes 1
Cycles 1
Cycles 1
Example MOVD @DP, A
Example ; Simple look-up of constant values
MOV L, #0 ; Pointer to store
MOVI @DP, A MOV H, #1 ; look-up values
CALL TABLE
Binary Code 1000 0100
.....
Description The contents of ACC is copied to data memory TABLE: MOVI @DP, #0xC
whose address is given by DPTR. After that the
MOVI @DP, #0x0
data pointer is incremented.
MOVI @DP, #0x0
Operation M[DP] ← (A) MOVI @DP, #0x1
(DP) ← (DP) +1 RET
Carry Flag Not affected.
Bytes 1
Cycles 1
Example MOVI @DP, A
RET RRC A
Binary Code 1001 0000 Binary Code 0000 1111
Description Returns from subroutine. Description Rotates right the contents of ACC with the carry
The stack pointer is decremented three times. flag.
Bytes 1
SETB @L
Cycles 2
Binary Code 1000 0111
Example RET
Description Sets the indirect function flag
addressed by DPL.
Operation Cycles 1
Description Sets a bit in data memory indirectly addressed Description Exchanges the contents of ACC and that of
by DPTR. The bit position is obtained at the data memory addressed by DPTR.
least significant two bits of opcode.
Operation (A) ↔ M[DP]
Operation M[DP].bit ← 1
Carry Flag Not affected.
Carry Flag Not affected.
Bytes 1
Bytes 1
Cycles 1
Cycles 1
Example XCH A, @DP
Example ; Assumes M[DP] contains 5.
SETB 2 ; M[DP].2 ← 1
CJNE @DP, #7, ERROR ; Check result
Description Subtracts the contents of indirect data memory Description XRL performs the bitwise logical Exclusive-OR
from the Accumulator. The result is stored in operation between the indirect data memory
Accumulator. The carry flag is cleared if the and ACC. The result is stored in Accumulator.
unsigned value of ACC is less than unsigned
value of M[DP]; otherwise, C is set. Operation (A) ← (A) ^ M[DP]
[How to Read a SFR Descriptions] DPH (03h) : The High Nibble of Data Pointer (DPTR)
R : Unrestricted Read
W : Unrestricted Write REMC (05h) : The REM Output Control Register
(n) : Reset Value
REME PG2 PG1 PG0
R/W(1) R/W(1) R/W(1) R/W(1) SPL (06h) : The Low Nibble of Stack Pointer (SP)
SP.3 SP.2 SP.1 SP.0
P4 (01h) : Port 4 Output Register
R/W(1) R/W(1) R/W(1) R/W(1)
P4.3 P4.2 P4.1 P4.0
Indicate where stack will start.
R/W(1) R/W(1) R/W(1) R/W(1)
Increment by PUSH and decrement by POP.
IAPCON (09h) : IAP Control Register CKCFG (0Dh) : The Clock Configuration Register
RGS1 RGS0 OPS1 OPS0 XT/RG DIV2 DIV1 DIV0
V1.0 V1.6
9 First Official Release 9 Add 20-SOIC (JEDEC) Package
9 Modify Package Dimensions
V1.1 9 Now POR block has no limitation for the power
9 Modify Internal Ring Spec. rising slope.
9 Add Internal Ring OSC. Slide
V1.2
9 Modify Operating frequency
V1.3
9 Added GC49C501RX devices.
9 Description for POR condition.
9 LVOFF flag is not supported any more.
V1.4
9 Modify Internal Ring Spec.
9 Add E.S.D. Spec.
V1.5
9 Enhanced description for 8-pin devices.
9 Optional power-fail reset is not supported any
more.