Enhanced A/D Flash Type 8-Bit MCU with EEPROM and UART Interface HT66FU60A/HT66FU70A Revision: V1.00 Date: ����������������� November 29, 2012 HT66FU60A/HT66FU70A Enhanced A/D Flash Type 8-Bit MCU with EEPROM and UART Interface Table of Contents Features............................................................................................................. 3 CPU Features.......................................................................................................................... 3 Peripheral Features.................................................................................................................. 3 UART Module Features........................................................................................................... 4 General Description.......................................................................................... 4 Selection Table.................................................................................................. 5 Block Diagram................................................................................................... 5 Pin Assignment................................................................................................. 6 Pin Description................................................................................................. 9 Internally Connected Pins...................................................................................................... 15 Functional Description................................................................................... 16 Multi-chip Hardware Considerations...................................................................................... 16 Multi-chip Programming Considerations................................................................................ 17 Application Circuits........................................................................................ 19 Package Information...................................................................................... 20 48-pin LQFP (7mm×7mm) Outline Dimensions..................................................................... 21 64-pin LQFP (7mm×7mm) Outline Dimensions..................................................................... 22 Rev. 1.00 2 November 29, 2012 HT66FU60A/HT66FU70A Enhanced A/D Flash Type 8-Bit MCU with EEPROM and UART Interface Features CPU Features • Operating Voltage: ♦♦ fSYS=8MHz: 2.2V~5.5V ♦♦ fSYS=12MHz: 2.7V~5.5V ♦♦ fSYS=16MHz: 4.5V~5.5V • Up to 0.25μs instruction cycle with 16MHz system clock at VDD=5V • Power down and wake-up functions to reduce power consumption • Five oscillators ♦♦ External Crystal − HXT ♦♦ External 32.768kHz − LXT ♦♦ External RC − ERC ♦♦ Internal RC − HIRC ♦♦ Internal 32kHz RC − LIRC • Multi-mode operation: NORMAL, SLOW, IDLE and SLEEP • Fully integrated internal 8MHz oscillator requires no external components • All instructions executed in one or two instruction cycles • Table read instructions • 63 powerful instructions • Up to 16-level subroutine nesting • Bit manipulation instruction Peripheral Features • Flash Program Memory: 16K×16 ~ 32K×16 • Data Memory: 1024×8 ~ 2048×8 • EEPROM Memory: 128×8 • In Application Programming function • Watchdog Timer function • Up to 53 bidirectional I/O lines • Software controlled 4-SCOM lines LCD driver with 1/2 bias • Multiple pin-shared external interrupts • Multiple Timer Module for time measure, input capture, compare match output, PWM output or single pulse output function • Serial Interfaces Module – SIM for SPI or I2C • Single sefial SPI interface – SPIA • Dual Comparator functions • Dual Time-Base functions for generation of fixed time interrupt signals • Multi-channel 12-bit resolution A.D converter • Low voltage reset function • Low voltage detect function • Wide range of available package types • Flash program memory can be re-programmed up to 100,000 times • Flash program memory data retention > 10 years • EEPROM data memory can be re-programmed up to 1,000,000 times • EEPROM data memory data retention > 10 years Rev. 1.00 3 November 29, 2012 HT66FU60A/HT66FU70A Enhanced A/D Flash Type 8-Bit MCU with EEPROM and UART Interface UART Module Features • Interconnected to Holtek MCU via SPI Interface • Full-duplex, Universal Asynchronous Receiver and Transmitter (UART) communication ♦♦ 8-bit or 9-bit character length ♦♦ Even, Odd or No parity options ♦♦ One or two stop bits ♦♦ Baud rate generator with 8-bit prescaler ♦♦ Parity, framing, noise and overrun error detection ♦♦ Support for interrupt on address detect ♦♦ Address Detect Interrupt – last character bit=1 ♦♦ Transmitter and Receiver ennabled independently ♦♦ 4-byte deep FIFO receiver data buffer ♦♦ Transmit and Receive Multiple Interrupt Generation Sources - Transmitter Empty - Transmitter Idle - Receiver Full - Receiver Overrun ♦♦ ♦♦ - Address Mode Detect TX pin is high impedance when the UART transmit module is disabled RX pin is high impedance when the UART Receive module is disabled • CMOS clock input, CLKI, up to 20MHz at 5V operating voltage General Description The HT66FU60A/HT66FU70A series of devices are Flash Memory A/D type 8-bit high performance RISC architecture microcontrollers, designed for a wide range of applications. Offering users the convenience of Flash Memory multi-programming features, these devices also include a wide range of functions and features. Other memory includes an area of RAM Data Memory as well as an area of EEPROM memory for storage of non-volatile data such as serial numbers, calibration data etc. Analog features include a multi-channel 12-bit A/D converter and dual comparator functions. Multiple and extremely flexible Timer Modules provide timing, pulse generation and PWM generation functions. Communication with the outside world is catered for by including fully integrated SPI or I2C interface functions, two popular interfaces which provide designers with a means of easy communication with external peripheral hardware. Protective features such as an internal Watchdog Timer, Low Voltage Reset and Low Voltage Detector coupled with excellent noise immunity and ESD protection ensure that reliable operation is maintained in hostile electrical environments. A full choice of HXT, LXT, ERC, HIRC and LIRC oscillator functions are provided including a fully integrated system oscillator which requires no external components for its implementation. The ability to operate and switch dynamically between a range of operating modes using different clock sources gives users the ability to optimise microcontroller operation and minimise power consumption. The UART module is contained in this series of devices. It can support the applications such as data communication networks between microcontrollers, low-cost data links between PCs and peripheral devices, portable and battery operated device communication, etc. The inclusion of flexible I/O programming features, Time-Base functions along with many other features ensure that the devices will find excellent use in applications such as electronic metering, environmental monitoring, handheld instruments, household appliances, electronically controlled tools, motor driving in addition to many others. Rev. 1.00 4 November 29, 2012 HT66FU60A/HT66FU70A Enhanced A/D Flash Type 8-Bit MCU with EEPROM and UART Interface Selection Table Most features are common to all devices. The main features distinguishing them are Program Memory and Data Memory capacity. The following table summarises the main features of each device. Part No. Program Memory Data Memory Data EEPROM I/O External Interrupt A/D Converter HT66FU60A 16K × 16 1024 × 8 128 × 8 53 4 12-bit × 12 HT66FU70A 32K × 16 2048 × 8 128 × 8 53 4 12-bit × 12 Part No. Timer Module SIM SPIA Time Base Comparators UART Stacks Package HT66FU60A 10-bit CTM × 2 16-bit STM × 3 10-bit ETM × 1 √ √ 2 2 √ 16 48/64 LQFP HT66FU70A 10-bit CTM × 2 16-bit STM × 3 10-bit ETM × 1 √ √ 2 2 √ 16 48/64 LQFP Note: As devices exist in more than one package format, the table reflects the situation for the package with the most pins. Block Diagram The following block diagram illustrates the dual-chip structure of the devices, where an individual MCU and SPI to UART chips are combined into a single package. Rev. 1.00 5 November 29, 2012 HT66FU60A/HT66FU70A Enhanced A/D Flash Type 8-Bit MCU with EEPROM and UART Interface Watchdog Timer Reset Circuit Stack OCDS / ICP LVD RAM EEPROM Flash ROM Time Bases 8-bit RISC MCU Core LVR Interrupt Controller External Oscillators ERC/HXT/LXT Internal Osillators HIRC/LIRC 12-bit A/D Converter IO UART SIM SPIA STMs ETM CTMs Comparators Pin Assignment PB7/SDI/SDA PA� PA0 PB5/SCS PA7/SCK/SCL/A�7 PA6/SDI/SDA/A�6 PA5/SDO/A�5/C1X PA4/I�T1/TCK1/A�4 PA3/I�T0/A�3/C0� PH1/TCK0/A��/C0P PA1/TP1A/TP1IA/A�1 PH0/TP0/TP0B/A�0/VREF/C0X 48 47 46 45 44 43 42 41 40 39 38 37 PF1/A�11/C1P 1 36 PD6/SCK/SCL PF0/A�10/C1� 2 35 PC�/PCK/TCK�/C0X PE7/A��/I�T1 3 34 PC3/PI�T/TP�/TP�B/TP�I/C1X PE6/A�8/I�T0 4 33 RX 32 TX 31 �C 30 �C VSS 5 VDD 6 PB4/XT� 7 PB3/XT1 8 29 �C VSS� 9 28 �C PB1/OSC1 10 27 �C PB�/OSC� 11 26 �C PE5/TP3/TP3B 12 25 13 14 15 16 17 18 19 20 21 22 23 24 HT66FU60A/HT66FU70A 48 LQFP-A PD5/TP0/TP0B PC6/SCOM�/TP0/TP0B 6 PC7/SCOM3/TP1A/TP1IA PC1/TP1B/TP1BB/TP1IB/SCOM1 PC0/TP1B/TP1BB/TP1IB/SCOM0 PE1/SCKA/I�T1 PE0/SCSA/I�T0 PE�/SDIA/I�T� PE3/SDOA/TCK3 PF� PB0/RES PE4/TP1B/TP1BB/TP1IB Rev. 1.00 PD4/TP�/TP�B/TP�I November 29, 2012 HT66FU60A/HT66FU70A Enhanced A/D Flash Type 8-Bit MCU with EEPROM and UART Interface PH4/SDIA PA0 PA� PH3/SCKA PH�/SCSA PG7/TP5/TP5B/TP5I PG6/TP5/TP5B/TP5I PB5/SCS PG5/TCK5 PA7/SCK/SCL/A�7 PA6/SDI/SDA/A�6 PA5/SDO/A�5/C1X PA3/I�T0/A�3/C0� PA4/I�T1/TCK1/A�4 PH1/TCK0/A��/C0P PA1/TP1A/TP1IA/A�1 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 PH0/TP0/TP0B/A�0/VREF/C0X 1 48 PH5/SDOA PF1/A�11/C1P 2 47 PB7/SDI/SDA PF0/A�10/C1� 3 46 PD6/SCK/SCL PE7/A��/I�T1 4 45 PC�/PCK/TCK�/C0X PE6/A�8/I�T0 5 44 PC3/PI�T/TP�/TP�B/TP�I/C1X PF6 6 43 RX 42 TX 41 �C 40 �C VSS 7 VDD 8 PB4/XT� 9 PB3/XT1 10 39 �C VSS� 11 38 �C PB1/OSC1 12 37 �C PB�/OSC� 13 36 �C PF4 14 35 PG�/TCK4 PF3 15 34 PG3/TP4/TP4B/TP4I PE5/TP3/TP3B 16 33 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 PG4/TP4/TP4B/TP4I HT66FU60A/HT66FU70A 64 LQFP-A PD4/TP�/TP�B/TP�I PD5/TP0/TP0B PG1/C1X PG0/C0X PC6/SCOM�/TP0/TP0B PC7/SCOM3/TP1A/TP1IA PC1/TP1B/TP1BB/TP1IB/SCOM1 PC0/TP1B/TP1BB/TP1IB/SCOM0 PE0/SCSA/I�T0 PE1/SCKA/I�T1 PE�/SDIA/I�T� PE3/SDOA/TCK3 PF� PF5 PB0/RES PE4/TP1B/TP1BB/TP1IB PB7/SDI/SDA PA�/ICPCK/OCDSCK PA0/ICPDA/OCDSDA PB5/SCS PA7/SCK/SCL/A�7 PA6/SDI/SDA/A�6 PA5/SDO/A�5/C1X PA4/I�T1/TCK1/A�4 PA3/I�T0/A�3/C0� PH1/TCK0/A��/C0P PA1/TP1A/TP1IA/A�1 PH0/TP0/TP0B/A�0/VREF/C0X 48 47 46 45 44 43 42 41 40 39 38 37 PF1/A�11/C1P 1 36 PD6/SCK/SCL PF0/A�10/C1� 2 35 PC�/PCK/TCK�/C0X PE7/A��/I�T1 3 34 PC3/PI�T/TP�/TP�B/TP�I/C1X PE6/A�8/I�T0 4 33 RX 32 TX 31 �C 30 �C VSS 5 VDD 6 PB4/XT� 7 PB3/XT1 8 29 �C VSS� 9 28 �C PB1/OSC1 10 27 �C PB�/OSC� 11 26 �C PE5/TP3/TP3B 12 25 13 14 15 16 17 18 19 20 21 22 23 24 HT66VU60A/HT66VU70A 48 LQFP-A PD5/TP0/TP0B PC6/SCOM�/TP0/TP0B 7 PC7/SCOM3/TP1A/TP1IA PC1/TP1B/TP1BB/TP1IB/SCOM1 PC0/TP1B/TP1BB/TP1IB/SCOM0 PE1/SCKA/I�T1 PE0/SCSA/I�T0 PE�/SDIA/I�T� PE3/SDOA/TCK3 PF� PB0/RES PE4/TP1B/TP1BB/TP1IB Rev. 1.00 PD4/TP�/TP�B/TP�I November 29, 2012 HT66FU60A/HT66FU70A Enhanced A/D Flash Type 8-Bit MCU with EEPROM and UART Interface PH4/SDIA PA�/ICPCK/OCDSCK PA0/ICPDA/OCDSDA PH3/SCKA PH�/SCSA PG7/TP5/TP5B/TP5I PG5/TCK5 PG6/TP5/TP5B/TP5I PB5/SCS PA7/SCK/SCL/A�7 PA6/SDI/SDA/A�6 PA5/SDO/A�5/C1X PA3/I�T0/A�3/C0� PA4/I�T1/TCK1/A�4 PH1/TCK0/A��/C0P PA1/TP1A/TP1IA/A�1 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 PH0/TP0/TP0B/A�0/VREF/C0X 1 48 PH5/SDOA PF1/A�11/C1P 2 47 PB7/SDI/SDA PF0/A�10/C1� 3 46 PD6/SCK/SCL PE7/A��/I�T1 4 45 PC�/PCK/TCK�/C0X PE6/A�8/I�T0 5 44 PC3/PI�T/TP�/TP�B/TP�I/C1X PF6 6 43 RX 42 TX 41 �C 40 �C VSS 7 VDD 8 PB4/XT� 9 PB3/XT1 10 39 �C VSS� 11 38 �C PB1/OSC1 12 37 �C PB�/OSC� 13 36 �C PF4 14 35 PG�/TCK4 PF3 15 34 PG3/TP4/TP4B/TP4I PE5/TP3/TP3B 16 33 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 PG4/TP4/TP4B/TP4I HT66VU60A/HT66VU70A 64 LQFP-A PD4/TP�/TP�B/TP�I PD5/TP0/TP0B PG1/C1X PG0/C0X PC6/SCOM�/TP0/TP0B PC7/SCOM3/TP1A/TP1IA PC1/TP1B/TP1BB/TP1IB/SCOM1 PC0/TP1B/TP1BB/TP1IB/SCOM0 PE1/SCKA/I�T1 PE0/SCSA/I�T0 PE�/SDIA/I�T� PE3/SDOA/TCK3 PF� PF5 PB0/RES PE4/TP1B/TP1BB/TP1IB Note: 1. If the pin-shared pin functions have multiple outputs simultaneously, the pin-shared function is determined by the corresponding software control bits except the functions determined by the configuration options. 2. The HT66VU60A/HT66VU70A device is the EV chip of the HT66FU60A/HT66FU70A series of devices. It supports the “On-Chip Debug” function for debugging during development using the OCDSDA and OCDSCK pins connected to the Holtek HT-IDE development tools. Refer to the OCDS section of the MCU datasheet for more details. Rev. 1.00 8 November 29, 2012 HT66FU60A/HT66FU70A Enhanced A/D Flash Type 8-Bit MCU with EEPROM and UART Interface Pin Description With the exception of the power pins, all pins on these devices can be referenced by their Port name, e.g. PA.0, PA.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. The function of each pin is listed in the following tables, however the details behind how each pin is configured is contained in individual MCU and SPI to UART chip datasheet. The important point to note here is that some I/O lines are not bonded to the external pins. Users should take special care of these I/O port lines. Refer to the Hardware Considerations section for more details. Pad Name PA0/ICPDA/OCDSDA PA1/TP1A/TP1IA/AN1 PA2 /ICPCK/OCDSCK PA3/INT0/AN3/C0N PA4/INT1/TCK1/AN4 PA5/SDO/AN5/C1X Rev. 1.00 Function OPT PA0 PAWU PAPU I/T O/T ST General purpose I/O. Register enabled CMOS pull-up and wake-up. Description ICPDA — ST CMOS ICP Data/Address OCDSDA — ST CMOS OCDS Data/Address, for EV chip only. PA1 PAWU PAPU PAS0 ST CMOS TP1A PAS0 — CMOS TM1 A output General purpose I/O. Register enabled pull-up and wake-up. TP1IA IFS2 ST — TM1 A input AN1 PAS0 AN — A/D Converter analog input PA2 PAWU PAPU ST CMOS CMOS ICP Clock pin General purpose I/O. Register enabled pull-up and wake-up. ICPCK — ST OCDSCK — ST — PA3 PAWU PAPU PAS1 ST CMOS INT0 INTEG INTC0 IFS0 ST — External Interrupt 0 OCDS Clock pin, for EV chip only. General purpose I/O. Register enabled pull-up and wake-up. AN3 PAS1 AN — A/D Converter analog input C0N PAS1 AN — Comparator 0 inverting input PA4 PAPU PAWU PAS2 ST CMOS INT1 INTEG INTC0 IFS0 ST — External Interrupt 1 General purpose I/O. Register enabled pull-up and wake-up. TCK1 IFS1 ST — TM1 input AN4 PAS1 AN — A/D Converter analog input PA5 PAWU PAPU PAS2 ST CMOS SDO PAS2 — CMOS SPI data output AN5 PAS2 AN C1X PAS2 — 9 — General purpose I/O. Register enabled pull-up and wake-up. A/D Converter analog input CMOS Comparator 1 output November 29, 2012 HT66FU60A/HT66FU70A Enhanced A/D Flash Type 8-Bit MCU with EEPROM and UART Interface Pad Name Function PA6 PA6/SDI/SDA/AN6 SDI PB0/RES I/T O/T ST CMOS ST — PB3/XT1 PB4/XT2 PC0/TP1B/TP1BB/TP1IB/SCOM0 Rev. 1.00 SPI data input AN6 PAS3 AN — PA7 PAWU PAPU PAS3 ST CMOS SCK PAS3 IFS4 ST CMOS SPI serial clock SCL PAS3 IFS4 ST NMOS I2C clock line AN7 PAS3 AN — PB0 PBPU ST CMOS RES CO ST — PB1 PBPU ST CMOS OSC1 CO HXT — PB2 PBPU ST CMOS OSC2 CO — HXT PB3 PBPU ST CMOS XT1 CO LXT — PB4 PBPU ST CMOS XT2 CO — LXT PB5 PBPU PBS2 ST CMOS SCS PBS2 IFS4 ST CMOS SPI slave select PB7 PBPU PBS3 ST CMOS SDI PBS3 IFS4 ST — SDA PBS3 IFS4 ST NMOS I2C data line PC0 PCPU PCS0 ST CMOS TP1B PCS0 — CMOS TM1 B output TP1BB PCS0 — CMOS TM1 inverted B output TP1IB IFS2 ST SCOM0 PCS0 — PB5/SCS PB7/SDI/SDA General purpose I/O. Register enabled pull-up and wake-up. ST NMOS I2C data line PB1/OSC1 PB2/OSC2 Description PAS3 IFS4 SDA PA7/SCK/SCL/AN7 OPT PAWU PAPU PAS3 PAS3 IFS4 10 — A/D Converter analog input General purpose I/O. Register enabled pull-up and wake-up. A/D Converter analog input General purpose I/O. Register enabled pull-up Reset pin General purpose I/O. Register enabled pull-up HXT/ERC oscillator pin & EC mode input pin General purpose I/O. Register enabled pull-up HXT oscillator pin General purpose I/O. Register enabled pull-up LXT oscillator pin General purpose I/O. Register enabled pull-up LXT oscillator pin General purpose I/O. Register enabled pull-up General purpose I/O. Register enabled pull-up and wake-up. SPI data input General purpose I/O. Register enabled pull-up TM1 B input SCOM LCD common output November 29, 2012 HT66FU60A/HT66FU70A Enhanced A/D Flash Type 8-Bit MCU with EEPROM and UART Interface Pad Name PC1/TP1B/TP1BB/TP1IB/SCOM1 PC2/PCK/TCK2/C0X PC3/PINT/TP2/TP2B/TP2I/C1X PC6/SCOM2/TP0/TP0B PC7/SCOM3/TP1A/TP1IA PD4/TP2/TP2B/TP2I PD5/TP0/TP0B PD6/SCK/SCL Rev. 1.00 Function OPT PC1 PCPU PCS0 I/T O/T ST General purpose I/O. Register enabled CMOS pull-up TP1B PCS0 — CMOS TM1 B output TP1BB PCS0 — CMOS TM1 inverted B output TP1IB IFS2 ST SCOM1 PCS0 — SCOM LCD common output PC2 PCPU PCS1 ST CMOS PCK PCS1 — CMOS Peripheral clock output TCK2 IFS1 ST C0X PCS1 — CMOS Comparator 0 output PC3 PCPU PCS1 ST CMOS PINT IFS0 ST − TP2 PCS1 — CMOS TM2 output TP2B PCS1 — CMOS TM2 inverted output TP2I IFS2 ST C1X PCS1 — CMOS Comparator 1 output PC6 PCPU PCS3 ST CMOS SCOM2 PCS3 — SCOM LCD common output TP0 PCS3 — CMOS TM0 output TP0B PCS3 — CMOS TM0 inverted output PC7 PCPU PCS3 ST CMOS SCOM3 PCS3 — SCOM LCD common output CMOS TM1 A output — — — Description TM1 B input General purpose I/O. Register enabled pull-up TM2 input General purpose I/O. Register enabled pull-up Peripheral interrupt TM2 input General purpose I/O. Register enabled pull-up General purpose I/O. Register enabled pull-up TP1A PCS3 — TP1IA IFS2 ST — PD4 PDPU PDS2 ST CMOS TP2 PDS2 — CMOS TM2 output TP2B PDS2 — CMOS TM2 inverted output TP2I IFS2 ST — PD5 PDPU PDS2 ST CMOS TM1 A input General purpose I/O. Register enabled pull-up TM2 input General purpose I/O. Register enabled pull-up TP0 PDS2 — CMOS TM0 output TP0B PDS2 — CMOS TM0 inverted output PD6 PDPU PDS3 ST CMOS SCK PDS3 IFS4 ST CMOS SPI serial clock SCL PDS3 IFS4 ST NMOS I2C clock line 11 General purpose I/O. Register enabled pull-up November 29, 2012 HT66FU60A/HT66FU70A Enhanced A/D Flash Type 8-Bit MCU with EEPROM and UART Interface Pad Name PE0/SCSA/INT0 PE1/SCKA/INT1 PE2/SDIA/INT2 PE3/SDOA/TCK3 PE4/TP1B/TP1BB/TP1IB PE5/TP3/TP3B PE6/AN8/INT0 PE7/AN9/INT1 PF0/AN10/C1N Rev. 1.00 Function OPT PE0 PEPU PES0 I/T ST General purpose I/O. Register enabled CMOS pull-up SCSA PES0 IFS5 ST CMOS SPIA slave select INT0 INTEG INTC0 IFS0 ST — PE1 PEPU PES0 ST CMOS SCKA PES0 IFS5 ST CMOS SPIA serial clock INT1 INTEG INTC0 IFS0 ST — PE2 PEPU PES1 ST CMOS SDIA IFS5 ST CMOS SPI serial clock INT2 INTEG INTC3 IFS0 ST — PE2 PEPU PES1 ST CMOS SDOA PES1 ST CMOS SPIA serial clock TCK3 IFS1 ST — PE4 PEPU PES2 ST CMOS TP1B PES2 — CMOS TM1 B output TP1BB PES2 — CMOS TM1 inverted B output TP1IB IFS2 ST — PE5 PEPU PES2 ST CMOS TP3 PES2 — CMOS TM3 output TP3B PES2 — CMOS TM3 inverted output PE6 PEPU PES3 ST CMOS AN8 PES3 AN — A/D Converter analog input INT0 INTEG INTC0 IFS0 ST — External Interrupt 0 PE7 PEPU PES3 ST CMOS AN9 PES3 AN — A/D Converter analog input INT1 INTEG INTC0 IFS0 ST — External Interrupt 1 PF0 PFPU PFS0 ST CMOS AN10 PFS0 AN — A/D Converter analog input C1N PFS0 AN — Comparator 1 inverting input 12 O/T Description External Interrupt 0 General purpose I/O. Register enabled pull-up External Interrupt 1 General purpose I/O. Register enabled pull-up External Interrupt 2 General purpose I/O. Register enabled pull-up TM3 input General purpose I/O. Register enabled pull-up TM1 B input General purpose I/O. Register enabled pull-up General purpose I/O. Register enabled pull-up General purpose I/O. Register enabled pull-up General purpose I/O. Register enabled pull-up November 29, 2012 HT66FU60A/HT66FU70A Enhanced A/D Flash Type 8-Bit MCU with EEPROM and UART Interface Pad Name PF1/AN11/C1P PF2~PF6 PG0/C0X PG1/C1X PG2/TCK4 PG3/TP4/TP4B/TP4I PG4/TP4/TP4B/TP4I PG5/TCK5 PG6/TP5/TP5B/TP5I PG7/TP5/TP5B/TP5I PH0/TP0/TP0B/AN0/VREF/C0X Rev. 1.00 Function OPT PF1 PFPU PFS0 I/T O/T Description ST AN11 PFS0 AN — A/D Converter analog input C1P PFS0 AN — Comparator 1 non-inverting input PFn PFPU ST CMOS General purpose I/O. Register enabled pull-up PG0 PGPU PGS0 ST CMOS General purpose I/O. Register enabled pull-up C0X PGS0 — CMOS Comparator 0 output PG1 PGPU PGS0 ST CMOS C1X PGS0 — CMOS Comparator 1 output PG2 PGPU ST CMOS TCK4 — ST — PG3 PGPU PGS1 ST CMOS TP4 PGS1 — CMOS TM4 output TP4B PGS1 — CMOS TM4 inverted output TP4I IFS3 ST — PG4 PGPU PGS2 ST CMOS TP4 PGS2 — CMOS TM4 output TP4B PGS2 — CMOS TM4 inverted output TP4I IFS3 ST — PG5 PGPU ST CMOS TCK5 — ST — PG6 PGPU PGS3 ST CMOS TP5 PGS3 — CMOS TM5 output TP5B PGS3 — CMOS TM5 inverted output TP5I IFS3 ST — PG7 PGPU PGS3 ST CMOS TP5 PGS3 — CMOS TM5 output TP5B PGS3 — CMOS TM5 inverted output TP5I IFS3 ST — PH0 PHPU PHS0 ST CMOS General purpose I/O. Register enabled CMOS pull-up General purpose I/O. Register enabled pull-up General purpose I/O. Register enabled pull-up TM4 input General purpose I/O. Register enabled pull-up TM4 input General purpose I/O. Register enabled pull-up TM4 input General purpose I/O. Register enabled pull-up TM5 input General purpose I/O. Register enabled pull-up TM5 input General purpose I/O. Register enabled pull-up TM5 input General purpose I/O. Register enabled pull-up TP0 PHS0 — CMOS TM0 output TP0B PHS0 — CMOS TM0 inverted output AN0 PHS0 AN — A/D Converter analog input VREF PHS0 AN — A/D Converter reference input C0X PHS0 — 13 CMOS Comparator 0 output November 29, 2012 HT66FU60A/HT66FU70A Enhanced A/D Flash Type 8-Bit MCU with EEPROM and UART Interface Pad Name Function OPT PH1 PHPU PHS0 ST TCK0 IFS1 ST — TM0 input AN2 PHS0 AN — A/D Converter analog input C0P PHS0 AN — Comparator 0 non-inverting input PH2 PHPU PHS1 ST CMOS SCSA PHS1 IFS5 ST CMOS SPIA slave select PH3 PHPU PHS1 ST CMOS SCKA PHS1 IFS5 ST CMOS SPIA serial clock PH4 PHPU ST CMOS SDIA IFS5 ST CMOS SPIA serial data input PH5 PHPU PHS2 ST CMOS SDOA PHS2 ST CMOS SPIA serial data output RX RX UCR1* UCR2* ST TX TX UCR1* UCR2* — NC NC — — — Not connected. VDD VDD — PWR — Positive Power supply. VSS VSS — PWR — Negative Power supply. Ground. VSS2 VSS2 — PWR — I/O Pad Power supply. Ground. PH1/TCK0/AN2/C0P PH2/SCSA PH3/SCKA PH4/SDIA PH5/SDOA I/T O/T Description General purpose I/O. Register enabled CMOS pull-up — General purpose I/O. Register enabled pull-up General purpose I/O. Register enabled pull-up General purpose I/O. Register enabled pull-up General purpose I/O. Register enabled pull-up UART RX serial data input pin. CMOS UART TX serial data output pin. Legend: I/T: Input type; O/T: Output type OPT: Optional by configuration option (CO) or register option PWR: Power; CO: Configuration option ST: Schmitt Trigger input; SCOM: Software controlled LCD COM; CMOS: CMOS output; NMOS: NMOS output HXT: High frequency crystal oscillator LXT: Low frequency crystal oscillator * The UCR1 and UCR2 registers are contained in the HT45B0F chip and used to configure various options of the TX and RX functions in the UART module. Rev. 1.00 14 November 29, 2012 HT66FU60A/HT66FU70A Enhanced A/D Flash Type 8-Bit MCU with EEPROM and UART Interface Internally Connected Pins Among the pins mentioned in the tables above several pins are not connected to external package pins. These pins are interconnection pins between the MCU and the SPI to UART chips and are listed in the following table. The description is provided from the SPI to UART chip standpoint. SPI-to-UART Chip Pin Name Type SDI I Slave SPI Serial Data In Input Signal Internally connected to the MCU Master SPI SDO output signal SDO O Slave SPI Serial Data Out Output Signal Internally connected to the MCU Master SPI SDI input signal SCK I Slave SPI Serial Clock Input Signal Internally connected to the MCU Master SPI SCK output signal SCS I Slave SPI Device Select Input Signal Internally connected to the MCU Master SPI SCS output signal – connected to pull high resistor CLKI I Clock Input Signal Internally connected to the MCU Master PCK output signal INT O UART Interrupt Output Signal Internally connected to the MCU Master PINT input signal A UART related interrupt will generate a low pulse signal on this line Rev. 1.00 Description 15 November 29, 2012 HT66FU60A/HT66FU70A Enhanced A/D Flash Type 8-Bit MCU with EEPROM and UART Interface Functional Description As these devices packages contain multiple internal chips, for a detailed functional description, users must refer to the relevant individual datasheets for both the MCU and the SPI to UART chip. The following table shows which individual devices are inside each package. Device Part No. HT66FU60A HT66FU70A Individual chips MCU chip SPI to UART chip HT66F60A HT45B0F HT66F70A Although most of the functional description material will be located in the individual datasheets, there are some special considerations which need to be taken into account when using multi-chip devices. These points will be mentioned in the hardware and software consideration sections. Multi-chip Hardware Considerations As these single-package multi-chip devices are composed of an individual MCU and SPI to UART chips, using them together requires the user to take care of some special points. Absolute Maximum Ratings As these single-package multi-chip devices are composed of an individual MCU and SPI to UART chips, using them together requires the user to take care of some special points. Power Supply To calculate the power consumption for the devices, the total operating currnt is the sum of the operating current for the MCU specified in the MCU datasheet and the operating current for the SPI to UART chip listed in the HT45B0F datasheet. Similarly, the standby current is the sum of the two individual chip standby currents. Power Down and Wake up The MCU and SPI to UART chip are powered down independently of each other. The method of powering down the MCU is covered in the relevant MCU datasheet section. Note that the SPI to UART chip must be powered down before the MCU is poweed down. After the device is powered down, it can also be woken up by the SPI to UART chip interrupt except by wake-up sources mentioned in the MCU datasheet. When a UART interrupt occurs on the INT line internally connected to the MCU PINT line, it will wake up the MCU if the MCU has entered a power down mode. After the MCU is woken up, the application program must set the corresponding control bits to make the device function normally. Interrupts When a UART interrupt occurs, a low pulse will be generated on the INT line and sent to the MCU peripheral interrupt line PINT to get the attention of the microcontroller. When the UART interrupt caused by one of the UART interrupt generation sources occurs, if the corresponding interrupt control in the host MCU is enabled and the MCU stack is not full, the program will jump to the corresponding interrupt vector where it can be serviced before returning to the main program. For a UART interrupt to be serviced, in addition to the bits for the corresponding interrupt enable control in the SPI to UART chip being set, the global interrupt enable control and the related interrupt enable control bits in the host MCU must also be set. If these bits are not set, then the interrupt signal will only be a wake-up source and no interrupt will be serviced. Rev. 1.00 16 November 29, 2012 HT66FU60A/HT66FU70A Enhanced A/D Flash Type 8-Bit MCU with EEPROM and UART Interface Unbonded MCU pins Examination of the relevant MCU datasheet will reveal that not all of the MCU I/O port lines are bonded out to external pins. As a result special attention regarding initialixation procedures should be paid to these port lines. If the pins are pin-shared with the analog input pins, they will be setup as analog inputs and the corresponding analog circuits will be disabled after a reset. When these pins are set as analog input pins and the relevant circuits are disabled, they will not consume any power even if the input pin conditions are not kept as either high or low logic levels. However, if the pins are not pin-shared with analog input pins, they will be setup as input states without pull high resistors after a reset. Users should therefore ensure that these pins are setup in input states with pull high resistors or in output states with either a high or low level to avoid additional power consumption resulting from floating input pins. Multi-chip Programming Considerations To use the UART function, several important steps must be implemented to ensure that the SPI to UART chip operates normally. • The SPI interface pin-shared function must be properly configured when the SPI functional pins of the microcontroller are used to control the SPI to UART chip and for transmission and reception. To ensure proper setup between the MCU Master SPI to the SPI to UART chip Slave SPI, the SIM pin-shared function settings together with the PCK and PINT pins in the corresponding MCU pin-shared function selection registers should be setup as shown in the following table. ♦♦ ♦♦ ♦♦ ♦♦ ♦♦ ♦♦ Rev. 1.00 SCS pin-shared function setup in the PDS0 Register Register Bit No. Bit Name Setting Value PDS0 3~0 PD0S [3:0] 0010 SCK pin-shared function setup in the PDS0 Register Register Bit No. Bit Name Setting Value PDS0 7~4 PD1S [3:0] 0010 SDI/SDA pin-shared function setup in the PDS1 and IFS4 Registers Register Bit No. Bit Name Setting Value PDS1 3~0 PD2S [3:0] 0010 IFS4 5~4 SDIS [1:0] 10, 11 SDO pin-shared function setup in the PDS1 Register Register Bit No. Bit Name Setting Value PDS1 7~4 PD3S [3:0] 0100 PCK pin-shared function setup in the PCS2 Register Register Bit No. Bit Name Setting Value PCS2 7~4 PC5S [3:0] 0001 PINT pin-shared function setup in the PCS2 and IFS0 Registers Register Bit No. Bit Name PCS2 3~0 PC4S [3:0] 0000 IFS0 7~6 PINTBS [1:0] 01, 10, 11 17 Setting Value November 29, 2012 HT66FU60A/HT66FU70A Enhanced A/D Flash Type 8-Bit MCU with EEPROM and UART Interface • The SIM operating mode control bits SIM2~SIM0 in the SIMC0 register have to be configured to enable the SIM to operate in the SPI master mode with a different SPI clock frequency. ♦♦ SIM operating mode control bits SIM2~SIM0 in the SIMC0 Register Register Bit Name Setting value SIMC0 7~5 SIM [2:0] 000, 001, 010, 011, 100 SIM [2:0]: SIM Operating Mode Control 000: SPI master mode; SPI clock is fSYS/4 001: SPI master mode; SPI clock is fSYS/16 010: SPI master mode; SPI clock is fSYS/64 011: SPI master mode; SPI clock is fSUB 100: SPI master mode; SPI clock is TM0 CCRP match frequency/2 101~111: must not be used • The PCK enable control bit, TB2EN, must be set to 1 to enable the PCK output as the clock source for the SPI to UART chip external clock input with various PCK output frequencies determined by the TB22, TB21 and TB20 bits in the TBC2 Register together with the peripheral clock source selection bits, CLKS11 and CLKS10, in the PSC1 register. ♦♦ PCK output frequency selection bits PCKP1~PCKP0 in the SIMC0 Register Register TBC2 PSC1 Bit No. Bit Name Setting Value 7 TB2EN 1 2~0 TB2 [2:0] 000~111 1~0 CLKS1 [1:0] 00~11 CLKS1 [1:0]: Peripheral Clock Source Selection – fP 00: fP is derived from fSYS 01: fP is derived from fSYS/4 10: fP is derived from fSUB 11: fP is derived from fH TB2 [2:0]: Peripheral Clock Output Division Selection 000: fP 000: fP/2 000: fP/4 000: fP/8 000: fP/16 000: fP/32 000: fP/64 000: fP/128 The special attention must be paid to the peripheral clock output division selection together with the clock source selection to obtain a proper clock frequency to drive the SPI to UART chip to generate certain baud rates. After the above setup conditions have been implemented, the MCU can enable the SIM interface by setting the SIMEN bit high. The MCU can then begin communication with external UART connected appliances using its SPI interface. The detailed functional descriptions of the MCU Master SPI are provided within the Serial Interface Module section of the relevant MCU datasheet. Rev. 1.00 18 November 29, 2012 HT66FU60A/HT66FU70A Enhanced A/D Flash Type 8-Bit MCU with EEPROM and UART Interface Application Circuits Note: "*" It is recommended that this component is added for added ESD protection. "**" It is recommended that this component is added in environments where power line noise is significant. Rev. 1.00 19 November 29, 2012 HT66FU60A/HT66FU70A Enhanced A/D Flash Type 8-Bit MCU with EEPROM and UART Interface 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. Additional supplementary information with regard to packaging is listed below. Click on the relevant section to be transferred to the relevant website page. • Further Package Information (include Outline Dimensions, Product Tape and Reel Specifications) • Packing Meterials Information • Carton information • PB FREE Products • Green Packages Products Rev. 1.00 20 November 29, 2012 HT66FU60A/HT66FU70A Enhanced A/D Flash Type 8-Bit MCU with EEPROM and UART Interface 48-pin LQFP (7mm×7mm) Outline Dimensions Symbol A B C D E F G H I J K α Symbol A B C D E F G H I J K α Rev. 1.00 Dimensions in inch Min. 0.350 0.272 0.350 0.272 ― ― 0.053 ― ― 0.018 0.004 0° Nom. ― ― ― ― 0.020 0.008 ― ― 0.004 ― ― ― Max. 0.358 0.280 0.358 0.280 ― ― 0.057 0.063 ― 0.030 0.008 7° Dimensions in mm Min. 8.90 6.90 8.90 6.90 ― ― 1.35 ― ― 0.45 0.10 0° Nom. ― ― ― ― 0.50 0.20 ― ― 0.10 ― ― ― 21 Max. 9.10 7.10 9.10 7.10 ― ― 1.45 1.60 ― 0.75 0.20 7° November 29, 2012 HT66FU60A/HT66FU70A Enhanced A/D Flash Type 8-Bit MCU with EEPROM and UART Interface 64-pin LQFP (7mm×7mm) Outline Dimensions Symbol Nom. Max. A 0.350 ― 0.358 B 0.272 ― 0.280 C 0.350 ― 0.358 D 0.272 ― 0.280 E ― 0.016 ― F 0.005 ― 0.009 G 0.053 ― 0.057 H ― ― 0.063 I 0.002 ― 0.006 J 0.018 ― 0.030 K 0.004 ― 0.008 α 0° ― 7° Symbol Rev. 1.00 Dimensions in inch Min. Dimensions in mm Min. Nom. Max. A 8.90 ― 9.10 B 6.90 ― 7.10 C 8.90 ― 9.10 D 6.90 ― 7.10 E ― 0.40 ― F 0.13 ― 0.23 G 1.35 ― 1.45 H ― ― 1.60 I 0.05 ― 0.15 J 0.45 ― 0.75 K 0.09 ― 0.20 α 0° ― 7° 22 November 29, 2012 HT66FU60A/HT66FU70A Enhanced A/D Flash Type 8-Bit MCU with EEPROM and UART Interface Holtek Semiconductor Inc. (Headquarters) No.3, Creation Rd. II, Science Park, Hsinchu, Taiwan Tel: 886-3-563-1999 Fax: 886-3-563-1189 http://www.holtek.com.tw Holtek Semiconductor Inc. (Taipei Sales Office) 4F-2, No. 3-2, YuanQu St., Nankang Software Park, Taipei 115, Taiwan Tel: 886-2-2655-7070 Fax: 886-2-2655-7373 Fax: 886-2-2655-7383 (International sales hotline) Holtek Semiconductor (China) Inc. (Dongguan Sales Office) Building No.10, Xinzhu Court, (No.1 Headquarters), 4 Cuizhu Road, Songshan Lake, Dongguan, China 523808 Tel: 86-769-2626-1300 Fax: 86-769-2626-1311, 86-769-2626-1322 Holtek Semiconductor (USA), Inc. (North America Sales Office) 46729 Fremont Blvd., Fremont, CA 94538, USA Tel: 1-510-252-9880 Fax: 1-510-252-9885 http://www.holtek.com Copyright© 2012 by HOLTEK SEMICONDUCTOR INC. The information appearing in this Data Sheet is believed to be accurate at the time of publication. However, Holtek assumes no responsibility arising from the use of the specifications described. The applications mentioned herein are used solely for the purpose of illustration and Holtek makes no warranty or representation that such applications will be suitable without further modification, nor recommends the use of its products for application that may present a risk to human life due to malfunction or otherwise. Holtek's products are not authorized for use as critical components in life support devices or systems. Holtek reserves the right to alter its products without prior notification. For the most up-to-date information, please visit our web site at http://www.holtek.com.tw. Rev. 1.00 23 November 29, 2012