Holtek HT85F2270 Manual

Standard 8051 8-bit flash mcu
Table of Contents

Advertisement

Quick Links

Standard 8051 8-Bit Flash MCU
HT85F2260
HT85F2270
HT85F2280
Revision: V1.00
Date: �an�a�� 1�� �01�
�an�a�� 1�� �01�

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the HT85F2270 and is the answer not in the manual?

Questions and answers

Summary of Contents for Holtek HT85F2270

  • Page 1 Standard 8051 8-Bit Flash MCU HT85F2260 HT85F2270 HT85F2280 Revision: V1.00 Date: �an�a�� 1�� �01� �an�a�� 1�� �01�...
  • Page 2: Table Of Contents

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Table of Contents 1 Features ......................... 14 CPU Feat��es........................14 Pe�iphe�al Feat��es ......................1� 2 General Description ..................... 16 3 Selection Table ...................... 17 4 Block Diagram ....................... 18 5 Pin Assignment ..................... 19 6 Pin Descriptions ....................
  • Page 3 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 P�og�am Memo�� P�otection ..................... 4� Memo�� P�otection Cont�ol B�tes ....................4� 19 RAM Data Memory ....................46 St��ct��e ..........................46 Registe� Banks ........................�0 Bit Add�essable Space ...................... �0 Special F�nction Registe�s....................�� ACC Registe� – Acc�m�lato� ......................�3 B Registe�...
  • Page 4 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 23 Low Voltage Detector – LVD ................75 LVD Registe� ........................7� LVD Ope�ation ........................7� 24 Reset and Initialisation ..................76 Reset Ove�view ......................... 76 Reset Ope�ations ......................77 Reset So��ce Registe� – RSTSRC....................77 Powe�-on Reset ..........................
  • Page 5 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 26 Input/Output Ports .................... 117 Inp�t/O�tp�t Po�t Ove�view ..................... 117 Registe� Desc�iption ......................118 PnM0/PnM1 Registe�s – Po�t Mode Registe�s ................1�0 P0WAKE Registe� – Po�t 0 Wake-�p ..................1�� SRCR Registe� – Slew Rate Cont�ol ..................1��...
  • Page 6 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 30 Analog to Digital Converter – ADC ..............152 A/D Ove�view ........................1�� A/D Conve�te� Registe� Desc�iption ................1�3 A/D Conve�te� Data Registe�s – ADRL� ADRH ............... 1�3 A/D Conve�te� Cont�ol Registe�s – ADCR0� ADCR1� ADCR�� ADPGA ......1�3 A/D Ope�ation........................
  • Page 7 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 35 Serial Interface – SPI ..................189 SPI Inte�face Ope�ation ....................189 SPI Feat��es..........................190 SPI Registe�s ........................191 SPI Comm�nication......................194 36 UART Serial Interfaces – UART0 and UART1 ..........197 UART Ove�view ....................... 197 UART0 Feat��es .........................
  • Page 8 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 List of Tables P�og�am Memo�� Registe� List ........................ 33 FMAR0 Registe� – Flash P�og�am Memo�� Add�ess Registe� 0 ............. 33 FMAR1 Registe� – Flash P�og�am Memo�� Add�ess Registe� 1 ............. 34 FMAR� Registe� – Flash P�og�am Memo�� Add�ess Registe� � ............. 34 FMDR Registe�...
  • Page 9 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Inte���pt Registe� Bit Naming Conventions ..................... 9� Inte���pt Registe� Contents ........................93 IEN0 Registe� ............................93 IEN1 Registe� ............................94 IEN� Registe� ............................94 IEN3 Registe� ............................9� IRCON Registe� ............................96 IRCON� Registe� ............................. 97 S0CON Registe�...
  • Page 10 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 P3M1 Registe� ............................1�� P0WAKE Registe� ..........................1�3 SRCR Registe� ............................1�3 Time� F�nction S�mma�� ........................1�7 Time�0/Time�1/Time�3 Registe� List ....................... 1�9 TL0 Registe� ............................1�9 TH0 Registe� ............................130 TL1 Registe� ............................130 TH1 Registe�...
  • Page 11 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 I�CADR Registe� ........................... 180 C Stat�s in Maste� T�ansmitte� Mode ....................18� � C Stat�s in Maste� Receive� Mode ..................... 186 � C Stat�s in Slave Receive� Mode ......................187 � C Stat�s in Slave T�ansmitte� Mode ....................188 �...
  • Page 12 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 List of Figures Stack Block Diag�am ..........................�9 P�og�am Memo�� St��ct��e ........................31 Unlock P�oced��e Flowcha�t ........................37 Page E�ase Flowcha�t ..........................38 B�te Read Flowcha�t ..........................39 B�te W�ite Flowcha�t (FMCR.0=1� FMCR.6=0) ..................40 B�te W�ite Flowcha�t (FMCR.0=1�...
  • Page 13 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Voltage Refe�ence Gene�ato� Block Diag�am ..................169 Compa�ato� 0 ............................170 Compa�ato� 1 ............................171 C Maste� Slave B�s Connection ......................177 � C Inte�face Ope�ation Flow ........................177 � � C Block Diag�am ..........................181 C B�s Initialisation Flow Cha�t ......................
  • Page 14: Features

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Features CPU Features Operating Voltage: ■ ● =3.6864MHz: 2.2V~5.5V ● =8MHz: 2.2V~5.5V ● =12MHz: 2.7V~5.5V ● =24MHz: 4.5V~5.5V Program Memory Capacity: 16K×8~64K×8 ■ Data Memory Capacity: 1280×8~2304×8 ■ High performance 1-T architecture: 8051 ■...
  • Page 15 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Peripheral Features Multi-channel 12-bit resolution A/D converter ■ Single 12-bit D/A Converter ■ Serial SPI Interface ■ C Interface ■ Dual UART Interfaces ■ Dual Comparator functions ■ Up to 48 bidirectional I/O lines ■...
  • Page 16: General Description

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 General Description The HT85F22x0 series of devices are Flash Memory A/D type high performance 1-T architecture 8051-Based microcontrollers. Offering users the convenience of Flash Memory multi-programming features, these devices also include a wide range of functions and features.
  • Page 17: Selection Table

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Selection Table Most features are common to all devices, the main feature distinguishing them are Program Memory and Data memory capacity, A/D channels, UART numbers and packages. The following table summarises the main features of each device.
  • Page 18: Block Diagram

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Block Diagram The following block diagram illustrates the main functional blocks. 3.6864MHz 32768Hz × × Rev. 1.00 18 of ��� �an�a�� 1�� �01�...
  • Page 19: Pin Assignment

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Pin Assignment 4 8 4 7 4 6 4 5 4 4 4 3 4 2 4 1 4 0 3 9 3 8 3 7 P 0 . 3 / S C K P 2 .
  • Page 20: Pin Descriptions

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Pin Descriptions With the exception of the power pins, all pins on these devices can be referenced by their Port name, e.g. P0.0, P0.1 etc, which refer to the digital I/O function of the pins. However these Port pins are also shared with other function such as the Analog to Digital Converter, Serial Port pins etc.
  • Page 21 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Pin Name Function Description P1M0 P1.3 CMOS Gene�al p��pose I/O. Registe� selected I/O mode P1M1 P1.3/INT6/CC3 INT6 — — Exte�nal Inte���pt 6 Inp�t — CMOS Compa�e/Capt��e inp�t/o�tp�t fo� PCA mod�le 3 P1M0 P1.4 CMOS Gene�al p��pose I/O. Registe� selected I/O mode P1M1 P1.4/INT�...
  • Page 22: Compa�Ato� 0

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Pin Name Function Description P4M0 P4.3 CMOS Gene�al p��pose I/O. Registe� selected I/O mode P4M1 P4.3/AIN.3 AIN.3 — — ADC Inp�t Channel 3 P4M0 P4.4 CMOS Gene�al p��pose I/O. Registe� selected I/O mode P4M1 P4.4/AIN.4...
  • Page 23: Absolute Maximum Ratings

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Absolute Maximum Ratings Supply Voltage ....................V -0.3V to V +6.0V Input Voltage ....................V -0.3V to V +0.3V Storage Temperature ....................-50°C to 125°C Operating Temperature ....................-40°C to 85°C ............................150mA Total Total ........................... -100mA Total Power Dissipation ......................500mW...
  • Page 24 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Test Conditions Symbol Parameter Min. Typ. Max. Unit Conditions — — 1.� Stanb� C���ent No load� All pe�iphe�als off μA STB1 (Powe�-Down mode)(HIRC off� HXT off) �V — — �.� No load� f =4MHz (C��stal OSC) —...
  • Page 25 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 A.C. Characteristics Ta=��°C Test Conditions Symbol Parameter Min. Typ. Max. Unit Conditions �.�V~�.�V — S�stem clock (C��stal OSC) �.7V~�.�V PLL Disable — 1� SYS1 4.�V~�.�V — �4 S�stem clock (PLL) 4.�V~�.�V C��stal OSC=4MHz� PLL Enable —...
  • Page 26: Adc Electrical Characteristics

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 ADC Electrical Characteristics Ta=��°C Test Conditions Symbol Parameter Min. Typ. Max. Unit Conditions A/D Conve�te� Ope�ating Voltage — — �.7 — �.� — VREF available — A/D Conve�te� Inp�t Voltage — VREF not available —...
  • Page 27: Comparator Electrical Characteristics

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Comparator Electrical Characteristics Ta=��°C Test Conditions Parameter Unit Symbol Min. Typ. Max. Conditions — Compa�ato� ope�ating voltage — — �.� — �.� LVDCR=00h� ADCR1=08h� i.e. select — Compa�ato� ope�ating c���ent �V inte�nal bandgap voltage o�tp�t (x�) —...
  • Page 28: Power On Reset Electrical Characteristics

    T i m e System Architecture A key factor in the high-performance features of the Holtek range of microcontrollers is attributed to their internal system architecture. The range of devices take advantage of the usual features found within 8051-based microcontrollers providing increased speed of operation and enhanced performance.
  • Page 29: Program Counter

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Program Counter During program execution, the Program Counter is used to keep track of the address of the next instruction to be executed. It is automatically incremented by one each time an instruction is executed except for instructions, such as “JMP” or “CALL” that demand a jump to a non-consecutive Program Memory address.
  • Page 30: Arithmetic And Logic Unit - Alu

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Arithmetic and Logic Unit – ALU The arithmetic-logic unit or ALU is a critical area of the microcontroller that carries out arithmetic and logic operations of the instruction set. Connected to the main microcontroller data bus, the ALU receives related instruction codes and performs the required arithmetic or logical operations after which the result will be placed in the specified register.
  • Page 31: Flash Program Memory

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Flash Program Memory The Program Memory is the location where the user code or program is stored. For these devices the Program Memory is Flash type, which means it can be programmed and re-programmed a large number of times, allowing the user the convenience of code modification on the same device.
  • Page 32: On-Chip Deb�G S�Ppo�T - Ocds

    Users can use the EV chip device to emulate the real chip device behavior by connecting the TDA and TCK pins to the related Holtek development tools. The TDA pin is the OCDS Data/Address input/output pin while the TCK pin is the OCDS clock input pin. When users use the EV chip for debugging, other functions which are shared with the TDA and TCK pins in the actual MCU device will have no effect in the EV chip.
  • Page 33 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 In-Application Programming – IAP An In-Application Programming interface is provided to allow the end user’s application to erase and reprogram the user code memory. No extra code memory block (bootloader) is required to update the firmware or non-volatile data. Firmware for the IAP and the code memory to be updated are physically on the same IP.
  • Page 34 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 FMAR1 Register – Flash Program Memory Address Register 1 SFR Address: FBh Name FADDR1� FADDR14 FADDR13 FADDR1� FADDR11 FADDR10 FADDR9 FADDR8 Bit 7~0 Flash Program Memory address Flash Program Memory address bit 15~bit 8 FMAR2 Register –...
  • Page 35 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 FMCR Register – Flash Program Memory Control Register SFR Address: F8h Name FMCR.7 FMCR.6 — — — FMCR.� FMCR.1 FMCR.0 — — — — — — FMCR.7: Flash Memory Read/Write/Erase enable control bit Bit 7...
  • Page 36 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 FMKEY Register – Flash Program Memory Unlock Key Data Register SFR Address: F9h Name FMKEY7 FMKEY6 FMKEY� FMKEY4 FMKEY3 FMKEY � FMKEY 1 FMKEY 0 Bit 7~0 Flash Memory Unlock Key Data register Unlock Data bits 7~bit 0 The FMKEY register is the Flash Memory Unlock key data register.
  • Page 37: Flash Memo�� Is In

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Flash Memory Read/Write Operations The flash memory can be read from and written to using register operations. To ensure protection of application data certain protection measures have to be first carried out before any read and write operations are executed on the Flash Memory.
  • Page 38: Page E�Ase Ope�Ation

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Page Erase Operation The Flash Memory must be first unlocked before implementing a page erase procedure. The flash memory address is setup using the control registers, FMAR0, FMAR1 and FMAR2. The Flash Memory Page Erase function is selected by the control bit, FMCR.2, in the FMCR register.
  • Page 39 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Byte Read Operation The Flash memory must be first unlocked before implementing a byte read procedure. The flash memory address is setup using the control registers, FMAR0, FMAR1 and FMAR2. The Flash Memory Page Read function is selected by the control bit, FMCR.1, in the FMCR register. When the FMCR.7 bit is set high the Byte Read procedure will be initiated.
  • Page 40 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Byte Write Operation The Flash Memory must be first unlocked before implementing a Byte Write procedure. The first step is to assign the target memory page and erase it. Refer to the Page Erase Operation section for details.
  • Page 41 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 START Flash memo�� cont�olle� m�st be In �nlocked state FMCR Bit 0 = 1 and FMCR Bit 6 = 1 (*) W�ite FMAR� W�ite FMAR1 W�ite FMAR0 Update the Page B�ffe� B� w�iting FMDR Ente�...
  • Page 42: Memo

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Program Memory Protection The flash program memory is partitioned into 2 memory blocks. One is the main memory block and the other is the ID block. The ID block size is 256 bytes and is used to setup the protected sectors.
  • Page 43 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Security Type 2 ■ For the HT85F2280 device, the inhibit bytes SECURITY2[0:15] are located at the addresses 0x10~0x1F of the ID block page 0. If a value, with the exception of 0FFH, is written into these bytes, the sectors corresponding to SECURITY2[0:15] cannot be programmed, erased or read when in any mode.
  • Page 44 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 HT85F2270 Program Memory Contents The HT85F2270 program memory is divided into 8 sectors, each with a capacity of 4k bytes. Page Address Description 0x00~0x07 SECURITY1[0]~SECURITY1[7] 0x08~0x0F Not �sed 0x10~0x17 SECURITY�[0]~SECURITY�[7] 0x18~0x1F Not �sed 0x�0~0x6F Rese�ved...
  • Page 45 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 These two types of flash memory inhibited bytes, SECURITY1[N] and SECURITY2[N], are used for Program Memory protection. However, the SECURITY2[N] bytes have the higher priority. If data has be written to the SECURITY2[N] bytes, the corresponding sectors will be protected and cannot be read from or written to, no matter what data is in the SECURITY1[N] bytes.
  • Page 46: Ram Data Memory

    00H to 1FH. The XDATA is assigned as General Purpose Data RAM and can only be accessed using indirect addressing. The HT85F2270 and HT85F2280 have 2048-bytes of XDATA while the HT85F2260 has 1024-bytes of XDATA.
  • Page 47: Bit Add�Essable Space

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 … … … Uppe� 1�8 B�tes Upper Gene�al P��pose RAM Special F�nction Registe�s Section (Indi�ect Access) (Di�ect Access) (128 bytes) … … … Lowe� 80 B�tes Gene�al P��pose RAM Lower Section Both di�ect and Bit-Add�essable Space...
  • Page 48 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 FFFFH (RESERVED) 0800H 07FFH … … RAM (�048 b�tes) 0000H 8-bit HT85F2270/HT85F2280 XDATA Rev. 1.00 48 of ��� �an�a�� 1�� �01�...
  • Page 49 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 FFFFH (RESERVED) 0400H 03FFH … … RAM (10�4 b�tes) 0000H 8-bit HT85F2260 XDATA Rev. 1.00 49 of ��� �an�a�� 1�� �01�...
  • Page 50 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Register Banks There are four register banks, with addresses from 00H to 1FH, with each bank containing eight bytes. The active bank is selected by the control bits, RS1 and RS0, in the PSW register. It should be noted that only one bank can be enabled at any time.
  • Page 51 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 There are also 16 bytes of bit addressable registers located in the SFR which are both byte and bit addressable. These bit addressable registers in the SFR are registers whose addresses end with the low 3-bit address of “000b”, such as 80h, 88h, 90h…F8h, etc.
  • Page 52 All can be addressed by byte but some are also bit-addressable. The following table shows the SFR register list. Note that some of the registers are defined by standard 8051 protocol while others are defined by Holtek. Special Function Register Map...
  • Page 53: B Registe

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 ACC Register – Accumulator The Accumulator is central to the operation of any microcontroller and is closely related with operations carried out by the ALU. The Accumulator is the place where all intermediate results from the ALU are stored.
  • Page 54: Data Pointe� Select Registe

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Data Pointer Select Registers The devices contain up to two data pointers, depending on configuration. Each of these registers can be used as 16-bits address source for indirect addressing. The DPS register serves to select the active data pointer register.
  • Page 55 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 DPC Register – Data Pointer Control Register SFR Address: 93h Name — — — — DPC3 DPC� DPC1 DPC0 — — — — — — — — Bit 7~4 Unimplemented, read as “0” Bit 3 DPC3: Next Data Pointer select The content of this bit will be loaded to the “DPS”...
  • Page 56 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Program Status Word This register contains the Parity flag (P), General purpose flag 1 (F1), overflow flag (OV), Register bank select control bits (RS0, RS1), General purpose flag 0 (F0), Auxiliary Carry flag (AC) and Carry flag (CY).
  • Page 57: Oscillators

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Oscillators Various oscillator options offer the user a wide range of functions according to their various application requirements. The flexible features of the oscillator functions ensure that the best optimisation can be achieved in terms of speed and power saving. Oscillator selections and operation are selected using internal registers.
  • Page 58 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 I n t e r n a l O S C 1 O s c i l l a t o r C i r c u i t T o i n t e r n a l...
  • Page 59 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 I n t e r n a l O s c i l l a t o r C i r c u i t 3 2 7 6 8 H z I n t e r n a l R C...
  • Page 60: Operating Modes And System Clocks

    The fast clocks required for high performance will inherently have a higher power consumption and of course vice-versa, lower speed clocks will have a lower power consumption. As Holtek has provided these devices with a range of oscillators and a PLL function the user can optimise the system clock frequency to achieve the best performance/power ratio.
  • Page 61 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Exte�nal C��stal Oscillato� CPU clock X1~X8 HXTEN bit PLLM[�:0] enable/disable IDL bit PLLSRC SCKS[1:0] - enable/disable CPU clock Inte�nal RC Oscillato� HIRC HIRCEN bit enable/disable Inte�nal RC Oscillato� LIRC Watchdog Time� 3�k Exte�nal C��stal Oscillato�...
  • Page 62 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 The main system clock source, known as f , and which is used by the CPU and the peripheral functions, can come from one of three sources. These are the internal HIRC oscillator, the external crystal HXT oscillator or a frequency multiplied version of these oscillators using the internal PLL.
  • Page 63 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 High Speed Oscillator Control Register – HSOCR SFR Address: EFh Name — — HXTRDY HIRCRDY — — HXTEN HIRCEN — — — — — — — — Bit 7~6 Unimplemented, read as “0” Bit 5...
  • Page 64: Phase Locked Loop - Pll

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Phase Locked Loop – PLL All devices contain a fully internal PLL function which is used to multiply the frequency of the selected high speed oscillator, either HIRC or HXT. As all PLL functions are internal, no external components, including those for the loop filter, are required.
  • Page 65 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 PLL Control Register – PLLCR SFR Address: EDh Name PLLEN PLLRDY — PLLSRC — PLLM� PLLM1 PLLM0 — — — — PLLEN: PLL enable/disable control Bit 7 0: PLL disable 1: PLL enable PLLRDY: PLL output ready indication flag...
  • Page 66: Normal Mode

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Operation Modes There are three different modes of operation for the microcontroller, each one with its own special characteristics and which can be chosen according to the specific performance and power requirements of the application. There is one mode allowing normal operation of the microcontroller, the NORMAL Mode, in which all oscillators and function remain active.
  • Page 67 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Power Control Register Two bits, PD and IDL, in the PCON register control overall mode selection. PCON Register – Power Control Register SFR Address: 87h Name SMOD — — — — — — —...
  • Page 68 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Wake-up After the system enters the IDLE or Power-Down Mode, it can be woken up from one of various sources listed as follows: An external reset ■ An external low level on any P0 I/O pin ■...
  • Page 69: Watchdog Timer

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Watchdog Timer The Watchdog Timer, also known as the WDT, is provided to inhibit program malfunctions caused by the program jumping to unknown locations or entering endless program loops, due to certain uncontrollable external events such as electrical noise. Its basic structure is a 16-bit timer which when it overflows will execute an MCU reset operation.
  • Page 70: Ien0 Registe

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Watchdog Registers There are several registers for overall watchdog timer operation. The WDTREL register is used to setup the reload value of the Watchdog Timer. The remaining four registers are control registers which setup the operating and control function of the WDT function. The WDTCR register controls the WDT enable/disable operation, software reset and clock source select functions.
  • Page 71: Ien1 Registe

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 IEN1 Register SFR Address: A9h Name EXEN� SWDT ECMP EX� Bit 7 EXEN2: Timer2 external reload interrupt enable Described elsewhere Bit 6 SWDT: Watchdog timer start/refresh flag This bit is used to activate and refresh the watchdog timer.
  • Page 72: Ip0 Registe

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 WDTCR Register SFR Address: 96h Name WE� — — WDTCS — — — — WE4~WE0: WDT function software control Bit 7~3 10101: Disable 01010: Enable - default Other values: Reset MCU Bit 2~1 Unimplemented, read as “0”...
  • Page 73 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Watchdog Timer Clock Source The Watchdog Timer clock source is provided by an internal clock which is in turn supplied by one of three sources selected by the WDTCS bit in the WDTCR register: a 32kHz clock or f /16.
  • Page 74 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 WDT running Program sets WDT bit Must not insert other instructions here Program sets SWDT bit WDT loaded with WDTREL register value H/W auto Clear WDT bit H/W auto Clear SWDT bit WDT continues running Watchdog Timer Refresh Operation Rev.
  • Page 75: Low Voltage Detector - Lvd

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Low Voltage Detector – LVD Each device has a Low Voltage Detector function, also known as LVD. This enables the device to monitor the power supply voltage, V , and provide an interrupt should it fall below a certain level.
  • Page 76: Reset And Initialisation

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Reset and Initialisation A reset function is a fundamental part of any microcontroller ensuring that the device can be set to some predetermined condition irrespective of outside parameters. A hardware reset will of course...
  • Page 77: Rstsrc Registe

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Reset Operations After the initial power on reset, there are many ways in which a microcontroller reset can occur, through events occurring both internally and externally. Reset Source Register – RSTSRC After a reset occurs the device will be reset to some initial condition. Several registers are used to indicate which actual reset type caused the device to reset.
  • Page 78 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Power-on Reset The most fundamental and unavoidable reset is the one that occurs after power is first applied to the microcontroller. As well as ensuring that the Program Memory begins execution from the first memory address, a power-on reset also ensures that certain other registers are preset to known conditions.
  • Page 79: Reset Pin Reset

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 RESET Pin Reset For most applications a resistor connected between VDD and the RESET pin and a capacitor connected between VSS and the RESET pin will provide a suitable external reset circuit. Any wiring connected to the RESET pin should be kept as short as possible to minimise any stray noise interference.
  • Page 80: Low Voltage Reset - Lvr

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Low Voltage Reset – LVR The microcontroller contains a low voltage reset circuit in order to monitor the supply voltage of the device and provide an MCU reset should the value fall below a certain predefined level.
  • Page 81: Watchdog Reset

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Watchdog Reset All devices contain a Watchdog Timer which is used as a protection feature. The Watchdog Timer has to be periodically cleared by the application program and prevented from overflowing during normal MCU operation. However should the program enter an endless loop or should external environmental conditions such as noise causes the device to jump to unpredicted program locations, the Watchdog Timer will overflow from FFFFh to 0000h, and generate an MCU reset.
  • Page 82: Compa�Ato� 0 Reset

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Comparator 0 Reset Comparator 0 contains an output reset function which can provide a reset when the output of Comparator 0 changes state. The Comparator 0 reset function is enabled by setting the CP0RST bit in the CP0CR register.
  • Page 83: Srst Registe� Softwa�E Reset

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Software Resets There are three ways to generate Software Reset, each of which are generated by writing certain values to the SRST register, the WDTCR register or the LVRCR register. Software Reset Summary Software Reset Name...
  • Page 84: Wdtcr Registe

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 WDTCR Register Software Reset A WDTCR software reset will be generated when a value other than “10101” or “01010”, exist in the highest five bits of the WDTCR register. The WRF bit in the RSTSRC register will be set high when this occurs, thus indicating the generation of a WDTCR software reset.
  • Page 85: Rom Code Check Reset

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 ROM Code Check Reset ID block addresses 0xF0~0xFF can be written into ROM codes such as the following table shows, or a value of FFH which means no ROM codes are written into these addresses. When reading the...
  • Page 86 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 WDT Time-out Register Name Power-On Reset External Reset Software Reset Reset P�og�am Co�nte� 0000h 0000h 0000h 0000h 1111_1111b 1111_1111b 1111_1111b 1111_1111b 0000_0111b 0000_0111b 0000_0111b 0000_0111b 0000_0000b 0000_0000b 0000_0000b 0000_0000b 0000_0000b 0000_0000b 0000_0000b 0000_0000b DPL1...
  • Page 87 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 WDT Time-out Register Name Power-On Reset External Reset Software Reset Reset P3M0 0000_0000b 0000_0000b 0000_0000b 0000_0000b P3M1 0000_0000b 0000_0000b 0000_0000b 0000_0000b -000_0000b -000_0000b -100_0000b -000_0000b IP0H --00_0000b --00_0000b --00_0000b --00_0000b S0RELH - - - - _ - - 1 1 b...
  • Page 88 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 WDT Time-out Register Name Power-On Reset External Reset Software Reset Reset LSOCR - - - 1 _ - - 0 - b - - - 1 _ - - 0 - b - - - 1 _ - - 0 - b...
  • Page 89 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Register Name WDTCR Reset LVR Reset LVRCR Reset Comparator0 Reset S1RELL 0000_0000b 0000_0000b 0000_0000b 0000_0000b P0M0 0000_0000b 0000_0000b 0000_0000b 0000_0000b P0M1 0000_0000b 0000_0000b 0000_0000b 0000_0000b P� 1111_1111b 1111_1111b 1111_1111b 1111_1111b T3CON 0000_--00b 0000_--00b 0000_--00b...
  • Page 90 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Register Name WDTCR Reset LVR Reset LVRCR Reset Comparator0 Reset P� 1111_1111b 1111_1111b 1111_1111b 1111_1111b I�CDAT 0000_0000b 0000_0000b 0000_0000b 0000_0000b I�CADR 0000_0000b 0000_0000b 0000_0000b 0000_0000b SBRCON 0 0 - - _ - - - - b...
  • Page 91: Interrupts

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Interrupts Interrupts are an important part of any microcontroller system. When an external event or an internal function such as a Timer/Event Counter or Time Base requires microcontroller attention, their corresponding interrupt will enforce a temporary suspension of the main program allowing the microcontroller to direct attention to their respective needs.
  • Page 92: Inte

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Interrupt Register Contents Name Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 IEN0 (WDT) ET� IEN1 EXEN� (SWDT) ECMP EX� IEN� — — — — — ELVD EX� IEN3 — — — — EADC EI�C...
  • Page 93 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 IEN1 Register SFR Address: A9h Name EXEN� SWDT ECMP EX� EXEN2: Timer 2 external reload interrupt enable Bit 7 0: Disable 1: Enable SWDT: Watchdog timer start/refresh flag Bit 6 Described elsewhere ET3: Timer3 interrupt enable...
  • Page 94: Ien3 Registe

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 IEN3 Register SFR Address: C9h Name — — — — EADC EI�C ESPI — — — — — — — — Bit 7~4 Unimplemented, read as "0" Bit 3 ETB: Time Base interrupt enable...
  • Page 95: Ircon Registe

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 IRCON Register SFR Address: C0h Name EXF� TF� IEX6 IEX� IEX4 IEX3 IEX� — — — EXF2: Timer 2 external reload interrupt request flag Bit 7 0: No request 1: Interrupt request The EXF2 bit will be set high by a negative transition on the T2EX pin. This bit must be cleared using the application program.
  • Page 96 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 IRCON2 Register SFR Address: BFh Name — — — — LVDF CMPF IDAC — — — — — — — — Bit 7~4 Unimplemented, read as "0" Bit 3 LVDF: LVD interrupt request flag...
  • Page 97: S0Con Registe

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 S0CON Register SFR Address: 98h Name SM�0 REN0 TB80 RB80 SM0~SM1: UART 0 mode select bits Bit 7~6 Described elsewhere SM20: Multiprocessor communication enable control Bit 5 Described elsewhere Bit 4 REN0: UART 0 serial data reception enable...
  • Page 98: S1Con Registe

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 S1CON Register SFR Address: 9Bh Name — SM�1 REN1 TB81 RB81 — — SM: UART 1 operating mode select bit Bit 7 Described elsewhere Bit 6 Unimplemented, read as "0" Bit 5 SM21: Multiprocessor communication enable control...
  • Page 99: Tcon Registe

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 TCON Register SFR Address: 88h Name TF1: Timer 1 interrupt request flag Bit 7 0: No request 1: Interrupt request This bit will be cleared by hardware automatically. Bit 6 TR1: Timer 1 Run control...
  • Page 100: T3Con Registe

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 T2CON Register SFR Address: C8h Name — I3FR I�FR T�R1 T�R0 T�CM T�I1 T�I0 — — Bit 7 Unimplemented, read as "0" Bit 6 I3FR: Active edge selection for external interrupt “INT3” and PCA module 0...
  • Page 101: Spsta Registe

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 SPSTA Register SFR Address: E1h Name SPIF WCOL SSERR MODF — — — — — — — — — — — — SPIF: SPI Transmit/Receive Complete flag Bit 7 0: Data is being transferred...
  • Page 102: Cpicr Registe

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 CPICR Register SFR Address: BEh Name CP1IF CP1IEN CP1P1 CP1P0 CP0IF CP0IEN CP0P1 CP0P0 Bit 7 CP1IF: Comparator 1 Output Transition Interrupt Request Flag 0: No request 1: Interrupt request This bit should be cleared using the application program.
  • Page 103 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 I2CCON Register SFR Address: D8h Name — ENS1 — — — — — — — — Bit 7 Unimplemented, read as "0" ENS1: I Bit 6 C Enable Control Described elsewhere STA: I Bit 5...
  • Page 104: Inte

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Inte���pt Req�est Enable Maste� Vector P�io�it� Name Flags Bits Enable High INT0 Pin Legend Time� 0 Req�est Flag – no a�to �eset in ISR INT1 Pin Req�est Flag – a�to �eset in ISR Time� 1 Enable Bit �3H...
  • Page 105 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Once an interrupt subroutine is serviced, all the other interrupts must be blocked by clearing the EAL bit using the application program. This will prevent any further interrupt nesting from occurring. However, if other interrupt requests occur during this interval, although the interrupt will not be immediately serviced, the request flag will still be recorded.
  • Page 106 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Interrupt Priority In case of simultaneous requests, the following table shows the priority that is applied. The interrupts can be assigned into groups. Higher priority interrupts can stop the lower priority interrupts. All interrupts are categorised into 19 groups with 4 priority levels. In cases where...
  • Page 107: Inte

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Interrupt Service Interrupt Source Priority Control Group Priority Vector Priority Reset 0000H Alwa�s Highest Highest P�io�it� Exte�nal Inte���pt 0 (INT0) 0003H PX0H(IP0H.0)/PX0(IP0.0) ↓ Timer 0 Overflow Interrupt 000BH PT0H(IP0H.1)/PT0(IP0.1) ↓ Exte�nal Inte���pt 1 (INT1) 0013H �...
  • Page 108 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Priority Control Registers Low byte of Interrupt Priority Register 0: IP0 SFR Address: B8h Name — WDTS PT� — — Bit 7 Unimplemented, read as “0” Bit 6 WDTS: Watchdog timer reset indication flag...
  • Page 109 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Low byte of Interrupt Priority Register 1: IP1 SFR Address: E4h Name — — PCMP PX� — — — — Bit 7~6 Unimplemented, read as “0” Bit 5 PT3: Timer 3 Interrupt priority low Low order bit for Timer 3 interrupt priority level.
  • Page 110 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Low byte of Interrupt Priority Register 2: IP2 SFR Address: E6h Name — — — — — PLVD PX� — — — — — — — — — — Bit 7~3 Unimplemented, read as “0”...
  • Page 111 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 How byte of Interrupt Priority Register 3: IP3H SFR Address: CFh Name — — — — PTBH PADCH PI�CH PSPIH — — — — — — — — Bit 7~4 Unimplemented, read as “0”...
  • Page 112 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Comparator Interrupt The comparator interrupts are controlled by the two internal comparators. A comparator interrupt request will take place when the comparator interrupt request flag, CPnIF, is set, a situation that will occur when one of the comparator output bits changes state. This will in turn cause the comparator overall request flag, CMPF, to go high.
  • Page 113 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 A/D Converter Interrupt The A/D Converter Interrupt is controlled by the termination of an A/D conversion process. An A/D Converter Interrupt request will take place when the A/D Converter Interrupt request flag, IADC, is set, which occurs when the A/D conversion process finishes. To allow the program to branch to its respective interrupt vector address, the global interrupt enable bit, EAL, and A/D Interrupt enable bit, EADC, must first be set.
  • Page 114: Tbcr Registe

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 TBCR Register SFR Address: B2h Name TBEN — TBCK1 TBCK0 — TBS� TBS1 TBS0 — — — — TBEN: TB Control bit Bit 7 0: Disable 1: Enable Bit 6 Unimplemented, read as “0”...
  • Page 115 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 SPI Interface Interrupt A SPI Interrupt request will take place when one of the SPI Interrupt request flags, SPIF, WCOL, SSERR or MODF, is set, which occurs when a byte of data has been received or when there is a write collision or when there is a Serial Slave error or transmitted by the SPI interface or the Master mode or Slave mode is mismatched with the mode selected input pin level.
  • Page 116 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Interrupt Wake-up Function Each of the interrupt functions has the capability of waking up the microcontroller when in the IDLE mode, and only INT0 and INT1 interrupts can wake up the microcontroller when in the Power-down mode.
  • Page 117 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Input/Output Ports The devices offer a range of flexible options on their I/O ports. Many pins can be setup with a choice of different register controlled modes as well as having pull-high wake up and slew rate functions.
  • Page 118: P0 Registe

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Register Description This section provides a description of all the registers associated with I/O setup and control. The following table gives a summary of all associated I/O registers, which will be described in detail later.
  • Page 119: P3 Registe

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 P2 Register SFR Address: A0h Name P�.7 P�.6 P�.� P�.4 P�.3 P�.� P�.1 P�.0 P3 Register SFR Address: B0h Name P3.7 P3.6 P3.� P3.4 P3.3 P3.� P3.1 P3.0 P4 Register SFR Address: B1h Name P4.7...
  • Page 120: P0M0 Registe

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 PnM0/PnM1 Registers – Port Mode Registers These registers only exist for Ports 0~3. They are used to setup the I/O operating mode of each pin. As there are four different operating modes for the Port 0~3 pins, each pin has two bits to select the mode, known as the PnM0 and PnM1 bits.
  • Page 121: P3M0 Registe

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Port 2 Mode Control P2M0 Register SFR Address: AEh Name P�M0.7 P�M0.6 P�M0.� P�M0.4 P�M0.3 P�M0.� P�M0.1 P�M0.0 P2M1 Register SFR Address: AFh Name P�M1.7 P�M1.6 P�M1.� P�M1.4 P�M1.3 P�M1.� P�M1.1 P�M1.0 Port 3 Mode Control...
  • Page 122: P0Wake Registe

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 P0WAKE Register – Port 0 Wake-up P0WAKE Register SFR Address: 91h Name P07WU P06WU P0�WU P04WU P03WU P0�WU P01WU P00WU Bit 7~0 P0WAKE: Port 0 bit 7~bit 0 Wake-up Control 0: Disable 1: Enable When the device enters the IDLE or Power-Down Mode, the system clock will stop resulting in power being conserved, a feature that is important for battery and other low-power applications.
  • Page 123 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 I/O Pin Structures The accompanying diagrams illustrate the internal structures of some generic I/O pin types. As the exact logical construction of the I/O pin will differ from these drawings, they are supplied as a guide only to assist with the functional understanding of the I/O pins.
  • Page 124 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Push-pull Output – Ports 0~3 Only This I/O structure is a standard CMOS type structure with a single NMOS and PMOS complimentary transistor pair. The input is a Schmitt Trigger type input. Strong Port...
  • Page 125 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Programming Considerations Within the user program, one of the first things to consider is port initialisation. After a reset, the I/O data register will be set high and I/O port mode registers will be cleared to low. This means that all I/O pins will default to a Quasi-bidirectional structure.
  • Page 126 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Timer/Event Counters One of the most fundamental functions in any microcontroller device is the ability to control and measure time. To implement time related functions each device includes several Timer/Counters. The Timers are multi-purpose timing units and serve to provide operations such as Timer/Counter, Input Capture, Compare Match Output and Programmable Clock Output.
  • Page 127 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Timer/Event Counters 0, 1, 3 These three timers provide have a similar type and structure and operate with a choice of three modes for Timers 1 and 3 and four modes for Timer 0. They provide basic timing and event counting operations.
  • Page 128: Tl0 Registe

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Timer 0/Timer 1/Timer 3 Register Description Overall operation of the Timer 0, Timer 1 and Timer 3 are controlled using the registers listed in the accompanying table. A register pair, TLn and THn, exist to store the internal counter 13-bit or 16-bit value.
  • Page 129: Th0 Registe

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 TH0 Register SFR Address: 8Ch ● 16-bit Name D1� D1� Bit 7~0 TH0: TIMER0 Counter High Byte Register bit 15~bit 8 ● 13-bit Name D1� D� Bit 7~0 TH0: TIMER0 Counter High Byte Register bit 12~bit 5...
  • Page 130: Th1 Registe

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 TH1 Register SFR Address: 8Dh ● 16-bit Name D1� D1� Bit 7~0 TH1: TIMER1 Counter High Byte Register bit 15~bit 8 ● 13-bit Name D1� D� Bit 7~0 TH1: TIMER1 Counter High Byte Register bit 12~bit 5...
  • Page 131: Th3 Registe

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 TH3 Register SFR Address: A3h ● 16-bit Name D1� D1� Bit 7~0 TH3: TIMER3 Counter High Byte Register bit 15~bit 8 ● 13-bit Name D1� D� Bit 7~0 TH3: TIMER3 Counter High Byte Register bit 12~bit 5...
  • Page 132 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Bit 2 C/T0: Timer 0 Counter/Timer selection 0: Timer 1: Counter Bit 1~0 T0M1, T0M0: Timer 0 mode selection 00: Mode 0 – 13-bit Timer/Counter 01: Mode 1 – 16-bit Timer/Counter 10: Mode 2 – 8-bit Auto Reload Timer/Counter 11: Mode 3 –...
  • Page 133 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 T3CON Register SFR Address: A1h Name GATE3 C/T3 T3M1 T3M0 — — — — — — GATE3: Timer 3 Gate Control Bit 7 0: Disable 1: Enable This bit is used to enable the Timer 3 Gate function. When the GATE3 bit is set high and Timer 3 is enabled to run using the TR3 bit and when the INT3 pin is input high, then the Timer 3 Counter will increment one on every falling edge on the T3 input pin.
  • Page 134: Tmpre Registe

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 TMPRE Register SFR Address: 8Fh Name T3PRE1 T3PRE0 T�PRE1 T�PRE0 T1PRE1 T1PRE0 T0PRE1 T0PRE0 Bit 7~6 T3PRE1, T3PRE0: Timer 3 Clock Frequency selection 00: f 01: f 10: f 11: f Bit 5~4 T2PRE1, T2PRE0: Timer 2 Clock Frequency selection...
  • Page 135 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Mode 0 – 13-bit Counter/Timer Mode Operation To select this mode, bits TnM1 and TnM0, should be set to “00”. The 13 bits of data are comprised of 5 low bits in the TLn register and 8 high bits in the THn register. The C/Tn bit is used to select the timer or counter function.
  • Page 136 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Mode 2 – 8-bit Auto-reload Counter/Timer Mode Operation To select this mode, bits TnM1 and TnM0, should be set to “10” respectively. This function is implemented by the 8-bit TLn and THn registers. The C/Tn bit is used to select the timer or counter function.
  • Page 137 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Mode 3 – Two 8-Bit Timers/Counters Mode Operation – Timer 0 Only To select this mode, bits T0M1 and T0M0, should be set to “11” respectively. This mode is only available for Timer 0. For Timer 1 and Timer 3, this mode is not available and if selected will stop the timer function.
  • Page 138 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Timer 2 with Additional 4-channel PCA The structure of Timer 2 is very different from that of Timers 0, 1 and 3 and is therefore described in its own chapter. Introduction The Timer 2 provides the Timer, Event Counter, Gated timer functions and also cooperates with a 4-channel Programmable Counter Array, known as PCA, to implement the Compare, Reload, Capture and Programmable Clock Output functions.
  • Page 139 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 EXF� Inte���pt Req�est EXEN� T�ansition Detecto� T2EX Reload Capt��e Module 0 Reload CRCL/CRCH CC0/P1.0 Match Ove�flow TF� Inte���pt Req�est Comparator Match Timer 2 CC1/P1.1 Comparator TH2/TL2 Capt��e P�escale� & M�x Module 1 Cont�ol T�I[1:0] CCL1/CCH1 T�PRE[1:0]...
  • Page 140 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Timer 2 Timer 2 is a 16-bit wide count-up counter which is driven by a user selectable internal or external clock source. The counter is composed of two registers, TL2 and TH2, to implement the Timer, event counter and gated timer functions.
  • Page 141 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Timer 2 with PCA Time 2 and 4-channel PCA modules provide the Compare, Reload, Capture and programmable clock output functions. Each of the four Timer 2 Modules contains a pair of registers, CRCL/CRCH for Module 0 and CCLn/CCHn for Modules 1, 2 and 3. These registers are compared with the Timer 2 TL2/TH2 register pair and when a compare match occurs, an interrupt signal can be generated.
  • Page 142: Sec

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Timer 2 Register Description The Timer 2 value is stored in a register pair, TL2/TH2. Each of the internal PCA modules has a register pair, known as CRCL/CRCH for Module 0 and CCLn/CCHn for modules 1, 2 and 3.
  • Page 143 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 T2CON Register SFR Address: C8h Name — I3FR I�FR T�R1 T�R0 T�CM T�I1 T�I0 — — Bit 7 Unimplemented, read as “0” Bit 6 I3FR: Active edge selection for external interrupt “INT3” and PCA module 0...
  • Page 144 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 T2CON1 Register SFR Address: FEh Name — — — — T�OI T�OE — — — — — — — — — — — — — — Bit 7~4 Unimplemented, read as “0” Bit 3...
  • Page 145 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Capture Modes Timer 2 has two capture modes, the Capture on Edge Mode, known as Capture Mode 0, and the Capture on Write Mode, known as Capture Mode 1. The required mode is selected using the COCAHn and COCALn bits in the CCEN register.
  • Page 146 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Compare Modes Timer 2 has two compare modes, known as Mode 0 and Mode 1. The required mode is selected using the T2CM bit in the T2CON register. Setting counter data in the Compare modes can implement the PWM function for various control applications.
  • Page 147 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Inte���pt CRCH CRCL I3FR Compa�e Match “1” Compa�ato� “0” Ove�flow TH� TL� Inte���pt Compare Mode 0 – Module 0 Figure below illustrates the operation of compare mode 0. Contents of Time� � CRC / CCn Reload val�e...
  • Page 148 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Compare Mode 1 In Mode 1, the compare output can be decided by the software setting of the I/O pins control register, P1. When the compare match takes place, the control register value will be outputted to I/O pins, CCn, and the Timer 2 counter overflow will not affect the Compare output.
  • Page 149 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Figure below illustrates the operation of compare mode 1. Contents of Time� � CRC o� CCn Reload val�e O�tp�t �egiste� CCn O�tp�t P1 I/O Cont�ol �egiste� CCn O�tp�t Compa�e Match Compare Mode 1 Timing Diagram Rev.
  • Page 150 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Reload Mode Module 0 provides a Reload Mode function. In the reload function, preset values in the CRCL and CRCH registers are loaded into the TL2 and TH2 registers. There are two kinds of Reload modes, Mode 0 and Mode 1, which are selected by the T2R1 and T2R0 bits in the T2CON register.
  • Page 151 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Programmable Clock Output Mode The Programmable Clock Output mode is related to Module 0. With this function, Timer 2 can generate various clock outputs. This function is enabled by the T2OE bit in the T2CON1 register.
  • Page 152 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Analog to Digital Converter – ADC The devices include a multi-channel 12-bit fully integrated Analog to Digital Converter or ADC. A range of programmable features allow flexible and fast analog to digital conversion for a wide range of input signals.
  • Page 153: A/D Data Registe

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 A/D Converter Register Description A read only register pair exists to store the ADC data 12-bit value. The remaining registers are control registers which setup the operating and control function of the A/D converter.
  • Page 154: Adcr0 Registe

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 ADCR0 Register SFR Address: F1h Name START EOCB ADOFF ADRFS ACS3 ACS� ACS1 ACS0 START: Starts the A/D conversion Bit 7 0→1→0: Start 0→1: Reset the A/D converter and set EOCB to “1” This bit is used to initiate an A/D conversion process. The bit is normally low but if set high and then cleared low again, the A/D converter will initiate a conversion process.
  • Page 155: Adcr1 Registe

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 ADCR1 Register SFR Address: F2h Name ACS4 TSEN — VREFAS VREFIS ADCK� ADCK1 ADCK0 — — ACS4: Internal temperature sensor ADC input control Bit 7 0: Disable 1: Enable This bit enables the temperature sensor to the A/D converter. The TSEN bit must first have been set to enable the temperature sensor circuit.
  • Page 156 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 ADCR2 Register SFR Address: F3h Name ACE7 ACE6 ACE� ACE4 ACE3 ACE� ACE1 ACE0 ACE7: P4.7 A/D input select Bit 7 0: Logic I/O 1: A/D input, AIN.7 ACE6: P4.6 A/D input select Bit 6 0: Logic I/O 1: A/D input, AIN.6...
  • Page 157: Adpga Registe

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 ADPGA Register SFR Address: F4h Name — — — — — ADGN� ADGN1 ADGN0 — — — — — — — — — — Bit 7~3 Unimplemented, read as “0” Bit 2~0 ADGN2~ADGN0: PGA gain select 000: PGA off 001: 0.5...
  • Page 158 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 A/D Converter Clock Source The clock source for the A/D converter, which originates from the system clock f , can be chosen to be either f or a subdivided version of f . The division ratio value is determined by the ADCK2~ADCK0 bits in the ADCR1 register.
  • Page 159 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Temperature Sensor A temperature sensor circuit is provided to measure the temperature which the designer can use to adjust some measured parameters. The temperature sensor output voltage is proportional to the temperature increment and can be amplified by the PGA. The accompanying diagram illustrates the basic relationship between the measured temperature and the voltage output.
  • Page 160 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Summary of A/D Conversion Steps The following summarises the individual steps that should be executed in order to implement an A/D conversion process. Step 1 ■ Select the required A/D conversion clock by correctly programming bits ADCK2~ADCK0 in the ADCR1 register and select the converted data storage format using the ADRFS bit.
  • Page 161 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 A/D Conversion Timing The accompanying diagram shows graphically the various stages involved in an analog to digital conversion process and its associated timing. After an A/D conversion process has been initiated by the application program, the microcontroller internal hardware will begin to carry out the conversion, during which time the program can continue with other functions.
  • Page 162 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Programming Considerations During microcontroller operations where the A/D converter is not being used, the A/D internal circuitry can be switched off to reduce power consumption, by setting bit ADOFF high in the ADCR0 register. When this happens, the internal A/D converter circuits will not consume power irrespective of what analog voltage is applied to their input lines.
  • Page 163: Dah Registe

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Digital to Analog Converter – DAC All devices include a Digital to Analog Converter permitting the conversion of a 12-bit digital value into an analog voltage. An additional programmable attenuation control function provides further flexibility over the overall input/output transfer function.
  • Page 164 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 DACOUT Bit 11 Bit 10 Bit 9 Bit 8 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 D11B D11B D11B D11B D11B D11B D11B D11B D11B...
  • Page 165 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 DAC Operation The DAL and DAH registers contain the digital value to be converted. The DACEN bit in the DACTRL register provides overall enable/disable control. When set high, the DAC output pin will be enabled and the original I/O pin shared function disabled. Clearing this bit to zero will disable the DAC and reduce any associated power consumption.
  • Page 166 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 DAC Reference Voltage Source The DAC can obtain its reference voltage from three different sources, the VCCA2 power supply pin, an externally supplied reference voltage supplied on pin VREF or from the internal voltage reference generator.
  • Page 167 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Voltage Reference Generator All devices include a bandgap circuit based internal voltage reference generator which can supply a temperature stable reference voltage for use by the internal A/D converter and DAC. Voltage Reference Generator Operation The voltage reference circuit will be automatically enabled when either the A/D converter or DAC is enabled.
  • Page 168 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 VCCA3 ADC Voltage Refe�ence VREFAS VREFI VREF DAC Voltage Refe�ence VREFIS VREFDS Inte�nal Voltage Refe�ence Gene�ato� Enable/Disable Cont�ol Enable Enable VCCA� Voltage Reference Generator Block Diagram The A/D converter and DAC reference voltage is selected by the VREFIS, VREFAS and VREFDS control bits.
  • Page 169 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Comparators Two independent analog comparators are contained within these devices. These functions offer flexibility via their register controlled features such as power-down, polarity select, hysteresis, interrupt, wake-up, output path selection etc. In sharing their pins with normal I/O pins the comparators do not waste precious I/O pins if there functions are unused.
  • Page 170 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 CP1ON CP1POL CP1OUT CP1+ C1OUT CP1- CP1OS Interrupt CP1HP[1:0] CP1HN[1:0] Comparator 1 Comparator Registers There are four registers for overall comparator operation. The CP0CR and CP1CR registers are used to control the respective comparators settings for the Comparator 0 and Comparator 1 while the CPHCR register is used to manage the hysteresis selection for these two comparators.
  • Page 171: Cp0Cr Registe

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 CP0CR Register SFR Address: DEh Name — CP0ON CP0POL CP0OUT CP0OS CP0RSTL CP0RST — — — — — Bit 7 Unimplemented, read as “0” Bit 6 CP0ON: Comparator 0 On/Off control 0: Off 1: On This is the Comparator 0 on/off control bit.
  • Page 172: Cp1Cr Registe

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 CP1CR Register SFR Address: DFh Name — CP1ON CP1POL CP1OUT CP1OS — — — — — — — — — — — Bit 7 Unimplemented, read as “0” CP1ON: Comparator 1 On/Off control Bit 6...
  • Page 173: Cphcr Registe

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 CPHCR Register SFR Address: BDh Name CP1HP1 CP1HP0 CP1HN1 CP1HN0 CP0HP1 CP0HP0 CP0HN1 CP0HN0 CP1HP1, CP1HP0: Comparator 1 Positive Hysteresis voltage level Control bits Bit 7~6 00: Disabled 01: 3mV 10: 6mV 11: 12mV...
  • Page 174 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 CPICR Register SFR Address: BEh Name CP1IF CP1IEN CP1P1 CP1P0 CP0IF CP0IEN CP0P1 CP0P0 CP1IF: Comparator 1 Output Transition Interrupt Request Flag Bit 7 0: No request 1: Interrupt request Note that this flag should be cleared using the application program.
  • Page 175 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Comparator Interrupt Each also possesses its own interrupt function. When any one of the changes state, its relevant interrupt flag will be set, and if the corresponding interrupt enable bit is set, then a jump to its relevant interrupt vector will be executed.
  • Page 176 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 C Serial Interface The I C interface is used to communicate with external peripheral devices such as sensors, EEPROM memory etc. Originally developed by Philips, it is a two line low speed serial interface for synchronous serial data transfer.
  • Page 177 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 C Registers There are three control registers associated with the I C bus, I2CCON, I2CADR and I2CSTA and one data register, I2CDAT. The I2CDAT register is used to store the data being transmitted and received on the I C bus.
  • Page 178 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Bit 3 SI: Serial Interrupt Request flag 0: No Interrupt request 1: Interrupt request The SI bit will be set by hardware when one of the 25 out of 26 possible I C statuses is entered.
  • Page 179 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 I2CSTA Register SFR Address: DDh Name IICS7 IICS6 IICS� IICS4 IICS3 — — — — — — — — — Bit 7~3 IICS7~IICS3: I C Status Code These Read-only bits are used to indicate the I C Status code.
  • Page 180 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Data Bus I2CADR Address Register Address Comparator I2CDAT Input Filter Shift Register Output Open drain Arbitration And Input Filter Synchronization Logic Serial Clock Generator Output Open drain Timer1 Overflow I2CCON C Interrupt Control Register...
  • Page 181 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 C Bus Communication Communication on the I C bus requires four separate steps, a START signal, a slave device address transmission, a data transmission and finally a STOP signal. When a START signal is placed on...
  • Page 182 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 C Bus Start Signal The START signal can only be generated by the master device connected to the I C bus and not by the slave device. This START signal will be detected by all devices connected to the I C bus.
  • Page 183 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 C Bus Data and Acknowledge Signal The transmitted data is 8-bits wide and is transmitted after the slave device has acknowledged receipt of its slave address. The order of serial bit transmission is the MSB first and the LSB last.
  • Page 184 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 C Status Codes The I2CSTA register reflects the current status of the I C interface. The three least significant bits of this register are always zero. There are 26 possible status codes, presented in the accompanying tables.
  • Page 185 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 C Status in Master Receiver Mode Application software response Status Next action taken by Status of the I to I2CCON to/from Code the I C hardware I2CDAT STA STO SI AA START condition has been Load SLA+R X SLA+R will be t�ansmitted;...
  • Page 186 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 C Status in Slave Receiver Mode Application software response Status Next action taken by Status of the I to I2CCON to/from Code the I C hardware I2CDAT STA STO SI AA Data b�te will be �eceived and “not ACK” will be...
  • Page 187 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Application software response Status Next action taken by Status of the I to I2CCON to/from Code the I C hardware I2CDAT STA STO SI AA Switched to “not add�essed slave” mode; No action no �ecognition of own slave add�ess o� gene�al call add�ess...
  • Page 188 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Application software response Status Next action taken by Status of the I to I2CCON to/from Code the I C hardware I2CDAT STA STO SI AA Switched to “not add�essed slave” mode; No action no �ecognition of own slave add�ess o� gene�al call add�ess...
  • Page 189 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Serial Interface – SPI The SPI interface is often used to communicate with external peripheral devices such as sensors, Flash Memory or EEPROM memory devices etc. Originally developed by Motorola, the four line SPI interface is a synchronous serial data interface that has a relatively simple communication protocol simplifying the programming requirements when communicating with external hardware devices.
  • Page 190 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Data B�s SPDAT Clock Base CPOL bit MISO pin Clock Level Select Tx/Rx Shift Registe� Level/Edge Set�p MOSI pin Clock Active CHPA bit Edge Select WCOL SPI Cont�ol Stat�s SPIF SCK pin Clock Flags SSERR So��ce...
  • Page 191 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 SPI Registers There are three internal registers which control the overall operation of the SPI interface. These are the SPDAT data register, where the received data or transmitted data is stored and two control registers SPCON and SPSTA.
  • Page 192 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 SPCON Register SFR Address: E8h Name SPR� SPEN SSDIS MSTR CPOL CPHA SPR1 SPR0 SPR2, SPR1, SPR0: Master Clock Select Bit 7, 1, 0 000: Reserved 001: f 010: f 011: f 100: f...
  • Page 193 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 SPSTA Register SFR Address: E1h Name SPIF WCOL SSERR MODF — — — — — — — — — — — — SPIF: SPI Transmit/Receive Complete Flag Bit 7 0: Data is being transferred...
  • Page 194 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 SPI Communication The SPI interface is first enabled by setting the SPEN bit high. This enables the internal SPI circuitry and also enables all the SPI pins which also disabled all of the logical I/O functions. In the Master Mode, when data is written to the SPDAT register, transmission/reception will begin simultaneously.
  • Page 195: Spi Slave Mode Timing - Cpha=0

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 SPI Slave Mode Timing – CPHA=0 SPI Slave Mode Timing – CPHA=1 Rev. 1.00 19� of ��� �an�a�� 1�� �01�...
  • Page 196 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 S P I t r a n s f e r W r i t e D a t a C l e a r W C O L i n t o S P D A T...
  • Page 197 Two fully integrated serial communications UART interfaces, namely UART0 and UART1, enable the communication with external devices that contain a similar serial interface. The UART1 is only available on the HT85F2270/2280. Although what is known as a UART function essentially provides only asynchronous data transfer operations, UART0 also provides extended synchronous data transfer operations.
  • Page 198 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Basic UART Data Transfer Scheme The block diagram shows the overall UART data transfer structure arrangement. For data transmission, the actual data to be transmitted from the MCU is first transferred to the transmitted register by the application program.
  • Page 199: Uart 0 Block Diag

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 UART0 Operating Description This section provides a more detailed description of the UART0 structure and operation. The following shows the overall UART0 block diagram. TXD0 O�tp�t T�ansmit Shift Registe� UART0 Ba�d Rate Latch RXD0 MCU Data B�s...
  • Page 200 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 UART0 Register Description There are several control registers associated with the UART0 function. The S0CON register controls the overall function of the UART0, while the SBRCON, SPPRE, S0RELL and S0RELH registers control the Baud rate. The actual data to be transmitted and received on the serial interface is managed through the S0BUF data register.
  • Page 201 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 S0CON Register – UART0 Control register SFR Address: 98h Name SM�0 REN0 TB80 RB80 SM0, SM1: UART0 Operating mode select bits Bit 7~6 00: Mode 0 01: Mode 1 10: Mode 2 11: Mode 3 The following table illustrates the corresponding mode descriptions and baud rates.
  • Page 202 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 S0RELL Register – UART0 Reload Low Register SFR Address: AAh Name S0REL.7 S0REL.6 S0REL.� S0REL.4 S0REL.3 S0REL.� S0REL.1 S0REL.0 S0RELH Register – UART0 Reload High Register SFR Address: BAh Name — — — —...
  • Page 203 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 SBRCON Register SFR Address: DCh Name — — — — — — — — — — — — — — — — — — BD: UART0 Baud rate select for mode 1 and mode 3...
  • Page 204: Uart0 Mode 0 Timing Diag

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 UART0 Operating Modes UART0 provides four operation modes, selected by the SM1 and SM0 bits in the S0CON register. There are one synchronous and three asynchronous modes, offering different baud rates and functional options. The following table illustrates the different operational mode list. When a transmit/receive data transfer operation has completed, a transmit/receive interrupt will take place and the interrupt request bit, TI0 or RI0, will be set high.
  • Page 205: Uart0 Mode 1 Timing Diag

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Mode 1 Mode 1 is an integrated full-duplex asynchronous serial communication interface with a variable baud rate. The 8 bits of data are received via the RXD0 pin while the TXD0 pin is the data transmit pin for this communication mode.
  • Page 206 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Mode 2 Mode 2 is an integrated full-duplex asynchronous serial communication interface. The 9 bits of data are received via the RXD0 pin while the TXD0 pin is the data transmit pin for this communication mode.
  • Page 207: Uart0 Mode 3 Timing Diag

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Mode 3 The only difference between Mode 2 and Mode 3 is that the internal Baud rate is variable in Mode 3, whereas it is fixed in Mode 2. Mode 3 is an integrated full-duplex asynchronous serial communication interface.
  • Page 208 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 UART0 Multiprocessor Communication As UART0 can receive 9 bits in Modes 2 and 3, it can be used for multiprocessor communication. When the SM20 bit in the S0CON register is set, the received interrupt is generated only when the 9th received bit, the RB80 bit in the S0CON register, is high.
  • Page 209: Uart1 Block Diag

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 UART1 Operating Description This section provides a more detailed description of the UART1 structure and operation. The following shows the overall UART1 block diagram. O�tp�t T�ansmit Shift Registe� UART1 Ba�d Rate TXD1 Latch MCU Data B�s Cont�ol Unit...
  • Page 210 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 UART1 Register Description There are several control registers associated with the UART1 function. The S1CON register controls the overall function of the UART1, while the SPPRE, S1RELL and S1RELH registers control the Baud rate. The actual data to be transmitted and received on the serial interface is managed through the S1BUF data register.
  • Page 211 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 S1CON Register – UART1 Control register SFR Address: 9Bh Name — SM�1 REN1 TB81 RB81 — — SM: UART1 Operating mode select bit Bit 7 0: Mode A 1: Mode B The following table illustrates the corresponding mode descriptions and baud rates.
  • Page 212 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 S1RELL Register – UART1 Reload Low Register SFR Address: 9Dh Name S1REL.7 S1REL.6 S1REL.� S1REL.4 S1REL.3 S1REL.� S1REL.1 S1REL.0 S1RELH Register – UART1 Reload High Register SFR Address: BBh Name — — — —...
  • Page 213: Uart1 Mode A Timing Diag

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 UART1 Operating Modes UART1 provides two operational modes, selected by the SM bit in the S1CON register. There are two asynchronous modes, offering different baud rates and functional options. The following table illustrates the different operational mode list. When the transmit/receive data process is complete, the transmit/receive interrupt will take place and the interrupt request bit, TI1 or RI1, will be set high.
  • Page 214: Uart1 Mode B Timing Diag

    Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Mode B Mode B is an integrated full-duplex asynchronous serial communication interface. The 8 bits of data are received via the RXD1 pin while the TXD1 pin provides the data transmit for this communication. The data will then be transferred to the Transmit Shift Register from where it will be shifted out onto the TXD1 pin by the UART1 Baud rate generator.
  • Page 215 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 UART1 Multiprocessor Communication As UART1 can receive 9 bits in Mode A, it can be used for multiprocessor communication. When the SM21 bit in the S1CON register is set, the receive interrupt is generated only when the 9th received bit, the RB81 bit in the S1CON register, is high.
  • Page 216 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Instruction Set Introduction All instructions are binary code compatible and perform the same functions as they do within the industry standard 8051. The following tables give a summary of instruction cycles of the HT85XXX microcontroller core.
  • Page 217 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Arithmetic Operations Mnemonic Description Code Bytes Cycles ADD A�Rn Add �egiste� to Acc�m�lato� 0X�8-0X�F ADD A�di�ect Add di�ectl� add�essed data to Acc�m�lato� 0X�� � � ADD A�@Ri Add indi�ectl� add�essed data to Acc�m�lato� 0X�6-0X�7 �...
  • Page 218 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Logic Operations Mnemonic Description Code Bytes Cycles ANL A�Rn AND �egiste� to Acc�m�lato� 0X�8-0X�F ANL A�di�ect AND di�ectl� add�essed data to Acc�m�lato� 0X�� � � ANL A�@Ri AND indi�ectl� add�essed data to Acc�m�lato� 0X�6-0X�7 �...
  • Page 219 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Data transfer Operations Mnemonic Description Code Bytes Cycles MOV A�Rn Move �egiste� to Acc�m�lato� 0XE8-0XEF MOV A�di�ect Move di�ectl� add�essed data to Acc�m�lato� 0XE� � � MOV A�@Ri Move indi�ectl� add�essed data to Acc�m�lato�...
  • Page 220 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Program Branches Mnemonic Description Code Bytes Cycles ACALL add�11 Absol�te s�b�o�tine call xxx10001b � � (*�) LCALL add�16 Long s�b�o�tine call 0X1� (*�) Ret��n f�om s�b�o�tine 0X�� � RETI Ret��n f�om inte���pt 0X3� �...
  • Page 221 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Boolean Manipulation Mnemonic Description Code Bytes Cycles CLR C Clear carry flag 0XC3 CLR bit Clea� di�ectl� add�essed bit 0XC� � SETB C Set carry flag 0XD3 SETB bit Set di�ectl� add�essed bit 0XD�...
  • Page 222 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 Package Information Note that the package information provided here is for consultation purposes only. As this information may be updated at regular intervals users are reminded to consult the Holtek website for the latest version of the package information.
  • Page 223 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 48-pin LQFP (7mm×7mm) Outline Dimensions Dimensions in inch Symbol Min. Nom. Max. — 0.3�4 BSC — — 0.�76 BSC — — 0.3�4 BSC — — 0.�76 BSC — — 0.0�0 BSC — 0.007 0.009 0.011...
  • Page 224 Standard 8051 8-Bit Flash MCU HT85F2260/HT85F2270/HT85F2280 64-pin LQFP (7mm × 7mm) Outline Dimensions Dimensions in inch Symbol Min. Nom. Max. — 0.3�4 BSC — — 0.�76 BSC — — 0.3�4 BSC — — 0.�76 BSC — — 0.016 BSC —...
  • Page 225 Holtek's p�od�cts a�e not a�tho�ized fo� �se as c�itical components in life s�ppo�t devices o� s�stems. Holtek �ese�ves the �ight to alte� its p�od�cts witho�t p�io� notification. For the most up-to-date information, please visit our web site at http://www.

This manual is also suitable for:

Ht85f2280Ht85f2260

Table of Contents