AT8A53D v1.6 200320
AT8A53D v1.6 200320
AT8A53D v1.6 200320
ec
-T
TW
h
A
ec
AT8A53D
-T
12 I/O 8-bit EPROM-Based MCU
TW
h
A
ec
-T
Version 1.6
TW
ATW TECHNOLOGY CO. reserves the right to change this document without prior notice. Information provided by ATW is believed to be accurate and reliable. However, ATW
makes no warranty for any errors which may appear in this document. Contact ATW to obtain the latest version of device specifications before placing your orders. No
responsibility is assumed by ATW for any infringement of patent or other rights of third parties which may result from its use. In addition, ATW products are not authorized for
use as critical components in life support devices/systems or aviation devices/systems, where a malfunction or failure of the product may reasonably be expected to result in
significant injury to the user, without the express written approval of ATW.
A
ATW
h
AT8A53D
ec
Revision History
-T
Version Date Description Modified Page
1.1
1.2
2016/11/15
2017/05/23
W
1. Add the description to Pin Description.
2. Modify Table 16 Configuration Words.
68
1.3 2017/11/15 Modify Table 14 Summary of /TO & /PD Value and its Associated Event. 50
h
A
1.5 2018/07/20
ec
2. Update the DC Characteristics table.
12
64
2. Update RLR instruction description.
-T
1.6 2020/03/20 Add OSC Characteristics. 71
T W
h
A
ec
-T
TW
h
AT8A53D
ec
Table of Contents
-T
1. 概述 ······················································································································· 6
1.1 功能 ·························································································································· 6
h
A
h
AT8A53D
ec
3.3.3 PS0CV (Prescaler0 Counter Value Register) ······································································ 23
3.3.4 BODCON (PortB Open-Drain Control Register) ··································································· 23
-T
3.3.5 PCON1 (Power Control Register1) ··················································································· 23
3.4 S-page Special Function Register ·················································································· 24
3.4.1 TMR1 (Timer1 Register)································································································· 24
3.4.2 T1CR1 (Timer1 Control Register1) ··················································································· 24
3.4.3
3.4.4
3.4.5
W
T1CR2 (Timer1 Control Register2) ··················································································· 25
PWM1DUTY (PWM1 Duty Register) ················································································· 26
PS1CV (Prescaler1 Counter Value Register) ······································································ 26
T
3.4.6 BZ1CR (Buzzer1 Control Register) ··················································································· 26
3.4.7 IRCR (IR Control Register) ····························································································· 27
h
A
3.4.8 TBHP (Table Access High Byte Address Pointer Register) ···················································· 28
3.4.9
ec
TBHD (Table Access High Byte Data Register) ··································································· 28
3.4.10 OSCCR (Oscillation Control Register) ··············································································· 29
3.5 I/O Port···················································································································· 29
-T
3.5.1 Block Diagram of IO Pins ······························································································· 31
3.6 Timer0····················································································································· 38
3.7 Timer1/PWM1/Buzzer1 ······························································································· 39
W
h
AT8A53D
ec
3.13 Reset Process··········································································································· 50
-T
5. Configuration Words ······························································································ 68
h
A
6.4.2 Frequency vs. Temperature of I_HRC ··············································································· 71
6.4.3 Frequency vs. VDD of I_LRC ···························································································· 72
6.4.4 ec
Frequency vs. Temperature of I_LRC················································································ 72
6.5 Recommended Operating Voltage ················································································· 72
6.6 LVR vs. Temperature ·································································································· 73
-T
7. Die Pad Diagram ···································································································· 73
8. Package Dimension································································································ 74
W
ec
-T
TW
h
AT8A53D
ec
1. 概述
AT8A53D是以EPROM作為記憶體的 8 位元微控制器,專為多IO產品的應用而設計,例如遙控器、風扇/燈光控制或
-T
是遊樂器周邊等等。採用CMOS製程並同時提供客戶低成本、高性能等顯著優勢。AT8A53D核心建立在RISC精簡指
令集架構可以很容易地做編輯和控制,共有 55 條指令。除了少數指令需要 2 個時序,大多數指令都是 1 個時序即能
完成,可以讓使用者輕鬆地以程式控制完成不同的應用。因此非常適合各種中低記憶容量但又複雜的應用。
W
在I/O的資源方面,AT8A53D有 12 根彈性的雙向I/O腳,每個I/O腳都有單獨的暫存器控制為輸入或輸出腳。而且每一
個I/O腳位都有附加的程式控制功能如上拉或下拉電阻或開漏極(Open-Drain) 輸出。此外針對紅外線搖控的產品方
面,AT8A53D內建了可選擇頻率的紅外載波發射口。
T
AT8A53D有兩組計時器,可用系統頻率當作一般的計時的應用或者從外部訊號觸發來計數。另外AT8A53D提供 1 組
8 位元解析度的PWM輸出或者蜂鳴器輸出,可用來驅動馬達、LED、或蜂鳴器等等。
h
A
AT8A53D採用雙時鐘機制,高速振盪或者低速振盪都可以分別選擇內部RC振盪或外部Crystal輸入。在雙時鐘機制
下,AT8A53D可選擇多種工作模式如正常模式(Normal)、慢速模式(Slow mode)、待機模式(Standby mode) 與睡眠
ec
模式(Halt mode)可節省電力消耗延長電池壽命。並且微控制器在使用內部RC高速振盪時,低速振盪可以同時使用外
部精準的Crystal計時。可以維持高速處理同時又能精準計算真實時間。
1.1 功能
W
寬廣的工作温度:-40°C ~ 85°C。
h
1Kx14 bits EPROM。
A
64 bytes SRAM。
ec
12 根可分別單獨控制輸入輸出方向的I/O腳(GPIO)、PA[3:0]、PB[7:0]。
PA[3:0]及PB[3:0]可選擇輸入時使用內建下拉電阻。
PB[7:4]及PB[2:0]可選擇上拉電阻或開漏極輸出(Open-Drain)。
-T
PB[3]可選擇當作輸入或開漏極輸出(Open-Drain)。
8 層程式堆棧(Stack)。
TW
存取資料有直接或間接定址模式。
一組 8 位元上數計時器(Timer0)包含可程式化的頻率預除線路。
一組 8 位元下數計時器(Timer1)可選重複載入或連續下數計時。
一個 8 位元的脈衝寬度調變輸出(PWM1)。
h
AT8A53D
ec
一個蜂鳴器輸出(BZ1)。
38/57KHz紅外線載波頻率可供選擇,同時載波之極性也可以根據數據作選擇。
-T
紅外線載波發射口。
內建上電復位電路(POR)。
內建低壓復位功能(LVR)。
W
內建看門狗計時(WDT),可由程式韌體控制開關。
雙時鐘機制,系統可以隨時切換高速振盪或者低速振盪。
高速振盪: E_HXT (超過 6MHz外部高速石英振盪)
T
E_XT (455K~6MHz外部石英振盪)
I_HRC (1~20MHz內部高速RC振盪)
h
A
低速振盪: E_LXT (32KHz外部低速石英振盪)
I_LRC (內部 32KHz低速RC振盪)
ec
四種工作模式可隨系統需求調整電流消耗:正常模式(Normal)、慢速模式(Slow mode)、待機模式(Standby
mode) 與 睡眠模式(Halt mode)。
五種硬體中斷:
-T
Timer0 溢位中斷。
Timer1 借位中斷。
WDT 中斷。
W
PB 輸入狀態改變中斷。
外部中斷輸入。
AT8A53D在待機模式(Standby mode)下的五種喚醒中斷:
T
Timer0 溢位中斷。
Timer1 借位中斷。
h
WDT 中斷。
A
PB 輸入狀態改變中斷。
ec
外部中斷輸入。
AT8A53D在睡眠模式(Halt mode)下的三種喚醒中斷:
WDT 中斷。
-T
PB 輸入狀態改變中斷。
外部中斷輸入。
TW
h
AT8A53D
ec
1. General Description
AT8A53D is an EPROM based 8-bit MCU tailored for I/O based applications like remote controllers, fan/light
-T
controller, game controllers, toy and various controllers.AT8A53D adopts advanced CMOS technology to provide
customers remarkable solution with low cost and high performance. RISC architecture is applied to AT8A53D and it
provides 55 instructions. All instructions are executed in single instruction cycle except program branch and skip
instructions which will take two instruction cycles. Therefore, AT8A53D is very suitable for those applications that are
W
sophisticated but compact program size is required.
As AT8A53D address I/O type applications, it can provide 12 I/O pins for applications which require abundant input
and output functionality. Moreover, each I/O pin may have additional features, like Pull-High/Pull-Low resistor and
T
open-drain output type through programming. Moreover, AT8A53D has built-in infrared (IR) carrier generator with
selectable IR carrier frequency and polarity for applications which demand remote control feature.
h
A
AT8A53D also provides 2 sets of timers which can be used as regular timer based on system oscillation or event
ec
counter with external trigger clock. Moreover, AT8A53D provides 1 set of 8-bit resolution Pulse Width Modulation
(PWM) output and buzzer output in order to drive motor/LED and buzzer.
AT8A53D employs dual-clock oscillation mechanism, either high oscillation or low oscillation can be derived from
-T
internal resistor/capacitor oscillator or external crystal oscillator. Moreover, based on dual-clock mechanism,
AT8A53D provides kinds of operation mode like Normal mode, Slow mode, Standby mode and Halt mode in order to
save power consumption and lengthen battery operation life. Moreover, it is possible to use internal high-frequency
W
oscillator as CPU operating clock source and external 32KHz crystal oscillator as timer clock input, so as to accurate
count real time and maintain CPU working power.
While AT8A53D operates in Standby mode and Halt mode, kinds of event will issue interrupt requests and can
wake-up AT8A53D to enter Normal mode and Slow mode in order to process urgent events.
T
h
A
1.1 Features
Wide operating voltage range: (@ 4 CPU clock per instruction, i.e. 4T mode)
ec
1K x 14 bits EPROM.
64 bytes SRAM.
TW
12 general purpose I/O pins (GPIO), PA[3:0], PB[7:0], with independent direction control.
PA[3:0] and PB[3:0] have features of Pull-Low resistor for input pin.
PB[7:4] and PB[2:0] have features of Pull-High resistor, and open-drain output.
h
AT8A53D
ec
8-level hardware Stack.
-T
One 8-bit up-count timer (Timer0) with programmable prescaler.
W
One buzzer (BZ1) output.
Selectable 38/57KHz IR carrier frequency and high/low polarity according to data value.
h
A
Dual-clock oscillation: System clock can switch between high oscillation and low oscillation.
ec
High oscillation: E_HXT (External High Crystal Oscillator, above 6MHz)
E_XT (External Crystal Oscillator, 455K~6MHz)
I_HRC (Internal High Resistor/Capacitor Oscillator ranging from 1M~20MHz)
-T
Low oscillation: E_LXT (External Low Crystal Oscillator, about 32KHz)
I_LRC (Internal 32KHz oscillator)
External interrupt.
ec
h
AT8A53D
ec
1.2 Block Diagram
-T
T W
h
A
ec
-T
W
h
A
ec
-T
TW
h
AT8A53D
ec
1.4 Pin Description
-T
PA0 ~ PA3 I/O Bidirectional I/O pins.
h
PWM1/ BZ1/ SCK PB2 is output of PWM signal by configuration words.
A
PB4 is a bidirectional I/O pin if I_HRC and I_LRC are adopted. PB4 also can be
PB4/ Xout I/O output of instruction clock.
PB4 is output of external crystal if E_HXT, E_XT or E_LXT is adopted.
W
VSS - Ground.
ec
-T
TW
h
AT8A53D
ec
2. Memory Organization
AT8A53D memory is divided into two categories: one is program memory and the other is data memory.
-T
2.1 Program Memory
The program memory space of AT8A53D is 1K words. Therefore, the Program Counter (PC) is 10-bit wide in
W
order to address any location of program memory.
Some locations of program memory are reserved as interrupt entrance. Power-On Reset vector is located at
0x000. Software interrupt vector is located at 0x001. Internal and external hardware interrupt vector is located at
T
0x008.
AT8A53D provides instruction CALL, GOTOA, CALLA to address 256 location of program space. AT8A53D
h
A
provides instruction GOTO to address 512 location of program space. AT8A53D also provides instructions
LCALL and LGOTO to address any location of program space.
ec
When a call or interrupt is happening, next ROM address is written to top of the stack, when RET, RETIA or
RETIE instruction is executed, the top of stack data is read and load to PC.
-T
AT8A53D program ROM address 0x3FE~0x3FF are reserved space, if user tries to write code in these
addresses will get unexpected false functions.
AT8A53D program ROM address 0x00E~0x00F are preset rolling code can be released and used as normal
W
program space.
T
h
A
ec
-T
TW
h
AT8A53D
ec
2.2 Data Memory
According to instructions used to access data memory, the data memory can be divided into three kinds of
-T
categories: one is R-page Special-function Register (SFR) + General Purpose Register (GPR), another is
F-page SFR and the other is S-page SFR. GPR are made of SRAM and user can use them to store variables or
intermediate results.
R-page data memory is divided into 4 banks and can be accessed directly or indirectly through a SFR register
banks.
W
which is File Select Register (FSR). FSR[7:6] are used as Bank register BK[1:0] to select one bank out of the 4
R-page register can be divided into addressing mode: direct addressing mode and indirect addressing mode.
T
The indirect addressing mode of data memory access is described in the following graph. This indirect
h
addressing mode is implied by accessing register INDF. The bank selection is determined by FSR[7:6] and the
A
ec
-T
W
The direct addressing mode of data memory access is described below. The bank selection is determined by
h
A
h
AT8A53D
ec
R-page SFR can be accessed by general instructions like arithmetic instructions and data movement
instructions. The R-page SFR occupies address from 0x0 to 0xF of Bank 0. However, the same address range
of Bank 1, Bank 2 and Bank 3 are mapped back to Bank 0. In other words, R-page SFR physically existed at
-T
Bank 0. The GPR physically occupy address from 0x10 to 0x3F of Bank 0 and 0x10 to 0x1F of Bank 1. Other
banks in address from 0x10 to 0x3F are mapped back as the Table 1 shows.
The AT8A53D register name and address mapping of R-page SFR are described in the following table.
Address
FSR[7:6]
0x0
T W 00
(Bank 0)
INDF
01
(Bank 1)
10
(Bank 2)
11
(Bank 3)
0x1 TMR0
h
0x2 PCL
A
0x3 STATUS
0x4
0x5
0x6
ec FSR
PORTA
PORTB
-T
0x7 -
The same mapping as Bank 0
0x8 PCON
0x9 BWUCON
W
0xA PCHBUF
0xB ABPLCON
0xC BPHCON
0xD -
T
0xE INTE
0xF INTF
h
A
F-page SFR can be accessed only by instructions IOST and IOSTR. S-page SFR can be accessed only by
TW
instructions SFUN and SFUNR. FSR[7:6] bank select bits are ignored while F-page and S-page register is
accessed. The register name and address mapping of F-page and S-page are depicted in the following table.
h
AT8A53D
ec
SFR Category
F-page SFR S-page SFR
Address
-T
0x0 - TMR1
0x1 - T1CR1
0x2 - T1CR2
0x3 - PWM1DUTY
0x4
0x5
0x6
T W -
IOSTA
IOSTB
PS1CV
BZ1CR
IRCR
0x7 - TBHP
0x8 - TBHD
h
A
0x9 - -
0xA PS0CV -
0xB
0xC
0xD
ec -
BODCON
-
-
-
-
-T
0xE - -
0xF PCON1 OSCCR
h
A
ec
-T
TW
h
AT8A53D
ec
3. Function Description
This chapter will describe the detailed operations of AT8A53D.
-T
3.1 R-page Special Function Register
3.1.1 INDF (Indirect Addressing Register)
Name
INDF
SFR Type
R W
R/W Property
Initial Value
T Addr.
0x0
Bit7 Bit6 Bit5 Bit4
INDF[7:0]
R/W
xxxxxxxx
Bit3 Bit2 Bit1 Bit0
The register INDF is not physically existed and it is used as indirect addressing mode. Any instruction
accessing INDF actually accesses the register pointed by register FSR
h
A
3.1.2
TMR0
ec
TMR0 (Timer0 Register)
Name SFR Type
R
Addr.
0x1
Bit7 Bit6 Bit5 Bit4
TMR0[7:0]
Bit3 Bit2 Bit1 Bit0
-T
R/W Property R/W
Initial Value xxxxxxxx
When read the register TMR0, it actually read the current running value of Timer0.
W
Write the register TMR0 will change the current value of Timer0.
Timer0 clock source can be from instruction clock FINST, or from external pin EX_CKI, or from Low Oscillator
Frequency according to T0MD and configuration word setting.
T
Name SFR Type Addr. Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0
PCL R 0x2 PCL[7:0]
ec
The register PCL is the least significant byte (LSB) of 10-bit PC. PCL will be increased by one after one
-T
instruction is executed except some instructions which will change PC directly. The high byte of PC, i.e.
PC[9:8], is not directly accessible. Update of PC[9:8] must be done through register PCHBUF.
For GOTO instruction, PC[8:0] is from instruction word and PC[9] is loaded from PCHBUF[1]. For CALL
TW
instruction, PC[7:0] is from instruction word and PC[9:8] is loaded from PCHBUF[1:0]. Moreover the next PC
address, i.e. PC+1, will push onto top of Stack. For LGOTO instruction, PC[9:0] is from instruction word.
For LCALL instruction, PC[9:0] is from instruction word. Moreover the next PC address, i.e. PC+1, will push
onto top of Stack.
h
AT8A53D
ec
3.1.4 STATUS (Status Register)
Name SFR Type Addr. Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0
-T
STATUS R 0x3 GP7 GP6 GP5 /TO /PD Z DC C
R/W Property R/W R/W R/W R/W(*2) R/W(*1) R/W R/W R/W
Initial Value 0 0 0 1 1 X X X
The register STATUS contains result of arithmetic instructions and reasons to cause reset.
C: Carry/Borrow bit W
C=1, carry is occurred for addition instruction or borrow is not occurred for subtraction instruction.
C=0, carry is not occurred for addition instruction or borrow is occurred for subtraction instruction.
T
DC: Half Carry/half Borrow bit
DC=1, carry from the 4th LSB is occurred for addition instruction or borrow from the 4th LSB is not
h
A
Z: Zero bit
ec
occurred for subtraction instruction.
BK[1:0]: Bank register used to select one specific bank of data memory. BK[1:0]=00b, Bank 0 is selected.
BK[1:0]=01b, Bank 1 is selected. BK[1:0]=10b, Bank 2 is selected. BK[1:0]=11b, Bank 3 is
selected.
h
AT8A53D
ec
3.1.6 PortA (PortA Data Register)
Name SFR Type Addr. Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0
-T
PortA R 0x5 GP7 GP6 GP5 GP4 PA3 PA2 PA1 PA0
R/W Property R/W
Initial Value Data latch value is xxxx, read value is xxxx port value(PA3~PA0)
While reading PortA, it will get the status of pins of PA regardless that pin is configured as input or output pin.
W
While writing to PortA, data is written to PA’s data latch.
h
A
PortB R 0x6 PB7 PB6 PB5 PB4 PB3 PB2 PB1 PB0
ec
R/W Property
Initial Value
R/W
Data latch value is xxxxxxxx, read value is xxxxxxxx port value(PB7~PB0)
While reading PortB, it will get the status of pins of PB regardless that pin is configured as input or output pin.
-T
While writing to PortB, data is written to PB’s data latch.
Name SFR Type Addr. Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0
PCON R 0x8 WDTEN EIS GP5 GP4 LVREN GP2 GP1 GP0
R/W Property R/W
Initial Value 1 0 0 0 1 0 0 0
T
h
AT8A53D
ec
3.1.9 BWUCON (PortB Wake-up Control Register)
SFR
Name Addr. Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0
Type
-T
BWUCON R 0x9 WUPB7 WUPB6 WUPB5 WUPB4 WUPB3 WUPB2 WUPB1 WUPB0
R/W Property R/W R/W R/W R/W R/W R/W R/W R/W
Initial Value 1 1 1 1 1 1 1 1
W
WUPBx: Enable/disable PBx wake-up function, 0 ≤ x ≤ 7.
WUPBx=1, enable PBx wake-up function.
WUPBx=0, disable PBx wake-up function.
T
3.1.10 PCHBUF (High Byte of PC)
h
Name SFR Type Addr. Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0
A
ec
R/W Property
Initial Value
-
X
3 2 1 0 3 2 1 0
R/W Property R/W
Initial Value 1 1 1 1 1 1 1 1
h
A
h
AT8A53D
ec
3.1.12 BPHCON (PortB Pull-High Resistor Control Register)
SFR
Name Addr. Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0
Type
-T
/PHPB5 /PHPB4
BPHCON R 0xC /PHPB7 /PHPB6 GP3 /PHPB2 /PHPB1 /PHPB0
(*1) (*1)
R/W Property R/W
Initial Value 1 1 1 1 1 1 1 1
W
/PHPBx: Disable/enable PBx Pull-High resistor, 0 ≤ x ≤ 7.
/PHPBx=1, disable PBx Pull-High resistor.
/PHPBx=0, enable PBx Pull-High resistor.
T
GP3: General read/write register bit.
Note: When PB4 and PB5 are used as crystal oscillator pads, the Pull-High resistor should not be
h
A
ec
3.1.13 INTE (Interrupt Enable Register)
Name SFR Type Addr. Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0
-T
INTE R 0xE - WDTIE - - T1IE INTIE PBIE T0IE
R/W Property - R/W - - R/W R/W R/W R/W
Initial Value X 0 X X 0 0 0 0
h
AT8A53D
ec
3.1.14 INTF (Interrupt Flag Register)
Name SFR Type Addr. Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0
-T
INTF R 0xF - WDTIF - - T1IF INTIF PBIF T0IF
R/W Property - R/W - - R/W R/W R/W R/W
Initial Value(note*) 0 0 0 0 0 0 0 0
W
T0IF=1, Timer0 overflow interrupt is occurred.
T0IF must be clear by firmware.
PBIF: PortB input change interrupt flag bit.
T
PBIF=1, PortB input change interrupt is occurred.
PBIF must be clear by firmware.
h
A
PS0SEL[2:0]: Prescaler0 dividing rate selection. The rate depends on Prescaler0 is assigned to Timer0 or
-T
WDT. When Prescaler0 is assigned to WDT, the dividing rate is dependent on which timeout
mechanism is selected.
Dividing Rate
PS0SEL[2:0]
TW
h
AT8A53D
ec
011 1:16 1:8 1:16
100 1:32 1:16 1:32
101 1:64 1:32 1:64
-T
110 1:128 1:64 1:128
111 1:256 1:128 1:256
W
PS0WDT: Prescaler0 assignment.
PS0WDT=1, Prescaler0 is assigned to WDT.
PS0WDT=0, Prescaler0 is assigned to Timer0.
Note: Always set PS0WDT and PS0SEL[2:0] before enabling watchdog or timer interrupt, or reset or
T
interrupt may be falsely triggered.
h
T0CE: Timer0 external clock edge selection.
A
T0CE=1, Timer0 will increase one while high-to-low transition occurs on pin EX_CKI.
ec
T0CE=0, Timer0 will increase one while low-to-high transition occurs on pin EX_CKI.
Note: T0CE is also applied to Low Oscillator Frequency as timer0 clock source condition.
INTEDG=1, INTIF will be set while rising edge occurs on pin PB0.
INTEDG=0, INTIF will be set while falling edge occurs on pin PB0.
LCKTM0: When T0CS=1, timer 0 clock source can be optionally selected to be low-frequency oscillator.
T
T0CS=1, LCKTM0=1, Low Oscillator Frequency (I_LRC or E_LXT, depends on configuration word
Low Oscillator Frequency) output replaces pin EX_CKI as timer0 clock source.
ec
Note: For more detail descriptions of timer0 clock source select, please see timer0 section.
h
AT8A53D
ec
IOPAx: PAx I/O mode selection, 0 ≤ x ≤ 3.
IOPAx=1, PAx is input mode.
IOPAx=0, PAx is output mode.
-T
3.3.2 IOSTB (PortB I/O Control Register)
Name SFR Type Addr. Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0
IOSTB F
R/W Property
W
Initial Value
T 0x6 IOPB7
R/W
1
IOPB6
R/W
1
IOPB5
R/W
1
IOPB4
R/W
1
IOPB3
R/W
1
IOPB2
R/W
1
IOPB1
R/W
1
IOPB0
R/W
1
h
A
IOPBx=0, PBx is output mode.
3.3.3
PS0CV
ec
PS0CV (Prescaler0 Counter Value Register)
Name SFR Type
F
Addr.
0xA
Bit7 Bit6 Bit5 Bit4
PS0CV[7:0]
Bit3 Bit2 Bit1 Bit0
-T
R/W Property R
Initial Value 1 1 1 1 1 1 1 1
BODCON F 0xC ODPB7 ODPB6 ODPB5 ODPB4 GP3 ODPB2 ODPB1 ODPB0
R/W Property R/W
h
A
Initial Value 0 0 0 0 0 0 0 0
ec
Name SFR Type Addr. Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0
PCON1 F 0xF GIE - GP5 GP4 GP3 GP2 GP1 T0EN
R/W Property R/W(1*) - R/W R/W R/W R/W R/W R/W
Initial Value 0 0 0 0 0 0 0 1
h
AT8A53D
ec
T0EN: Enable/disable Timer0.
T0EN=1, enable Timer0.
T0EN=0, disable Timer0.
-T
GIE: Global interrupt enable bit.
GIE=1, enable all unmasked interrupts.
GIE=0, disable all interrupts.
W
GP1~5: General purpose read/write register.
(1*) : set by instruction ENI, clear by instruction DISI, read by instruction IOSTR.
T
3.4 S-page Special Function Register
h
3.4.1 TMR1 (Timer1 Register)
A
Name SFR Type Addr. Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0
TMR1 ec
S
R/W Property
Initial Value
0x0 TMR1[7:0]
R/W
XXXXXXXX
-T
When reading register TMR1, it will obtain current value of 8-bit down-count Timer1. When writing register
TMR1, it will both write data to timer1 reload register and update Timer1 current content.
W
T1RL: Configure Timer1 down-count mechanism while Non-Stop mode is selected (T1OS=0).
T1RL=1, initial value is reloaded from reload register TMR1.
T1RL=0, continuous down-count from 0xFF when underflow is occurred.
T1OS=1, One-Shot mode. Timer1 will count once from the initial value to 0x00.
T1OS=0, Non-Stop mode. Timer1 will keep down-count after underflow.
h
AT8A53D
ec
T1OS T1RL Timer1 Down-Count Functionality
-T
When underflow is reached, 0xFF is reloaded and continues down-count.
h
A
ec
PWM1OEN=1, PWM1 output will be present on PB6.
PWM1OEN=0, PB6 is GPIO.
-T
3.4.3 T1CR2 (Timer1 Control Register2)
Name SFR Type Addr. Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0
T1CR2 S 0x2 - - T1CS T1CE /PS1EN PS1SEL[2:0]
R/W Property - - R/W R/W R/W R/W R/W R/W
W
Initial Value X X 1 1 1 1 1 1
000 1:2
ec
001 1:4
010 1:8
011 1:16
-T
100 1:32
101 1:64
110 1:128
TW
111 1:256
h
AT8A53D
ec
/PS1EN: Disable/enable Prescaler1.
/PS1EN=1, disable Prescaler1.
/PS1EN=0, enable Prescaler1.
-T
T1CE: Timer1 external clock edge selection.
T1CE=1, Timer1 will decrease one while high-to-low transition occurs on pin EX_CKI.
T1CE=0, Timer1 will decrease one while low-to-high transition occurs on pin EX_CKI.
W
T1CS: Timer1 clock source selection.
T1CS=1, External clock on pin EX_CKI is selected.
T1CS=0, Instruction clock is selected.
T
3.4.4 PWM1DUTY (PWM1 Duty Register)
h
A
Name SFR Type Addr. Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0
PWM1DUTY S 0x3 PWM1DUTY[7:0]
ec
R/W Property
Initial Value
W
XXXXXXXX
-T
This register is write-only. After Timer1 is enabled and start down-count, PWM1 output will keep at inactive
state. While Timer1 value is equal to PWM1DUTY, PWM1 output will become active state until underflow is
occurred.
W
Moreover, the reload value of Timer1 stored on register TMR1 is used to define the PWM1 frame rate and
register PWM1DUTY is used to define the duty cycle of PWM1.
Name SFR Type Addr. Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0
PS1CV S 0x4 PS1CV[7:0]
h
A
R/W Property R
ec
Initial Value 1 1 1 1 1 1 1 1
R/W Property W - - - W
Initial Value 0 X X X 1 1 1 1
h
AT8A53D
ec
BZ1 Frequency Selection
BZ1FSEL[3:0]
Clock Source Dividing Rate
-T
0000 1:2
0001 1:4
0010 1:8
0011 1:16
0100
0101
0110
T W
Prescaler1 output
1:32
1:64
1:128
0111 1:256
1000 Timer1 bit 0
h
A
1001 Timer1 bit 1
1010 Timer1 bit 2
1011
1100
1101
ec Timer1 output
Timer1 bit 3
Timer1 bit 4
Timer1 bit 5
-T
1110 Timer1 bit 6
1111 Timer1 bit 7
R/W Property W - - - - W W W
Initial Value 0 X X X X 0 0 0
-T
h
AT8A53D
ec
IRCSEL: Polarity selection of IR carrier.
IRCSEL=0, IR carrier will be generated when I/O pin data is 1.
IRCSEL=1, IR carrier will be generated when I/O pin data is 0.
-T
IROSC358M: When external crystal is used, this bit is determined according to what kind of crystal is used.
This bit is ignored if internal high frequency oscillation is used.
IROSC358M=1, crystal frequency is 3.58MHz.
Note:
W
IROSC358M=0, crystal frequency is 455KHz.
1. Only high oscillation (FHOSC) (See section 3.11) can be used as IR clock source.
T
2. Division ratio for different oscillation type.
h
A
Table 7
96
12
Xtal mode & IROSC358M=1
Xtal mode & IROSC358M=0
When instruction CALLA, GOTOA or TABLEA is executed, the target address is constituted by TBHP[2:0]
and ACC. ACC is the Low Byte of PC[9:0] and TBHP[1:0] is the high byte of PC[9:0]. TBHP[2] is general
h
A
R/W Property - - R R R R R R
Initial Value X X X X X X X X
When instruction TABLEA is executed, high byte of content of addressed ROM is loaded into TBHD[5:0]
TW
h
AT8A53D
ec
3.4.10 OSCCR (Oscillation Control Register)
Name SFR Type Addr. Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0
OSCCR S 0xF - - - - OPMD[1:0] STPHOSC SELHOSC
-T
R/W Property - - - - R/W R/W R/W
Initial Value X X X X 00 0 1
h
A
OPMD[1:0]
00
01
ec Operating Mode
Normal mode
Halt mode
-T
10 Standby mode
11 reserved
Note: STPHOSC cannot be changed with SELHOSC or OPMD at the same time. STPHOSC cannot be
changed with OPMD at the same time during SELHOSC=1.
T
registers PORTA and PORTB respectively. Each I/O pin has a corresponding register bit to define it is input pin
or output pin. Register IOSTA[3:0] define the input/output direction of PA[3:0]. Register IOSTB[7:0] define the
ec
When an I/O pin is configured as input pin, it may have Pull-High resistor or Pull-Low resistor which is enabled
or disabled through registers. Register ABPLCON[3:0] are used to enable or disable Pull-Low resistor of
-T
PA[3:0]. Register BPHCON[7:0] are used to enable or disable Pull-High resistor of PB[7:4] and PB[2:0]. Register
ABPLCON[7:4] are used to enable or disable Pull-Low resistor of PB[3:0].
When an I/O pin is configured as output pin, there is a corresponding and individual register to select as
TW
Open-Drain output pin. Register BODCON[7:0] determine PB[7:0] is Open-Drain or not. (Except PB[3], which is
always in open-drain mode when configured as output port.)
h
AT8A53D
ec
Feature PA[3:0] PB[2:0] PB[3] PB[7:4]
Pull-High Resistor X V X V
Input
Pull-Low Resistor V V V X
-T
Output Open-Drain X V always V
W
The level change on each I/O pin of PB may generate interrupt request. Register BWUCON[7:0] will select
which I/O pin of PB may generate this interrupt. As long as any pin of PB is selected by corresponding bit of
BWUCON, the register bit PBIF (INTF[1]) will set to 1 if there is a level change occurred on any selected pin. An
interrupt request will occur and interrupt service routine will be executed if register bit PBIE (INTE[1]) and GIE
T
(PCON1[7]) are both set to 1.
h
There is one external interrupt provided by AT8A53D. When register bit EIS (PCON[6]) is set to 1, PB0 is used
A
ec
Note: When PB0 is both set as level change operation and external interrupt, the external interrupt will
have higher priority, and the PB0 level change operation will be disabled. But PB7~PB1 level
change function are not affected.
-T
AT8A53D can provide IR carrier generation. IR carrier generation is enabled by register bit IREN (IRCR[0]) and
carrier will be present on a PB1 pin. Configuration word IR Current determines sink current value of IR carrier.
PB3 can be used as external reset input determined by a configuration word. When an active-low signal is
W
When external crystal (E_HXT, E_XT or E_LXT) is adopted for high oscillation or low oscillation according to
setting of configuration words, PB5 will be used as crystal input pin (Xin) and PB4 will be used as crystal output
T
pin (Xout).
When I_HRC or I_LRC mode is selected as system oscillation and E_HXT, E_XT or E_LXT is not adopted,
h
A
Moreover, PB2 can be timer 0 external clock source EX_CKI if T0MD T0CS=1 and LCK_TM0=0. PB2 can be
timer 1 external clock source if T1CS=1.
Moreover, PB6 can be PWM output and PB7 can be Buzzer output. If T1CR1[7] PWM1OEN=1, PB6 can be
-T
h
AT8A53D
ec
3.5.1 Block Diagram of IO Pins
IO_SEL: set pad input or output
-T
WRITE_EN: write data to pad.
h
A
ec
-T
W
h
A
ec
-T
TW
h
AT8A53D
ec
OD_EN: open-drain enable.
-T
WRITE_EN: write data to pad.
h
RD_TYPE: select read pin or read latch.
A
ec
-T
T W
h
A
ec
-T
h
AT8A53D
ec
OD_EN: open-drain enable.
-T
IO_SEL: set pad input or output.
W
PULLDOWN_EN: enable Pull-Low.
h
SET_PBIF: set port change interrupt flag.
A
ec
-T
T W
h
A
ec
h
AT8A53D
ec
OD_EN: open-drain enable.
-T
WRITE_EN: write data to pad.
h
EX_CKI: Timer0 EX CLOCK IN.
A
ec
-T
T W
h
A
ec
-T
h
AT8A53D
ec
PB3_RSTPAD: PB3 is set as Reset Pin by configuration word.
-T
WRITE_EN: write data to pad.
h
A
ec
-T
T W
h
A
ec
-T
h
AT8A53D
ec
OD_EN: open-drain enable.
-T
IO_SEL: set pad input or output.
h
A
ec
-T
T W
h
A
ec
h
AT8A53D
ec
OD_EN: open-drain enable.
-T
PWM_OR_BZ_DATA: PWM or Buzzer data.
W
READ_EN: read pad to DATA_BUS.
h
SET_PBIF: set port change interrupt flag.
A
ec
-T
T W
h
A
ec
h
AT8A53D
ec
3.6 Timer0
Timer0 is an 8-bit up-count timer and its operation is enabled by register bit T0EN (PCON1[0]). Writing to Timer0
-T
will set its initial value. Reading from Timer0 will show its current count value.
The clock source to Timer0 can be from instruction clock, external pin EX_CKI or low speed clock Low Oscillator
Frequency according to register bit T0CS and LCK_TM0 (T0MD[5] and T0MD[7]). When T0CS is 0, instruction
clock is selected as Timer0 clock source. When T0CS is 1 and LCK_TM0 is 0, EX_CKI is selected as Timer0
W
clock source. When T0CS is 1 and LCK_TM0 is 1 (and Timer0 source must set to 1), Low Oscillator Frequency
(I_LRC or E_LXT, depends on configuration word) output is selected. Summarized table is shown below. (Also
check Figure. 12)
T
Low Oscillator
Timer0 clock source T0CS LCKTM0 Timer0 source
Frequency
h
A
Instruction clock 0 X X X
0 X
EX_CKI
E_LXT
ec 1
1
X
1
0
1
X
1
-T
I_LRC 1 1 1 0
Moreover the active edge of EX_CKI or Low Oscillator Frequency to increase Timer0 can be selected by
W
register bit T0CE (T0MD[4]). When T0CE is 1, high-to-low transition on EX_CKI or Low Oscillator Frequency will
increase Timer0. When T0CE is 0, low-to-high transition on EX_CKI or Low Oscillator Frequency will increase
Timer0. When using Low Oscillator Frequency as timer0 clock source, it is suggested to use prescaler0 (see
T
below descriptions) and the ratio set to more than 4, or missing count may happen.
Before Timer0 clock source is supplied to Timer0, it can be divided by Prescaler0 if register bit PS0WDT
h
A
(T0MD[3]) is clear to 0. When writing 0 to PS0WDT by instruction, Prescaler0 is assigned to Timer0 and
Prescaler0 will be clear after this instruction is executed. The dividing rate of Prescaler0 is determined by
ec
When Timer0 is overflow, the register bit T0IF (INTF[0]) will be set to 1 to indicate Timer0 overflow event is
occurred. If register bit T0IE (INTE[0]) and GIE are both set to 1, interrupt request will occur and interrupt service
-T
routine will be executed. T0IF will not be clear until firmware writes 0 to T0IF.
The block diagram of Timer0 and WDT is shown in the figure below.
TW
h
AT8A53D
ec
-T
T W
h
A
3.7 Timer1/PWM1/Buzzer1
ec
Timer1 is an 8-bit down-count timer with Prescaler1 whose dividing rate is programmable. The output of Timer1
-T
can be used to generate PWM1 output and Buzzer1 output. A write to the Timer1 will both write to a timer1
reload register (T1rld) and timer1 counter. A read to the timer1 will show the content of the Timer1 current count
value.
W
h
A
ec
-T
The operation of Timer1 can be enabled or disabled by register bit T1EN (T1CR1[0]). After Timer1 is enabled,
TW
its clock source can be instruction clock or pin EX_CKI which is determined by register bit T1CS (T1CR2[5]).
When T1CS is 1, EX_CKI is selected as clock source. When T1CS is 0, instruction clock is selected as clock
source. When EX_CKI is selected, the active edge to decrease Timer1 is determined by register bit T1CE
(T1CR2[4]). When T1CE is 1, high-to-low transition on EX_CKI will decrease Timer1. When T1CE is 0,
h
AT8A53D
ec
low-to-high transition on EX_CKI will decrease Timer1. The selected clock source can be divided further by
Prescaler1 before it is applied to Timer1. Prescaler1 is enabled by writing 0 to register bit /PS1EN (T1CR2[3])
and the dividing rate is from 1:2 to 1:256 determined by register bits PS1SEL[2:0] (T1CR2[2:0]). Current value of
-T
Prescaler1 can be obtained by reading register PS1CV.
Timer1 provide two kinds of operating mode: one is One-Shot mode and the other is Non-Stop mode. When
register bit T1OS (T1CR1[2]) is 1, One-Shot mode is selected. Timer1 will count down once from initial value
W
stored on register TMR1 to 0x00, i.e. underflow is occurred. When register bit T1OS (T1CR1[2]) is 0, Non-Stop
mode is selected. When underflow is occurred, there are two selections to start next down-count which is
determined by register bit T1RL (T1CR1[1]). When T1RL is 1, the initial value stored on register TMR1 will be
T
restored and start next down-count from this initial value. When T1RL is 0, Timer1 will start next down-count
from 0xFF.
h
A
When Timer1 is underflow, the register bit T1IF (INTF[3]) will be set to 1 to indicate Timer1 underflow event is
occurred. If register bit T1IE (INTE[3]) and GIE are both set to 1, interrupt request will occur and interrupt service
ec
routine will be executed. T1IF will not be clear until firmware writes 0 to T1IF.
The PWM1 output can be available on I/O pin PB6 when register bit PWM1OEN (T1CR1[7]) is set to 1.
Moreover, PB6 will become output pin automatically. The active state of PWM1 output is determined by register
ec
bit PWM1OAL (T1CR1[6]). When PWM1OAL is 1, PWM1 output is active low. When PWM1OAL is 0, PWM1
output is active high. Moreover, the duty cycle and frame rate of PWM1 are both programmable. The duty cycle
is determined by register PWM1DUTY. When PWM1DUTY is 0, PWM1 output will be never active. When
-T
PWM1DUTY is 0xFF, PWM1 output will be active for 255 Timer1 input clocks. The frame rate is determined by
TMR1 initial value. Therefore, PWM1DUTY value must be less than or equal to TMR1. The block diagram of
PWM1 is illustrated in the following figure.
TW
h
AT8A53D
ec
-T
T W
Figure 15 PWM1 Block Diagram
h
A
The Buzzer1 output (BZ1) can be available on I/O pin PB7 when register bit BZ1EN (BZ1CR1[7]) is set to 1.
Moreover, PB7 will become output pin automatically. The frequency of BZ1 can be derived from Timer1 output
ec
or Prescaler1 output and dividing rate is determined by register bits BZ1FSEL[3:0] (BZ1CR[3:0]). When
BZ1FSEL[3] is 0, Prescaler1 output is selected to generate BZ1 output. When BZ1FSEL[3] is 1, Timer1 output is
selected to generate BZ1 output. The dividing rate can be from 1:2 to 1:256 in order to generate all kinds of
-T
frequency. The block diagram of Buzzer1 is illustrated in the following figure.
T W
h
A
3.8 IR Carrier
The IR carrier will be generated after register bit IREN (IRCR[0]) is set to 1. Moreover, PB1 will become output
-T
pin automatically. When IREN is clear to 0, PB1 will become general I/O pin as it was configured.
The IR carrier frequency is selectable by register bit IRF57K (IRCR[1]). When IRF57K is 1, IR carrier frequency
is 57KHz. When IRF57K is 0, IR carrier frequency is 38KHz. Because IR carrier frequency is derived from high
TW
frequency system oscillation FHOSC, it is necessary to specify what frequency is used as system oscillation when
external crystal is used. Register bit IROSC358M (IRCR[7]) is used to provide AT8A53D this information. When
IROSC358M is 1, frequency of external crystal is 3.58MHz and when IROSC358M is 0, frequency of external
h
AT8A53D
ec
crystal is 455KHz. When internal high frequency oscillation is adopted, this register will be ignored, and it will
provide 4MHz clock to IR module.
-T
The active state (polarity) of IR carrier is selectable according to PB1 output data. When register bit IRCSEL
(IRCR[2]) is 1, IR carrier will be present on pin PB1 when its output data is 0. When register bit IRCSEL
(IRCR[2]) is 0, IR carrier will be present on pin PB1 when its output data is 1. The polarity of IR carrier is shown
in the following figure.
T W
h
A
Figure 17 Polarity of IR Carrier vs. Output Data
3.9 ec
Watch-Dog Timer (WDT)
There is an on-chip free-running oscillator in AT8A53D which is used by WDT. As this oscillator is independent
of other oscillation circuits, WDT may still keep working during Standby mode and Halt mode.
-T
WDT can be enabled or disabled by a configuration word. When WDT is enabled by configuration word, its
operation still can be controlled by register bit WDTEN (PCON[7]) during program execution. Moreover, the
mechanism after WDT time-out can reset AT8A53D or issue an interrupt request which is determined by
W
another configuration word. At the same time, register bit /TO (STATUS[4]) will be clear to 0 after WDT time-out.
The baseline of WDT time-out period can be 3.5 ms, 15 ms, 60 ms or 250 ms which is determined by two
configuration words. The time-out period can be lengthened if Prescaler0 is assigned to WDT. Prescaler0 will be
T
assigned to WDT by writing 1 to register bit PS0WDT. The dividing rate of Prescaler0 for WDT is determined by
register bits PS0SEL[2:0] and depends on WDT time-out mechanism. The dividing rate is from 1:1 to 1:128 if
h
A
WDT time-out will reset AT8A53D and dividing rate is from 1:2 to 1:256 if WDT time-out will interrupt AT8A53D.
When Prescaler0 is assigned to WDT, the execution of instruction CLRWDT will clear WDT, Prescaler0 and set
ec
/TO flag to 1.
If user selects interrupt for WDT time-out mechanism, register bit WDTIF (INTF[6]) will set to 1 after WDT is
-T
expired. It may generate an interrupt request if register bit WDTIE (INTE[6]) and GIE both set to 1. WDTIF will
not be clear until firmware writes 0 to WDTIF.
TW
h
AT8A53D
ec
3.10 Interrupt
AT8A53D provides two kinds of interrupt: one is software interrupt and the other is hardware interrupt. Software
-T
interrupt is caused by execution of instruction INT. There are 5 hardware interrupts:
Timer0 overflow interrupt.
Timer1 underflow interrupt.
WDT timeout interrupt.
External interrupt.
W
PB input change interrupt.
GIE is global interrupt enable flag. It has to be 1 to enable hardware interrupt functions. GIE can be set by ENI
T
instruction and clear to 0 by DISI instruction.
After instruction INT is executed, no matter GIE is set or clear, the next instruction will be fetched from address
h
A
0x001. At the same time, GIE will be clear to 0 by AT8A53D automatically. This will prevent nested interrupt
from happening. The last instruction of interrupt service routine of software interrupt has to be RETIE. Execution
ec
of this instruction will set GIE to 1 and return to original execution sequence.
While any of hardware interrupts is occurred, the corresponding bit of Interrupt Flag Register INTF will be set to
-T
1. This bit will not be clear until firmware writes 0 to this bit. Therefore user can obtain information of which event
causes hardware interrupt by polling register INTF. Note that only when the corresponding bit of Interrupt
Enable register INTE is set to 1, will the corresponding interrupt flag be read. And if the corresponding bit of
Interrupt Enable Register INTE is set to 1 and GIE is also 1, hardware interrupt will occur and next instruction
W
will be fetched from 0x008. At the same time, the register bit GIE will be clear by AT8A53D automatically. If user
wants to implement nested interrupt, instruction ENI can be used as the first instruction of interrupt service
routine which will set GIE to 1 again and allow other interrupt events to interrupt AT8A53D again. Instruction
T
RETIE has to be the last instruction of interrupt service routine which will set GIE to 1 and return to original
execution sequence.
h
A
It should be noted that ENI instruction cannot be placed right before RETIE instruction because ENI instruction
in interrupt service routine will trigger nested interrupt, but RETIE will clear internal interrupt processing after
ec
Timer0 overflow (from 0x00 to 0xFF) will set register bit T0IF. This interrupt request will be serviced if T0IE
and GIE are set to 1.
TW
h
AT8A53D
ec
3.10.3 WDT Timeout Interrupt
When WDT is timeout and the configuration word selects WDT timeout will generate interrupt request, it will
-T
set register bit WDTIF. This interrupt request will be serviced if WDTIE and GIE are set to 1.
W
change on these selected I/O pin(s) will set register bit PBIF. This interrupt request will be serviced if PBIE
and GIE are set to 1. Note when PB0 is both set as level change interrupt and external interrupt, the external
interrupt enable EIS=1 will disable PB0 level change operation.
T
3.10.5 External Interrupt
h
A
According to the configuration of EIS=1 and INTEDG, the selected active edge on I/O pin PB0 will set
register bit INTIF and this interrupt request will be served if INTIE and GIE are set to 1.
ec
3.11 Oscillation Configuration
-T
Because AT8A53D is a dual-clock IC, there are high oscillation (FHOSC) and low oscillation (FLOSC) that can be
selected as system oscillation (FOSC). The oscillators which could be used as FHOSC are internal high RC oscillator
(I_HRC), external high crystal oscillator (E_HXT) and external crystal oscillator (E_XT). The oscillators which could
be used as FLOSC are internal low RC oscillator (I_LRC) and external low crystal oscillator (E_LXT).
T W
h
A
ec
-T
TW
h
AT8A53D
ec
There are two configuration words to determine which oscillator will be used as FHOSC. When I_HRC is selected
as FHOSC, I_HRC output frequency is determined by three configuration words and it can be 1M, 2M, 4M, 8M,
16M or 20MHz. Moreover, external crystal oscillator pads PB4 and PB5 can be used as I/O pins. On the other
-T
hand, PB4 can be the output pin of instruction clock according to a configuration word’s setting. If FHOSC required
external crystal whose frequency ranges from 8MHz to 20MHz, E_HXT is recommended. If FHOSC required
external crystal whose frequency ranges from 455KHz to 6MHz, E_XT is recommended. When E_HXT or E_XT
W
is adopted, PB4/PB5 cannot be used as I/O pins. They must be used as crystal output pin and input pin. PB4 is
crystal output pin (Xout) and PB5 is crystal input pin (Xin).
There is one configuration word to determine which oscillator will be used as FLOSC. When I_LRC is selected, its
T
frequency is centered on 32768Hz. If FLOSC required external crystal, E_LXT is selected and only 32768Hz
crystal is allowed. When E_LXT is adopted, PB4/PB5 cannot be used as I/O pins. They must be used as crystal
h
output pin and input pin. PB4 is crystal output pin (Xout) and PB5 is crystal input pin (Xin). The dual-clock
A
No.
1
ec
FHOSC
I_HRC
FLOSC
I_LRC
-T
2 E_HXT or E_XT I_LRC
3 I_HRC E_LXT
When E_HXT, E_XT or E_LXT is used as one of oscillations, the crystal or resonator is connected to Xin and
Xout to provide oscillation. Moreover, a resistor and two capacitors are recommended to connect as following
figure in order to provide reliable oscillation, refer to the specification of crystal or resonator to adopt appropriate
T
C1 or C2 value. The recommended value of C1 and C2 are listed in the table below.
16M 5 ~ 10
E_HXT 10M 5 ~ 30
ec
8M 5 ~ 20
4M 5 ~ 30
E_XT 1M 5 ~ 30
-T
455K 10 ~ 100
E_LXT 32768 10 ~ 30
For 20MHZ resonator in 2 clock CPU cycle mode, An 18pF C2 capacitor is a must.
h
AT8A53D
ec
-T
T W
Figure 19 Connection for External Crystal Oscillation
h
A
Either FHOSC or FLOSC can be selected as system oscillation FOSC according to the value of register bit SELHOSC
(OSCCR[0]). When SELHOSC is 1, FHOSC is selected as FOSC. When SELHOSC is 0, FLOSC is selected as FOSC.
ec
Once FOSC is determined, the instruction clock FINST can be FOSC/2 or FOSC/4 according to value of a
configuration word.
-T
3.12 Operating Mode
AT8A53D provides four kinds of operating mode to tailor all kinds of application and save power consumptions.
These operating modes are Normal mode, Slow mode, Standby mode and Halt mode. Normal mode is
W
designated for high-speed operating mode. Slow mode is designated for low-speed mode in order to save
power consumption. At Standby mode, AT8A53D will stop almost all operations except Timer0/Timer1/WDT in
order to wake-up periodically. At Halt mode, AT8A53D will sleep until external event or WDT trigger IC to
T
wake-up.
The block diagram of four operating modes is described in the following figure.
h
A
ec
-T
TW
h
AT8A53D
ec
-T
T W
h
A
ec
-T
T W
h
A
ec
-T
h
AT8A53D
ec
3.12.1 Normal Mode
After any Reset Event is occurred and Reset Process is completed, AT8A53D will begin to execute program
under Normal mode or Slow mode. Which mode is selected after Reset Process is determined by the Startup
-T
Clock configuration word. If Startup Clock=fast, AT8A53D will enter Normal mode, if Startup Clock=Slow,
AT8A53D will enter Slow mode. At Normal mode, FHOSC is selected as system oscillation in order to provide
highest performance and its power consumption will be the largest among four operating modes. After power
W
on or any reset trigger is released, AT8A53D will enter Normal mode after reset process is completed.
Instruction execution is based on FHOSC and all peripheral modules may be active according to
corresponding module enable bit.
T
The FLOSC is still active and running.
h
A
IC can switch to Standby mode or Halt mode by programming register bits OPMD[1:0] (OSCCR[3:2]).
ec
For real time clock applications, the AT8A53D can run in normal mode, at the same time the
low-frequency clock Low Oscillator Frequency connects to timer0 clock. This is made possible by setting
LCKTM0 to 1 and corresponding configuration word Timer0 source setting to 1.
-T
3.12.2 Slow Mode
AT8A53D will enter Slow mode by writing 0 to register bit SELHOSC. At Slow mode, FLOSC is selected as
system oscillation in order to save power consumption but still keep IC running. However, FHOSC will not be
W
disabled automatically by AT8A53D. Therefore user can write 0 to register bit STPHOSC (OSCCR[1]) in slow
mode to reduce power consumption further. But it is noted that it is forbidden to enter slow mode and stop
FHOSC at the same time, one must enter slow mode first, then disable FHOSC, or the program may hang on.
T
Instruction execution is based on FLOSC and all peripheral modules may be active according to
corresponding module enable bit.
h
A
IC can switch to Standby mode or Halt mode by programming register bits OPMD[1:0].
ec
AT8A53D will enter Standby mode by writing 10b to register bits OPMD[1:0]. At Standby mode, however,
FHOSC will not be disabled automatically by AT8A53D and user has to enter slow mode and write 1 to register
bit STPHOSC in order to stop FHOSC oscillation. Most of AT8A53D peripheral modules are disabled but Timer
TW
can be still active if register bit T0EN/T1EN is set to 1. Therefore AT8A53D can wake-up after Timer0/Timer1
is expired. The expiration period is determined by the register TMR0/TMR1, FINST and other configurations
for Timer0/Timer1.
h
AT8A53D
ec
Instruction execution is stop and some peripheral modules may be active according to corresponding
module enable bit.
-T
The FLOSC is still active and running.
IC can wake-up from Standby mode if any of (a) Timer0/Timer1 (overflow/underflow) interrupt, (b) WDT
timeout interrupt, (c) PB input change interrupt or (d) INT external interrupt is happened.
mode if SELHOSC=0.
W
After wake-up from Standby mode, IC will return to Normal mode if SELHOSC=1, IC will return to Slow
It is not recommended to change oscillator mode (normal to slow / slow to normal) and enter standby
T
mode at the same time.
h
A
ec
AT8A53D will enter Halt mode by executing instruction SLEEP or writing 01b to register bits OPMD[1:0].
After entering Halt mode, register bit /PD (STATUS[3]) will be clear to 0, register bit /TO (STATUS[4]) will be
set to 1 and WDT will be clear but keep running.
-T
At Halt mode, all of peripheral modules are disabled, instruction execution is stop and AT8A53D can only
wake-up by some specific events. Therefore, Halt mode is the most power saving mode provided by
AT8A53D.
W
IC can wake-up from Halt mode if any of (a) WDT timeout interrupt, (b) PB input change interrupt or (c)
INT or external interrupt is happened.
T
After wake-up from Halt mode, IC will return to Normal mode if SELHOSC=1, IC will return to Slow mode
h
if SELHOSC=0.
A
Note: Users can change STPHOSC and enter Halt mode in the same instruction.
ec
It is not recommended to change oscillator mode (normal to slow or slow to normal) and enter halt mode
at the same time.
-T
512*FOSC. And if no XT mode are selected, 16*Fosc would be set as wake-up period. On the other hand,
there is no need of wake-up stable time for Standby mode because either FHOSC or FLOSC is still running at
Standby mode.
h
AT8A53D
ec
Before AT8A53D enter Standby mode or Halt mode, user may execute instruction ENI. At this condition,
AT8A53D will branch to address 0x008 in order to execute interrupt service routine after wake-up. If
instruction DISI is executed or 0 is written to register bit GIE before entering Standby mode or Halt mode, the
-T
next instruction will be executed after wake-up.
FHOSC
T W
The summary of four operating modes is described in the following table.
Mode Normal
Enabled
Slow
STPHOSC
Standby
STPHOSC
Halt
Disabled
h
A
WDT ec
Other Modules
Option and
WDTEN
Module enable bit
Option and
WDTEN
Module enable bit
Option and
WDTEN
Module enable bit
- Timer0 overflow
Option and
WDTEN
All disabled
-T
- WDT timeout
- Timer1 underflow
Wake-up Source - - - WDT timeout - PB input change
- PB input change - INT
- INT
W
AT8A53D will enter Reset State and start Reset Process when one of following Reset Event is occurred:
Power-On Reset (POR) is occurred when VDD rising is detected.
h
A
Low-Voltage Reset (LVR) is occurred when operating VDD is below pre-defined voltage.
Pin RSTb is low state.
ec
Moreover, value of all registers will be initialized to their initial value or unchanged if its initial value is unknown.
The status bits /TO and /PD could be initialized according to which event causes reset. The /TO and /PD value
-T
POR, LVR 1 1
h
AT8A53D
ec
Event /TO /PD
-T
SLEEP executed 1 0
CLRWDT executed 1 1
Table 14 Summary of /TO & /PD Value and its Associated Event
W
After Reset Event is released, AT8A53D will start Reset Process. It will wait certain amount of period for
oscillation stable no matter what kind of oscillator is adopted. This period is called power-up reset time and is
determined by two-bit configuration words which can be 140us, 4.5ms,18ms, 72ms or 288ms. After oscillator is
T
stable, AT8A53D will wait further 16 clock cycles of FOSC (oscillator start-up time, OST) and Reset Process is
complete.
h
A
ec
-T
W
For slow VDD power-up, it is recommended to use RSTb reset, as the following figure.
h
It is recommended the R value should be not greater than 40kΩ.
A
The R1 value=100Ω to 1kΩ will prevent high current, ESD or Electrical overstress flowing into reset pin.
ec
AT8A53D
h
AT8A53D
ec
4. Instruction Set
AT8A53D provides 55 powerful instructions for all kinds of applications.
-T
OP OP
Inst. Operation Cyc. Flag Inst. Operation Cyc. Flag
1 2 1 2
ANDAR
IORAR
XORAR
ANDIA
R
i
W
d dest = ACC & R
d dest = ACC | R
d dest = ACC ⊕ R
1
Z
Z
ADDAR
SUBAR
ADCAR
SBCAR
R d dest = R + ACC
R d dest = R + (~ACC)
R d dest = R + ACC + C
R d dest = R + (~ACC) + C
1
1
Z, DC, C
Z, DC, C
Z, DC, C
Z, DC, C
h
A
BSR
BCR
R
R
ec
bit Set bit in R
1
-
-
DAA
CMPAR R
Decimal adjust for ACC
1
C
Z, C
-T
INCR R d Increase R 1 Z CLRA Clear ACC 1 Z
BTRSC R bit Test bit in R, skip if clear 1 or 2 - SLEEP Go into Halt mode 1 /TO, /PD
BTRSS R bit Test bit in R, skip if set 1 or 2 - CLRWDT Clear Watch-Dog Timer 1 /TO, /PD
RETIE 2 -
MOVIA i Move immediate to ACC 1 - and enable interrupt
h
AT8A53D
ec
ACC: Accumulator.
adr: immediate address.
bit: bit address within an 8-bit register R.
-T
C: Carry/Borrow bit
C=1, carry is occurred for addition instruction or borrow is NOT occurred for subtraction instruction.
C=0, carry is not occurred for addition instruction or borrow IS occurred for subtraction instruction.
d: Destination
W
If d is “0”, the result is stored in the ACC.
If d is “1”, the result is stored back in register R.
T
DC: Digital carry flag.
dest: Destination.
h
A
F: F-page SFR, F is 0x5 ~ 0xF.
i: 8-bit immediate data.
PC: Program Counter. ec
PCHBUF: High Byte Buffer of Program Counter.
h
AT8A53D
ec
ADCAR Add ACC and R with Carry ADDAR Add ACC and R
Syntax: ADCAR R, d Syntax: ADDAR R, d
Operand: 0 R 63 Operand: 0 R 63
-T
d = 0, 1. d = 0, 1.
Operation: R + ACC + C dest Operation: ACC + R dest
Status affected: Z, DC, C Status affected: Z, DC, C
Description:
Cycle
W
Add the contents of ACC and
register R with Carry. If d is 0, the
result is stored in ACC. If d is 1,
the result is stored back to R.
1
T Description:
Cycle:
Add the contents of ACC and R. If
d is 0, the result is stored in ACC. If
d is 1, the result is stored back to
R.
1
Example: ADCAR R, d Example: ADDAR R, d
before executing instruction: before executing instruction:
h
ACC=0x12, R=0x34, C=1, d=1, ACC=0x12, R=0x34,C=1, d=1,
A
Example: ADDIA i
Example: ADCIA i
before executing instruction:
before executing instruction:
ACC=0x12, i=0x34, C=1,
ec
h
AT8A53D
ec
ANDAR AND ACC and R BCR Clear Bit in R
Syntax: ANDAR R, d Syntax: BCR R, bit
Operand: 0 R 63. Operand: 0 R 63
-T
d = 0, 1. 0 bit 7
Operation: ACC & R dest Operation: 0 R[bit]
Cycle:
W
The content of ACC is AND’ed
with R. If d is 0, the result is
stored in ACC. If d is 1, the
result is stored back to R.
1
T Cycle:
Example:
1
BCR R,B2
before executing instruction:
R=0x5A, B2=0x3,
Example: ANDAR R, d after executing instruction:
before executing instruction: R=0x52.
h
ACC=0x5A, R=0xAF, d=1.
A
0 bit 7
Operation: ACC & i ACC
Operation: 1 R[bit]
Status affected: Z
Status affected: --
Description: The content of ACC register is
T
h
AT8A53D
ec
BTRSC Test Bit in R and Skip if Clear CALL Call Subroutine
Syntax: BTRSC R, bit Syntax: CALL adr
Operand: 0 R 63 Operand: 0 adr < 255
-T
0 bit 7
Operation: PC + 1 Top of Stack
Operation: Skip next instruction, if R[bit] = 0.
{PCHBUF, adr} PC
Status affected: -- Status affected: --
Description:
W
If R[bit] = 0, the next instruction
which is already fetched is
discarded and a NOP is executed
instead. Therefore it makes this
instruction a two-cycle instruction.
T Description: The return address (PC + 1) is
pushed onto top of Stack. The 8-bit
immediate address adr is loaded
into PC[7:0] and PCHBUF[1:0] is
loaded into PC[9:8].
h
A
Instruction1 before executing instruction:
Instruction2 PC=A0. Stack pointer=1
before executing instruction: after executing instruction:
ec
R=0x5A, B2=0x2,
after executing instruction:
because R[B2]=0, instruction1
will not be executed, the program
PC=address of SUB, Stack[1] =
A0+1, Stack pointer=2.
-T
will start execute instruction from
instruction2.
Example: BTRSS R, B2
Instruction2 before executing instruction:
Instruction3 TBHP=0x02, ACC=0x34.
before executing instruction: PC=A0. Stack pointer=1.
R=0x5A, B2=0x3, after executing instruction:
PC=0x234, Stack[1]=A0+1,
TW
h
AT8A53D
ec
CLRA Clear ACC CLRWDT Clear Watch-Dog Timer
Syntax: CLRA Syntax: CLRWDT
Operand: -- Operand: --
-T
Operation: 00h ACC Operation: 00h WDT,
1 Z 00h WDT prescaler
1 /TO
Status affected: Z
1 /PD
Description: ACC is clear and Z is set to 1.
Cycle:
Example:
1
CLRA
W
before executing instruction:
ACC=0x55, Z=0.
T Status affected:
Description:
/TO, /PD
Executing CLRWDT will reset
WDT, Prescaler0 if it is assigned
to WDT. Moreover, status bits /TO
and /PD will be set to 1.
after executing instruction: Cycle: 1
ACC=0x00, Z=1.
Example: CLRWDT
h
A
before executing instruction:
/TO=0
after executing instruction:
ec /TO=1
-T
CLRR Clear R COMR Complement R
Syntax: CLRR R Syntax: COMR R, d
0 R 63
W
Operand: 0 R 63 Operand:
d = 0, 1.
Operation: 00h R
1Z Operation: ~R dest
Example: COMR , d
R=0x55, Z=0.
before executing instruction:
after executing instruction:
R=0xA6, d=1, Z=0.
R=0x00, Z=1.
after executing instruction:
-T
R=0x59, Z=0.
TW
h
AT8A53D
ec
CMPAR Compare ACC and R DECR Decrease R
Syntax: CMPAR R Syntax: DECR R, d
Operand: 0 R 63 Operand: 0 R 63
-T
Operation: R - ACC (No restore) d = 0, 1.
Cycle: 1
T W
complement representation. The
content of ACC and R is not
changed.
Cycle:
Example:
stored in ACC. If d is 1, the result is
stored back to R.
1
DECR R, d
Example: CMPAR R before executing instruction:
before executing instruction: R=0x01, d=1, Z=0.
R=0x34, ACC=12, Z=0, C=0. after executing instruction:
h
after executing instruction:
A
R=0x00, Z=1.
R=0x34, ACC=12, Z=0, C=1.
ec
-T
DAA Convert ACC Data Format from DECRSZ Decrease R, Skip if 0
Hexadecimal to Decimal
Syntax: DAA Syntax: DECRSZ R, d
Operand: -- Operand: 0 R 63
W
h
AT8A53D
ec
DISI Disable Interrupt Globally GOTO Unconditional Branch
Syntax: DISI Syntax: GOTO adr
Operand: -- Operand: 0 adr < 511
-T
Operation: Disable Interrupt, 0 GIE Operation: {PCHBUF, adr} PC
Status affected: -- Status affected: --
Description: GIE is clear to 0 in order to disable Description: GOTO is an unconditional branch
all interrupt requests. instruction. The 9-bit immediate
Cycle:
Example:
1
DISI
W
before executing instruction:
GIE=1.
T
Cycle:
address adr is loaded into PC[8:0]
and PCHBUF[1] is loaded into
PC[9].
2
After executing instruction: Example: GOTO Level
GIE=0. before executing instruction:
PC=A0.
h
A
after executing instruction:
PC=address of Level.
ec
-T
ENI Enable Interrupt Globally GOTOA Unconditional Branch
Syntax: ENI Syntax: GOTOA
Operand: -- Operand: --
W
h
AT8A53D
ec
INCR Increase R INT Software Interrupt
Syntax: INCR R, d Syntax: INT
Operand: 0 R 63 Operand: --
-T
d = 0, 1. Operation: PC + 1 Top of Stack,
Operation: R + 1 dest. 001h PC
Status affected: Z Status affected: --
Description: Increase R. If d is 0, the result is Description: Software interrupt. First, return
Cycle:
Example:
1
W
stored in ACC. If d is 1, the result
is stored back to R.
INCR R, d
T
Cycle:
address (PC + 1) is pushed onto
the Stack. The address 0x001 is
loaded into PC[9:0].
3
before executing instruction: Example: INT
R=0xFF, d=1, Z=0. before executing instruction:
after executing instruction: PC=address of INT code
h
R=0x00, Z=1.
A
after executing instruction:
PC=0x01
INCRSZ
ec
Increase R, Skip if 0 IORAR OR ACC with R
-T
Syntax: INCRSZ R, d Syntax: IORAR R, d
Operand: 0 R 63 Operand: 0 R 63
d = 0, 1. d = 0, 1.
h
AT8A53D
ec
IORIA OR Immediate with ACC IOSTR Move F-page SFR to ACC
Syntax: IORIA i Syntax: IOSTR F
-T
Operation: ACC | i ACC Operation: F-page SFR ACC
Cycle:
Example:
1
IORIA i
W
before executing instruction:
T Cycle:
Example:
1
IOSTR F
before executing instruction:
F=0x55, ACC=0xAA.
after executing instruction:
i=0x50, ACC=0xAA, Z=0.
after executing instruction: F=0x55, ACC=0x55.
ACC=0xFA, Z=0.
h
A
ec
-T
IOST Load F-page SFR from ACC LCALL Call Subroutine
Syntax: IOST F Syntax: LCALL adr
0 F 15 Operand: 0 adr 1023
W
Operand:
Operation: ACC F-page SFR Operation: PC + 1 Top of Stack,
adr PC[9:0]
Status affected: --
Status affected: --
Description: F-page SFR F is loaded by content
T
h
AT8A53D
ec
LGOTO Unconditional Branch MOVIA Move Immediate to ACC
Syntax: LGOTO adr Syntax: MOVIA i
Operand: 0 adr 1023 Operand: 0 i < 255
-T
Operation: i ACC
Operation: adr PC[9:0].
Status affected: --
Status affected: --
Description: The content of ACC is loaded with
Description: LGOTO is an unconditional branch 8-bit immediate data i.
Cycle:
Example:
2
LGOTO Level
T W
instruction. The 10-bit immediate
address adr is loaded into PC[9:0]. Cycle:
Example:
1
MOVIA i
before executing instruction:
i=0x55, ACC=0xAA.
before executing instruction:
after executing instruction:
PC=A0.
ACC=0x55.
after executing instruction:
h
PC=address of Level.
A
ec
-T
MOVAR Move ACC to R MOVR Move R to ACC or R
Syntax: MOVAR R Syntax: MOVR R, d
W
Operand: 0 R 63 Operand: 0 R 63
d = 0, 1.
Operation: ACC R
Operation: R dest
Status affected: --
Status affected: Z
Description: Move content of ACC to R.
T
h
AT8A53D
ec
NOP No Operation RETIA Return with Data in ACC
Syntax: NOP Syntax: RETIA i
Operand: -- Operand: 0 i < 255
-T
Operation: No operation. Operation: i ACC,
Status affected: -- Top of Stack PC
Description: No operation. Status affected: --
Cycle:
Example:
1
NOP
T W Description:
Cycle:
ACC is loaded with 8-bit immediate
data i and PC is loaded from top of
Stack as return address and GIE is
set to 1.
2
before executing instruction:
Example: RETIA i
PC=A0
before executing instruction:
after executing instruction:
h
GIE=0, Stack pointer =2. i=0x55,
A
PC=A0+1
ACC=0xAA.
after executing instruction:
ec GIE=1, PC=Stack[2],
pointer =1. ACC=0x55.
Stack
-T
RETIE Return from Interrupt and RET Return from Subroutine
Enable Interrupt Globally
W
Status affected: --
Status affected: --
Description: PC is loaded from top of Stack as
Description: The PC is loaded from top of Stack return address.
h
as return address and GIE is set to
A
1. Cycle: 2
Cycle: 2 Example: RET
ec
h
AT8A53D
ec
RLR Rotate Left R Through Carry SBCAR Subtract ACC and Carry from R
Syntax: RLR R, d Syntax: SBCAR R, d
Operand: 0 R 63 Operand: 0 R 63
-T
d = 0, 1. d = 0, 1.
Operation: C dest[0], R[7] C, Operation: R + (~ACC) + C dest
R[6:0] dest[7:1] Status affected: Z, DC, C
Description: Subtract ACC and Carry from R
Status affected: C
T W with 2’s complement
representation. If d is 0, the result
is placed in ACC. If d is 1, the
result is stored back to R.
Cycle: 1
Description: The content of R is rotated one bit
to the left through flag Carry. If d is Example: SBCAR R, d
0, the result is placed in ACC. If d (a) before executing instruction:
h
A
is 1, the result is stored back to R. R=0x05, ACC=0x06, d=1,
Cycle: 1 C=0.
after executing instruction:
Example: RLR R, dec
before executing instruction:
R=0xA5, d=1, C=0.
after executing instruction:
R=0xFE, C=0. (-2)
(b) before executing instruction:
R=0x05, ACC=0x06, d=1,
C=1.
-T
R=0x4A, C=1.
after executing instruction:
R=0xFF, C=0. (-1)
(c) before executing instruction:
RRR Rotate Right R Through Carry R=0x06, ACC=0x05, d=1,
C=0.
W
C=1.
R[0] C
after executing instruction:
R=0x1, C=1. (+1)
h
A
ec
Status affected: C
Description: The content of R is rotated one bit
to the right through flag Carry. If d
-T
Cycle: 1
TW
Example: RRR R, d
before executing instruction:
R=0xA5, d=1, C=0.
after executing instruction:
R=0x52, C=1.
h
AT8A53D
ec
SBCIA Subtract ACC and Carry from SFUNR Move S-page SFR from ACC
Immediate
Syntax: SBCIA i Syntax: SFUNR S
0 i < 255 0 S 15
-T
Operand: Operand:
Operation: i + (~ACC) + C dest Operation: S-page SFR ACC
Description: Subtract ACC and Carry from 8-bit Description: Move S-page SFR S to ACC.
Cycle:
W
immediate data i with 2’s
complement representation. The
result is placed in ACC.
1
T Cycle:
Example:
1
SFUNR S
before executing instruction:
S=0x55, ACC=0xAA.
after executing instruction:
Example: SBCIA i
(a) before executing instruction: S=0x55, ACC=0x55.
i=0x05, ACC=0x06, C=0.
h
after executing instruction:
A
h
AT8A53D
ec
SUBAR Subtract ACC from R SWAPR Swap High/Low Nibble in R
Syntax: SUBAR R, d Syntax: SWAPR R, d
Operand: 0 R 63 Operand: 0 R 63
-T
d = 0, 1. d = 0, 1.
Operation: R – ACC dest Operation: R[3:0] dest[7:4].
Status affected: Z, DC, C R[7:4] dest[3:0]
Status affected: --
Description:
Cycle:
W
Subtract ACC from R with 2’s
complement representation. If d is
0, the result is placed in ACC. If d
is 1, the result is stored back to R.
1
T Description: The high nibble and low nibble of R
is exchanged. If d is 0, the result is
placed in ACC. If d is 1, the result
is stored back to R.
Cycle: 1
Example: SBCAR R, d
(a) before executing instruction: Example: SWAPR R, d
before executing instruction:
h
R=0x05, ACC=0x06, d=1.
A
ec
(b) before executing instruction:
R=0x06, ACC=0x05, d=1.
after executing instruction:
R=0x01, C=1. (+1)
R=0x5A.
-T
SUBIA Subtract ACC from Immediate TABLEA Read ROM data
W
Description: Subtract ACC from 8-bit immediate ROM data{TBHP, ACC} [13:8]
data i with 2’s complement TBHD.
h
representation. The result is Status affected: --
A
placed in ACC.
Description: The 8 least significant bits of ROM
Cycle: 1
ec
h
AT8A53D
ec
T0MD Load ACC to T0MD XORAR Exclusive-OR ACC with R
Syntax: T0MD Syntax: XORAR R, d
Operand: -- Operand: 0 R 63
-T
Operation: ACC T0MD d = 0, 1.
Operation: ACC R dest
Status affected: --
Status Z
Description: The content of T0MD is loaded by affected:
ACC.
Description: Exclusive-OR ACC with R. If d is 0,
Cycle:
Example:
1
T0MD
W
before executing instruction:
T0MD=0x55, ACC=0xAA.
T
Cycle:
Example:
the result is placed in ACC. If d is
1, the result is stored back to R.
1
XORAR R, d
after executing instruction: before executing instruction:
T0MD=0xAA. R=0xA5, ACC=0xF0, d=1.
after executing instruction:
h
A
R=0x55.
ec
-T
T0MDR Move T0MD to ACC XORIA Exclusive-OR Immediate with
ACC
W
ACC=0x55.
TW
h
AT8A53D
ec
5. Configuration Words
Item Name Options
-T
1 High Oscillator Frequency 1. I_HRC 2. E_HXT 3. E_XT
4
W
High Crystal Oscillator
T 4.
1.
3.
8MHz
6MHz<FHOSC≦8MHz
10MHz<FHOSC≦12MHz
5. 16MHz
2.
4.
6. 20MHz
8MHz<FHOSC≦10MHz
12MHz<FHOSC≦16MHz
5. 16MHz<FHOSC≦20MHz
h
A
8
WDT Event
Timer0 source
ec 1. Watchdog Reset
1. EX_CKI
2. Watchdog Interrupt
2. Low Oscillator
-T
9 PB.3 1. PB.3 is I/O 2. PB.3 is reset
h
AT8A53D
ec
6. Electrical Characteristics
6.1 Absolute Maximum Rating
-T
Symbol Parameter Rated Value Unit
VDD - VSS Supply voltage -0.5 ~ +6.0 V
VIN Input voltage VSS-0.3V ~ VDD+0.3 V
TOP Operating Temperature -40 ~ +85 °C
6.2
TST
DC Characteristics
T W
Storage Temperature -40 ~ +125 °C
(All refer FINST=FHOSC/4, FHOSC=16MHz@I_HRC, WDT enabled, ambient temperature TA=25°C unless otherwise specified.)
Symbol Parameter VDD Min. Typ. Max. Unit Condition
h
A
3.3 FINST=20MHz @ I_HRC/2
2.2 FINST=20MHz @ I_HRC/4
VDD
ec
Operating voltage --
3.0
2.0
2.0 -- 5.5 V
FINST=16MHz @ E_HXT/2
FINST=16MHz @ E_HXT/4
FINST=8MHz @ I_HRC/4 & I_HRC/2
-T
FINST=8MHz @ E_HXT/4 & E_HXT/2
FINST=4MHz @ I_HRC/4 & I_HRC/2
1.8
FINST=4MHz @ E_XT/4 & E_XT/2
FINST=32KHz @ I_LRC/4 & I_LRC/2
1.8
W
V RSTb (0.2VDD)
3V -- -- 0.6
5V -- -- 1.5 All other I/O pins, EX_CKI, INT
VIL Input low voltage V
3V -- -- 0.9 CMOS (0.3VDD)
-T
5V -- 40 --
IOL Output low current mA VOL=1.0V
3V -- 26 --
5V -- 40 --
IIR IR sink current mA Normal IR
3V -- 26 --
h
AT8A53D
ec
Symbol Parameter VDD Min. Typ. Max. Unit Condition
Normal Mode
5V -- 2.7 --
-T
mA FHOSC=20MHz @ I_HRC/2 & E_HXT/2
3V -- 1.3 --
5V -- 2.1 --
mA FHOSC=20MHz @ I_HRC/4 & E_HXT/4
3V -- 1.0 --
5V -- 2.4 --
T W 3V
5V
3V
5V
--
--
--
--
1.1
1.9
0.8
1.5
--
--
--
--
mA
mA
FHOSC=16MHz @ I_HRC/2 & E_HXT/2
h
mA FHOSC=8MHz @ I_HRC/4 & E_HXT/4
A
3V -- 0.5 --
5V -- 1.1 --
IOP
ec
Operating current
3V
5V
3V
--
--
--
0.5
0.9
0.4
--
--
--
mA
mA
FHOSC=4MHz @ I_HRC/2 & E_HXT/2
Slow mode
5V -- 6.0 -- FHOSC disabled,
uA
3V -- 2.7 -- FLOSC=32KHz @ I_LRC/2
5V -- 7.0 -- FHOSC disabled,
T
uA
3V -- 2.9 -- FLOSC=32KHz @ E_LXT/2.
5V -- 4.3 -- FHOSC disabled,
uA
h
FLOSC=32KHz @ I_LRC/4
A
3V -- 1.8 --
5V -- 5.3 -- FHOSC disabled,
uA
ec
5V -- 50 --
RPH Pull-High resistor kΩ Pull-High resistor
3V -- 100 --
5V -- 50 --
RPL Pull-Low resistor kΩ Pull-Low resistor
3V -- 100 --
h
AT8A53D
ec
6.3 OSC Characteristics
(Measurement conditions VDD Voltage, TA Temperature are equal to programming conditions.)
-T
I_HRC deviation by socket ±1 % Socket installed directly on writer.
h
A
ec
-T
W
h
A
ec
-T
TW
h
AT8A53D
ec
6.4.3 Frequency vs. VDD of I_LRC
-T
T W
h
A
ec
6.4.4 Frequency vs. Temperature of I_LRC
-T
T W
h
A
LVR :
LVR : default
Frequency Min. Voltage Max. Voltage Recommended
( 25 °C)
(-40 °C ~ +85 °C)
-T
h
AT8A53D
ec
6.6 LVR vs. Temperature
-T
T W
h
A
ec
-T
7. Die Pad Diagram
T W
h
A
ec
-T
TW
h
AT8A53D
ec
8. Package Dimension
8.1 8-Pin Plastic SOP (150 mil)
-T
T W
h
A
ec
-T
Note: For 8-pin SOP, 100 units per tube.
h
A
ec
-T
h
AT8A53D
ec
8.3 14-Pin Plastic DIP (300 mil)
-T
T W
h
A
9. Ordering Information
P/N
ec
Package Type Pin Count Package Width Shipping
-T
AT8A53D Die -- -- --
Tape & Reel: 2.5K pcs per Reel
AT8A53DS8 SOP 8 150 mil
Tube: 100 pcs per Tube
Tape & Reel: 2.5K pcs per Reel
W
h
A
ec
-T
TW