link to page 24 link to page 25 link to page 26 link to page 26 link to page 26 link to page 27 link to page 27 link to page 27 link to page 27 link to page 28 link to page 29 link to page 29 link to page 30 link to page 33 link to page 33 link to page 33 link to page 33 link to page 35 link to page 35 link to page 35 link to page 36 link to page 36 link to page 36 link to page 36 link to page 37 link to page 38 link to page 40 link to page 44 link to page 44 link to page 45 link to page 45 link to page 45 link to page 46 link to page 47 link to page 47 link to page 49 link to page 52 link to page 52 link to page 53 link to page 53 link to page 53 link to page 58 link to page 58 link to page 59 HT45F5Q-3HT45F5Q-3Battery Charger Flash MCUBattery Charger Flash MCU General Purpose Data Memory ..24 Special Purpose Data Memory ...25 Special Function Register Description ...26 Indirect Addressing Registers – IAR0, IAR1 ...26 Memory Pointers – MP0, MP1 ..26 Bank Pointer – BP ...27 Accumulator – ACC ...27 Program Counter Low Register – PCL ..27 Look-up Table Registers – TBLP, TBHP, TBLH ...27 Status Register – STATUS ..28 Emulated EEPROM Data Memory ...29 Emulated EEPROM Data Memory Structure ..29 Emulated EEPROM Registers ..30 Erasing the Emulated EEPROM ...33 Writing Data to the Emulated EEPROM ..33 Reading Data from the Emulated EEPROM ...33 Programming Considerations ..33 Oscillators ...35 Oscillator Overview ...35 System Clock Configurations ..35 Internal High Speed RC Oscillator – HIRC ...36 Internal 32kHz Oscillator – LIRC ...36 Operating Modes and System Clocks ..36 System Clocks ..36 System Operation Modes ..37 Control Registers ..38 Operating Mode Switching ..40 Standby Current Considerations ...44 Wake-up ..44 Watchdog Timer ..45 Watchdog Timer Clock Source ..45 Watchdog Timer Control Register ...45 Watchdog Timer Operation ...46 Reset and Initialisation ...47 Reset Functions ..47 Reset Initial Conditions ...49 Input/Output Ports ..52 Pull-high Resistors ..52 Port A Wake-up ...53 I/O Port Control Registers ...53 Pin-shared Functions ..53 I/O Pin Structures ..58 READ PORT Function...58 Programming Considerations ..59 Rev. 1.00 2 July 31, 2019 Rev. 1.00 3 July 31, 2019 Document Outline Features CPU Features Peripheral Features General Description Block Diagram Pin Assignment Pin Description Absolute Maximum Ratings D.C. Characteristics Operating Voltage Characteristics Operating Current Characteristics Standby Current Characteristics A.C. Characteristics High Speed Internal Oscillator – HIRC – Frequency Accuracy Low Speed Internal Oscillator Characteristics – LIRC Operating Frequency Characteristic Curves System Start Up Time Characteristics Input/Output Characteristics Memory Characteristics LVR Electrical Characteristics A/D Converter Electrical Characteristics D/A Converter Electrical Characteristics Operational Amplifier Electrical Characteristics Software Controlled LCD Driver Electrical Characteristics Power-on Reset Characteristics System Architecture Clocking and Pipelining Program Counter Stack Arithmetic and Logic Unit – ALU Flash Program Memory Structure Special Vectors Look-up Table Table Program Example In Circuit Programming – ICP On-Chip Debug Support – OCDS Data Memory Structure General Purpose Data Memory Special Purpose Data Memory Special Function Register Description Indirect Addressing Registers – IAR0, IAR1 Memory Pointers – MP0, MP1 Bank Pointer – BP Accumulator – ACC Program Counter Low Register – PCL Look-up Table Registers – TBLP, TBHP, TBLH Status Register – STATUS Emulated EEPROM Data Memory Emulated EEPROM Data Memory Structure Emulated EEPROM Registers Erasing the Emulated EEPROM Writing Data to the Emulated EEPROM Reading Data from the Emulated EEPROM Programming Considerations Oscillators Oscillator Overview System Clock Configurations Internal High Speed RC Oscillator – HIRC Internal 32kHz Oscillator – LIRC Operating Modes and System Clocks System Clocks System Operation Modes Control Registers Operating Mode Switching Standby Current Considerations Wake-up Watchdog Timer Watchdog Timer Clock Source Watchdog Timer Control Register Watchdog Timer Operation Reset and Initialisation Reset Functions Reset Initial Conditions Input/Output Ports Pull-high Resistors Port A Wake-up I/O Port Control Registers Pin-shared Functions I/O Pin Structures READ PORT Function Programming Considerations Timer Modules – TM Introduction TM Operation TM Clock Source TM Interrupts TM External Pins Programming Considerations Compact Type TM – CTM Compact Type TM Operation Compact Type TM Register Description Compact Type TM Operation Modes Standard Type TM – STM Standard TM Operation Standard Type TM Register Description Standard Type TM Operation Modes Analog to Digital Converter A/D Converter Overview A/D Converter Register Description A/D Converter Data Registers – SADOL, SADOH A/D Converter Reference Voltage A/D Converter Input Signal A/D Converter Operation Conversion Rate and Timing Diagram Summary of A/D Conversion Steps Programming Considerations A/D Conversion Function A/D Conversion Programming Examples Battery Charge Module Battery Charge Module Registers Digital to Analog Converter Operational Amplifiers Universal Serial Interface Module – USIM SPI Interface I2C Interface UART Interface Software Controlled LCD Driver LCD Operation LCD Bias Current Control Cyclic Redundancy Check – CRC CRC Registers CRC Operation Interrupts Interrupt Registers Interrupt Operation External Interrupts Time Base Interrupts Multi-function Interrupts TM Interrupts A/D Converter Interrupt USIM Interrupt Interrupt Wake-up Function Programming Considerations Application Descriptions Introduction Functional Description Hardware Circuit Instruction Set Introduction Instruction Timing Moving and Transferring Data Arithmetic Operations Logical and Rotate Operation Branches and Control Transfer Bit Operations Table Read Operations Other Operations Instruction Set Summary Table Conventions Instruction Definition Package Information 24-pin SSOP (150mil) Outline Dimensions 28-pin SSOP (150mil) Outline Dimensions