Holtek HT45F23A Manual

Holtek HT45F23A Manual

Tinypower flash mcu with opa & comparators
Table of Contents

Advertisement

Quick Links

TinyPower
Flash MCU with OPA & Comparators
TM
HT45F23A
HT45F24A
Revision: V1.40
Date: March 29, 2019

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Holtek HT45F23A

  • Page 1 TinyPower Flash MCU with OPA & Comparators HT45F23A HT45F24A Revision: V1.40 Date: March 29, 2019...
  • Page 2: Table Of Contents

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Table of Contents Features ......................... 7 CPU Features ..........................7 Peripheral Features ........................8 General Description ....................9 Selection Table ...................... 9 Block Diagram ..................... 10 Pin Assignment ....................10 Pin Description ....................11 Absolute Maximum Ratings ................
  • Page 3 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators EEPROM Data Memory ..................32 EEPROM Data Memory Structure ....................32 EEPROM Registers ........................32 Reading Data from the EEPROM ....................34 Writing Data to the EEPROM ...................... 34 Write Protection ........................... 34 EEPROM Interrupt ........................
  • Page 4 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Timer/Event Counters ..................64 Configuring the Timer/Event Counter Input Clock Source ............64 Timer Registers – TMR0, TMR1L, TMR1H ................. 64 Timer Control Registers – TMR0C, TMR1C ................66 Configuring the Timer Mode ......................66 Configuring the Event Counter Mode ..................
  • Page 5 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators SCOM Function for LCD ................... 105 LCD Operation .......................... 105 LCD Bias Control ........................105 LDO Function ..........................107 Operational Amplifiers ..................109 Operational Amplifier Registers ....................109 Operational Amplifier Operation ....................111 Operational Amplifier Functions ....................112...
  • Page 6 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Instruction Set ....................138 Introduction ..........................138 Instruction Timing ........................138 Moving and Transferring Data ....................138 Arithmetic Operations ........................ 138 Logical and Rotate Operation ....................139 Branches and Control Transfer ....................139 Bit Operations ...........................
  • Page 7: Features

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Features CPU Features • Operating voltage = 32.768kHz: 2.2V~5.5V ♦ = 910kHz: 2.2V~5.5V ♦ = 2MHz: 2.2V~5.5V ♦ = 4MHz: 2.2V~5.5V ♦ = 8MHz: 3.3V~5.5V ♦ • TinyPower technology for low power operation •...
  • Page 8: Peripheral Features

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Peripheral Features • Flash Program Memory: 2K×15~4K×16 • RAM Data Memory: 128×8~192×8 • True EEPROM Memory: 64×8 • Up to 26 bidirectional I/O lines • Watchdog Timer function • Software controlled 4-SCOM lines LCD COM driver with 1/2 bias •...
  • Page 9: General Description

    Flash MCU with OPA & Comparators General Description The HT45F23A and HT45F24A are Flash Memory Tinypower A/D type 8-bit high performance RISC architecture microcontrollers, designed especially for applications that interface directly to analog signals. The devices have higher gain bandwidth making them more suitable for higher frequency applications.
  • Page 10: Block Diagram

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Block Diagram Watchdog Internal RC External Timer Oscillators Oscillators 8-bit Flash/EEPROM RISC Programming Circuitry Reset Circuit Low Voltage Low Voltage Core Detect Reset Interrupt Controller EEPROM Flash RAM Data Time Data Program...
  • Page 11: Pin Description

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Pin Description Pin Name Function Description PAPU CMOS General purpose I/O. Register enabled pull-up, wake-up PAWU PA0/CNP/SCOM0 CMP1C1 CMPI — Comparator input pin SCOM0 LCDC — SCOM Software controlled 1/2 bias LCD COM PAPU CMOS General purpose I/O.
  • Page 12 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Pin Name Function Description PBPU CMOS General purpose I/O. Register enabled pull-up ADCR CMOS A/D channel 1 PB4/AN1/AUD/PCK DACTRL — — D/A output pin — — CMOS Peripheral clock output PBPU CMOS General purpose I/O. Register enabled pull-up...
  • Page 13: Absolute Maximum Ratings

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators 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 Total ........................... 100mA Total ..........................-100mA Total Power Dissipation ......................
  • Page 14 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Test Conditions Symbol Parameter Min. Typ. Max. Unit Conditions No load, f =2MHz, Operating Current ADC off, LVR off, — µA (HXT, ERC, HIRC) Comparator off, OPAs off 3.3V No load, f...
  • Page 15 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Test Conditions Symbol Parameter Min. Typ. Max. Unit Conditions LVDEN=1, V =2.0V LVD1 LVDEN=1, V =2.2V LVD2 LVDEN=1, V =2.4V LVD3 LVDEN=1, V =2.7V LVD4 Low Voltage Detector Voltage — LVDEN=1, V =3.0V...
  • Page 16: A.c. Characteristics

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators A.C. Characteristics Ta=25˚C Test Conditions Symbol Parameter Min. Typ. Max. Unit Conditions 2.2V~5.5V — 4000 System Clock — SYS1 (HXT, ERC, HIRC) 3.3V~5.5V — 8000 3.3V Ta=25˚C 8MHz HIRC 3.3V Ta=-40~85˚C SYS2 2.7V~5.5V Ta=-40~85˚C...
  • Page 17: Op Amplifier Electrical Characteristics

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators OP Amplifier Electrical Characteristics Ta=25˚C Test Conditions Symbol Parameter Min. Typ. Max. Unit Conditions D.C. Characteristic Operating voltage — — — Quiescent current 5V No load, A1OEN/A2OEN fixed to 0 — µA Input offset voltage —...
  • Page 18: Ldo 3.3V

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators LDO 3.3V Ta=25˚C Test Conditions Symbol Parameter Min. Typ. Max. Unit Conditions Supply Voltage — — — DDIN Output Voltage — — 3.13 3.30 3.46 DDOUT Current Consumption — After startup, no load —...
  • Page 19: System Architecture

    Flash MCU with OPA & Comparators System Architecture A key factor in the high-performance features of the Holtek range of microcontrollers is attributed to the internal system architecture. The devices take advantage of the usual features found within RISC microcontrollers providing increased speed of operation and enhanced performance. The pipelining...
  • Page 20: Program Counter

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators For instructions involving branches, such as jump or call instructions, two instruction cycles are required to complete instruction execution. An extra cycle is required as the program takes one cycle to first obtain the actual jump or call address and then another cycle to actually execute the branch.
  • Page 21: Stack

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Stack This is a special part of the memory which is used to save the contents of the Program Counter only. The stack is organized into 6 levels and is neither part of the Data or Program Memory space, and is neither readable nor writeable.
  • Page 22: Flash Program Memory

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Flash Program Memory The Program Memory is the location where the user code or program is stored. For the 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 23: Look-Up Table

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Location 018H This internal vector is used by the Multi-function Interrupt. When the Time Base overflows, the A/D converter completes its conversion process, an active edge appears on the External Peripheral interrupt pin, a Comparator output interrupt, an EEPROM Write or Read cycle ends interrupt, or a LVD detection interrupt, the program will jump to this location and begin execution if the relevant interrupt is enabled and the stack is not full.
  • Page 24 Table Location Note: PC11~PC8:Current Program Counter bits @7~@0:Table Pointer TBLP bits For the HT45F23A, the Table address location is 11 bits, i.e. from b10~b0 For the HT45F24A, the Table address location is 12 bits, i.e. from b11~b0 Table Program Example The accompanying example shows how the table pointer and table data is defined and retrieved from the HT45F24A device.
  • Page 25: In Circuit Programming

    As an additional convenience, Holtek has provided a means of programming the microcontroller in-circuit using a 5-pin interface. This provides manufacturers with the possibility of manufacturing their circuit boards complete with a programmed or un-programmed microcontroller, and then programming or upgrading the program at a later stage.
  • Page 26: Ram Data Memory

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Programmer Pin MCU Pins DATA Programmer and MCU Pins W r i t e r C o n n e c t o r S i g n a l s P r o g r a m m i n g P i n s...
  • Page 27: Structure

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Structure Divided into two sections, the first of these is an area of RAM where special function registers are located. These registers have fixed locations and are necessary for correct operation of the devices.
  • Page 28: Indirect Addressing Registers - Iar0, Iar1

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Indirect Addressing Registers – IAR0, IAR1 The Indirect Addressing Registers, IAR0 and IAR1, although having their locations in normal RAM register space, do not actually physically exist as normal registers. The method of indirect addressing for RAM data manipulation uses these Indirect Addressing Registers and Memory Pointers, in contrast to direct memory addressing, where the actual memory address is specified.
  • Page 29: Bank Pointer - Bp

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Bank Pointer – BP The Data Memory is divided into two Banks, known as Bank 0 and Bank 1. A Bank Pointer, which is bit 0 of the Bank Pointer register is used to select the required Data Memory bank. Only data in Bank 0 can be directly addressed as data in Bank 1 must be indirectly addressed using Memory Pointer MP1 and Indirect Addressing Register IAR1.
  • Page 30: Program Counter Low Register - Pcl

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Program Counter Low Register – PCL To provide additional program control functions, the low byte of the Program Counter is made accessible to programmers by locating it within the Special Purpose area of the Data Memory. By manipulating this register, direct jumps to other program locations are easily implemented.
  • Page 31 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators STATUS Register Name — — — — — — “x” unknown Bit 7, 6 Unimplemented, read as "0" Bit 5 TO: Watchdog Time-Out flag 0: After power up or executing the “CLR WDT” or “HALT” instruction 1: A watchdog time-out occurred.
  • Page 32: Eeprom Data Memory

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators EEPROM Data Memory One of the special features in the devices is its internal EEPROM Data Memory. EEPROM, which stands for Electrically Erasable Programmable Read Only Memory, is by its nature a non-volatile form of memory, with data retention even when its power supply is removed.
  • Page 33 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators EED Register Name “x” unknown Bit 7 ~ 0 D7~D0: Data EEPROM data Data EEPROM data bit 7 ~ bit 0 EEC Register Name — — — — WREN RDEN — —...
  • Page 34: Reading Data From The Eeprom

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Reading Data from the EEPROM To read data from the EEPROM, the read enable bit, RDEN, in the EEC register must first be set high to enable the read function. The EEPROM address of the data to be read must then be placed in the EEA register.
  • Page 35: Programming Considerations

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Programming Considerations Care must be taken that data is not inadvertently written to the EEPROM. Protection can be Periodic by ensuring that the Write Enable bit is normally cleared to zero when not writing. Also the Bank Pointer could be normally cleared to zero as this would inhibit access to Bank 1 where the EEPROM control register exist.
  • Page 36: Oscillator

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Oscillator 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 through a combination of configuration options and registers.
  • Page 37: External Crystal/ Ceramic Oscillator - Hxt

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators H i g h S p e e d O s c i l l a t i o n H X T E R C 6 - s t a g e P r e s c a l e r...
  • Page 38: External Rc Oscillator - Erc

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators 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 39: External Oscillator - Ec

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators External Oscillator – EC The system clock can also be supplied by an externally supplied clock giving users a method of synchronising their external hardware to the microcontroller operation. This is selected using a configuration option and supplying the clock on pin OSC1.
  • Page 40: Lxt Oscillator Low Power Function

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Some configuration options determine if the XT1/XT2 pins are used for the LXT oscillator or as I/O pins. • If the LXT oscillator is not used for any clock source, the XT1/XT2 pins can be used as normal I/O pins.
  • Page 41: Operating Modes And System Clocks

    As Holtek has provided the devices with both high and low speed clock sources and the means to switch between them dynamically, the user can optimise the operation of their microcontroller to achieve the best performance/power ratio.
  • Page 42 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators H i g h S p e e d O s c i l l a t i o n H X T E R C 6 - s t a g e P r e s c a l e r...
  • Page 43 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators NORMAL Mode As the name suggests this is one of the main operating modes where the microcontroller has all of its functions operational and where the system clock is provided by one of the high speed oscillators.
  • Page 44: Control Register

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Control Register A single register, SMOD, is used for overall control of the internal clocks within the devices. SMOD Register Name CKS2 CKS1 CKS0 FSTEN IDLEN HLCLK Bit 7~5 CKS2~CKS0: The system clock selection when HLCLK is “0”...
  • Page 45: Fast Wake-Up

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators IDLEN: IDLE Mode control Bit 1 0: Disable 1: Enable This is the IDLE Mode Control bit and determines what happens when the HALT instruction is executed. If this bit is high, when a HALT instruction is executed the devices will enter the IDLE Mode.
  • Page 46: Operating Mode Switching And Wake-Up

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Operating Mode Switching and Wake-up The devices can switch between operating modes dynamically allowing the user to select the best performance/power ratio for the present task in hand. In this way microcontroller operations that do not require high performance can be executed using slower clocks thus requiring less operating current and prolonging battery life in portable applications.
  • Page 47 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators NORMAL Mode to SLOW Mode Switching When running in the NORMAL Mode, which uses the high speed system oscillator, and therefore consumes more power, the system clock can switch to run in the SLOW Mode by set the HLCLK bit to “0”...
  • Page 48 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators SLOW Mode to NORMAL Mode Switching In SLOW Mode the system uses either the LXT or LIRC low speed system oscillator. To switch back to the NORMAL Mode, where the high speed system oscillator is used, the HLCLK bit should be set to “1”...
  • Page 49 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Entering the SLEEP0 Mode There is only one way for the devices to enter the SLEEP0 Mode and that is to execute the "HALT" instruction in the application program with the IDLEN bit in SMOD register equal to “0” and the WDT and LVD both off.
  • Page 50: Standby Current Considerations

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Entering the IDLE1 Mode There is only one way for the devices to enter the IDLE1 Mode and that is to execute the “HALT” instruction in the application program with the IDLEN bit in SMOD register equal to “1” and the FSYSON bit in WDTC register equal to “1”.
  • Page 51: Wake-Up

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Wake-up After the system enters the SLEEP or IDLE Mode, it can be woken up from one of various sources listed as follows: • An external reset • An external falling edge on Port A •...
  • Page 52: Watchdog Timer

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Watchdog Timer The Watchdog Timer is provided to prevent program malfunctions or sequences from jumping to unknown locations, due to certain uncontrollable external events such as electrical noise. Watchdog Timer Clock Source...
  • Page 53: Watchdog Timer Operation

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Watchdog Timer Operation The Watchdog Timer operates by providing devices reset when their timer overflows. This means that in the application program and during normal operation the user has to strategically clear the Watchdog Timer before it overflows to prevent the Watchdog Timer from executing a reset.
  • Page 54: Reset And Initialisation

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators C L R W D T 1 F l a g C l e a r W D T T y p e C o n f i g u r a t i o n O p t i o n...
  • Page 55 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators RES Pin As the reset pin is shared with PB.6, the reset function must be selected using a configuration option. Although the microcontroller has an internal RC reset function, if the VDD power supply rise time is not fast enough or does not stabilise quickly at power-on, the internal reset function may be incapable of providing proper reset operation.
  • Page 56 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Low Voltage Reset – LVR The microcontroller contains a low voltage reset circuit in order to monitor the supply voltage of the devices, which is selected via a configuration option. If the supply voltage of the devices drop to within a range of 0.9V~V...
  • Page 57: Reset Initial Conditions

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Reset Initial Conditions The different types of reset described affect the reset flags in different ways. These flags, known as PDF and TO are located in the status register and are controlled by various microcontroller operations, such as the SLEEP or IDLE Mode function or Watchdog Timer.
  • Page 58 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators WDT Time-out WDT Time-out Register Power-on Reset RES or LVR Reset (Normal Operation) (Idle/Sleep) ● ● 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
  • Page 59 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators WDT Time-out WDT Time-out Register Power-on Reset RES or LVR Reset (Normal Operation) (Idle/Sleep) ADCR ● 0 1 - - - 0 0 0 0 1 - - - 0 0 0...
  • Page 60: Input/Output Ports

    Flash MCU with OPA & Comparators Input/Output Ports Holtek microcontrollers offer considerable flexibility on their I/O ports. With the input or output designation of every pin fully under user program control, pull-high selections for all ports and wake-up selections on certain pins, the user is provided with an I/O structure to meet the needs of a wide range of application possibilities.
  • Page 61 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators PAWU, PAPU, PA, PAC, PBPU, PB, PBC, PCPU, PC, PCC, PD, PDC Registers • HT45F23A Register Name PAWU PAWU7 PAWU6 PAWU5 PAWU4 PAWU3 PAWU2 PAWU1 PAWU0 PAPU PAPU7 PAPU6 PAPU5 PAPU4 PAPU3...
  • Page 62: I/O Pin Structures

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Port B NMOS Open Drain Control Register Port B pins PB0~PB3 can be setup as open drain structures. This is implemented using the ODE0~ODE3 bits in the MISC register. • MISC Register...
  • Page 63 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators S y s t e m C l o c k P o r t D a t a R e a d f r o m P o r t W r i t e t o P o r t Read Modify Write Timing Port A has the additional capability of providing wake-up functions.
  • Page 64: Timer/Event Counters

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Timer/Event Counters The provision of timers form an important part of any microcontroller, giving the designer a means of carrying out time related functions. The devices contain one 8-bit and one 16-bit count-up timer respectively.
  • Page 65 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators D a t a B u s T 0 M 1 T 0 M 0 T 0 P S C 2 ~ T 0 P S C 0 ( 1 / 1 ~ 1 / 1 2 8 )
  • Page 66: Timer Control Registers - Tmr0C, Tmr1C

    Flash MCU with OPA & Comparators Timer Control Registers – TMR0C, TMR1C The flexible features of the Holtek microcontroller Timer/Event Counters enable them to operate in four different modes, the options of which are determined by the contents of their respective control register.
  • Page 67: Configuring The Event Counter Mode

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Configuring the Event Counter Mode In this mode, a number of internally changing logic events, occurring on the internal comparators output, can be recorded by the Timer/Event Counter. To operate in this mode, the Operating Mode Select bit pair, T0M1/T0M0 or T1M1/T1M0, in the Timer Control Register must be set to the correct value as shown.
  • Page 68 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators If the Active Edge Select bit T0E or T1E, which is bit 3 of the Timer Control Register, is low, once a high to low transition has been received on the external timer pin, TMR0 or TMR1, the Timer/Event Counter will start counting until the external timer pin returns to its original high level.
  • Page 69: Programmable Frequency Divider - Pfd

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Programmable Frequency Divider – PFD The Programmable Frequency Divider provides a means of producing a variable frequency output suitable for applications requiring a precise frequency generator. The PFD output is pin-shared with the I/O pin PA5. The PFD function is enabled via PFDEN bit in MISC register, however, if not enabled, the pin can operate as a normal I/O pin.
  • Page 70 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators TMR0C Register Name T0M1 T0M0 — T0ON T0PSC2 T0PSC1 T0PSC0 — — Bit 7, 6 T0M1, T0M0: Timer 0 operation mode selection 00: event counter mode, the input signal is from Comparator 1 output...
  • Page 71 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators TMR1C Register Name T1M1 T1M0 T1ON — — — — — — — — — Bit 7,6 T1M1, T1M0: Timer1 operation mode selection 00: event counter mode, the input signal is from Comparator 2 output...
  • Page 72: I/O Interfacing

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators I/O Interfacing The Timer/Event Counter, when configured to run in the event counter or pulse width measurement mode, require the use of the external pin for correct operation. As this pin is a shared pin it must be configured correctly to ensure it is setup for use as a Timer/Event Counter input and not as a normal I/O pin.
  • Page 73: Timer Program Example

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators When the Timer/Event counter overflows, its corresponding interrupt request flag in the interrupt control register will be set. If the timer interrupt is enabled this will in turn generate an interrupt signal. However irrespective of whether the interrupts are enabled or not, a Timer/Event counter overflow will also generate a wake-up signal if the devices are in a Power-down condition.
  • Page 74: Pulse Width Modulator

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Pulse Width Modulator The devices contain two channels of 8-bit PWM function respectively. Useful for such applications such as motor speed control, the PWM function provides outputs with a fixed frequency but with a duty cycle that can be varied by setting particular values into the corresponding PWM register.
  • Page 75: 6+2 Pwm Mode

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators 6+2 PWM Mode Each full PWM cycle, as it is controlled by an 8-bit PWM register, has 256 clock periods. However, in the 6+2 PWM mode, each PWM cycle is subdivided into four individual sub-cycles known as modulation cycle 0 ~ modulation cycle 3, denoted as i in the table.
  • Page 76: 7+1 Pwm Mode

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators 7+1 PWM Mode Each full PWM cycle, as it is controlled by an 8-bit PWM register, has 256 clock periods. However, in the 7+1 PWM mode, each PWM cycle is subdivided into two individual sub-cycles known as modulation cycle 0 ~ modulation cycle 1, denoted as i in the table.
  • Page 77: Pwm Output Control

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators PWM Output Control The PWM outputs are pin-shared with the I/O pins PC5 and PC6. To operate as a PWM output and not as an I/O pin, the correct bits must be set in the BPCTL register. A high value must be written to the PWM0EN or PWM1EN to select the corresponding PWM.
  • Page 78: Analog To Digital Converter

    A C S 2 ~ A C S 0 S T A R T E O C B A D O N B HT45F23A A/D Converter Structure S Y S C l o c k A D C S 2 ~ A D C S 0...
  • Page 79: A/D Converter Register Description

    ACSR — ADONB VRSEL — — ADCS2 ADCS1 ADCS0 ADPCR — — PCR5 PCR4 PCR3 PCR2 PCR1 PCR0 HT45F23A A/D Converter Register List Register Name ADCR START EOCB — — ACS3 ACS2 ACS1 ACS0 ACSR — ADONB VRSEL — —...
  • Page 80 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators ADCR Register • HT45F23A Name START EOCB — — — ACS2 ACS1 ACS0 — — — — — — Bit 7 START: Start the A/D conversion 0→1→0: start 0→1: reset the A/D converter and set EOCB to “1”...
  • Page 81 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators ACS3 ~ ACS0: Select A/D channel Bit 3~0 0000: AN0 0001: AN1 0010: AN2 0011: AN3 0100: AN4 0101: AN5 0110: AN8, connect Op Amp 1 output (A1E) 0111: AN9, connect Op Amp 2 output (A2E)
  • Page 82 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators ADPCR Register • HT45F23A Name — — PCR5 PCR4 PCR3 PCR2 PCR1 PCR0 — — — — Bit 7~6 unimplemented, read as “0” PCR5: Define PC1 is A/D input or not Bit 5...
  • Page 83: A/D Operation

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators PCR1: Define PB4 is A/D input or not Bit 1 0: Not A/D input 1: A/D input, AN1 PCR0: Define PB3 is A/D input or not Bit 0 0: Not A/D input...
  • Page 84: A/D Input Pins

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Controlling the power on/off function of the A/D converter circuitry is implemented using the ADONB bit in the ACSR register. This bit must be zero to power on the A/D converter. When the ADONB bit is cleared to zero to power on the A/D converter internal circuitry a certain delay, as indicated in the timing diagram, must be allowed before an A/D conversion is initiated.
  • Page 85: Summary Of A/D Conversion Steps

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators 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 ADCS2~ADCS0 in the ACSR register.
  • Page 86: Programming Considerations

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators A D O N B O N 2 S T A D C M o d u l e o f f o f f A / D s a m p l i n g t i m e...
  • Page 87: A/D Programming Example

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators 1 . 5 L S B F F F H F F E H F F D H A / D C o n v e r s i o n R e s u l t 0 .
  • Page 88 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Example: using the interrupt method to detect the end of conversion clr EADI ; disable ADC interrupt mov a,01H mov ACSR,a ; select f /8 as A/D clock ; select VDD as ADC reference voltage and turn on ADONB bit mov a,FFh ;...
  • Page 89: Serial Interface Module - Sim

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Serial Interface Module – SIM The devices contain a Serial Interface Module respectively, which includes both the four line SPI interface or the two line I C interface types, to allow an easy method of communication with external peripheral hardware.
  • Page 90: Spi Registers

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators The SPI function in this device offers the following features: • Full duplex synchronous data transfer • Both Master and Slave modes • LSB first or MSB first data transmission modes • Transmission complete flag •...
  • Page 91 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators SIMD Register Name “x” unknown Bit 7~0 D7~D0: SIM Data Register bit7~bit0 There are also two control registers for the SPI interface, SIMC0 and SIMC2. Note that the SIMC2 register also has the name SIMA which is used by the I C function.
  • Page 92 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators SIMEN: SIM Control Bit 1 0: Disable 1: Enable The bit is the overall on/off control for the SIM interface. When the SIMEN bit is cleared to zero to disable the SIM interface, the SDI, SDO, SCK and SCS, or SDA and SCL lines will be in a floating condition and the SIM operating current will be reduced to a minimum value.
  • Page 93: Spi Communication

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators CSEN: SPI SCS pin Control Bit 2 0: Disable 1: Enable The CSEN bit is used as an enable/disable for the SCS pin. If this bit is low, then the SCS pin will be disabled and placed into a floating condition. If the bit is high the SCS pin will be enabled and used as a select pin.
  • Page 94 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators S I M E N = 1 , C S E N = 0 ( E x t e r n a l P u l l - H i g h )
  • Page 95: I 2 C Interface

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators 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 I M D...
  • Page 96: I 2 C Registers

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators C Interface Operation The I C serial interface is a two line interface, a serial data line, SDA, and serial clock line, SCL. As many devices may be connected together on the same bus, their outputs are both open drain types.
  • Page 97 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Register Name SIMC0 SIM2 SIM1 SIM0 PCKEN PCKP1 PCKP0 SIMEN — SIMC1 HAAS TXAK IAMWU RXAK SIMD SIMA IICA6 IICA5 IICA4 IICA3 IICA2 IICA1 IICA0 — C Registers List SIMC0 Register Name...
  • Page 98 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators SIMC1 Register Name HAAS TXAK IAMWU RXAK Bit 7 HCF: I C Bus data transfer completion flag 0: Data is being transferred 1: Completion of an 8-bit data transfer The HCF flag is the data transfer flag. This flag will be zero when data is being transferred.
  • Page 99 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators RXAK: I Bit 0 C Bus Receive acknowledge flag 0: Slave receive acknowledge flag 1: Slave do not receive acknowledge flag The RXAK flag is the receiver acknowledge flag. When the RXAK flag is “0”, it means that a acknowledge signal has been received at the 9th clock, after 8 bits of data have been transmitted.
  • Page 100: I 2 C Bus Communication

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators D a t a B u s C D a t a R e g i s t e r S l a v e A d d r e s s R e g i s t e r...
  • Page 101: I 2 C Bus Start Signal

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators S t a r t S E T S I M [ 2 : 0 ] = 1 1 0 S E T S I M E N W r i t e S l a v e...
  • Page 102: I 2 C Bus Read/Write Signal

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators C Bus Read/Write Signal The SRW bit in the SIMC1 register defines whether the slave device wishes to read data from the C bus or write data to the I C bus. The slave device should examine this bit to determine if it is to be a transmitter or a receiver.
  • Page 103 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators S R W A C K S t a r t S l a v e A d d r e s s S C L S D A A C K...
  • Page 104: Peripheral Clock Output

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Peripheral Clock Output The Peripheral Clock Output allows the device to supply external hardware with a clock signal synchronised to the microcontroller clock. Peripheral Clock Operation As the peripheral clock output pin, PCK, is shared with PB4, the required pin function is chosen via PCKEN in the SIMC0 register.
  • Page 105: Scom Function For Lcd

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators SCOM Function for LCD The devices have the capability of driving external LCD panels. The common pins for LCD driving, SCOM0~SCOM3, are pin shared with certain pin on the PA0, PC4~PC6 pins. The LCD signals (COM and SEG) are generated using the application program.
  • Page 106 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators LCDC Register Name — LCDBUF ISEL LCDEN COM3EN COM2EN COM1EN COM0EN — — Bit 7 unimplemented, read as "0" LCDBUF: LCD buffer control bit Bit 6 0: disable 1: enable Bit 5...
  • Page 107: Ldo Function

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators LDO Function The devices contain a low power voltage regulator implemented in CMOS technology. Using CMOS technology ensures low voltage drop and low quiescent current. There are two fixed output voltages of 2.4V and 3.3V, which can be controlled by a specific register. The internal LDO output combined with various options by register can provide a fixed voltage for the LCD bias voltage, the OPA reference voltage, the ADC reference voltage and as a fixed power supply for external device.
  • Page 108 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators The following block diagram illustrates the functional structure for LDO and divided resister. VLOE VSEL VREF/ VCAP LDOEN VLDO VLDO BUF1 VRES VRSEL VLDOX A/D Reference Voltage VH1 (0.9* VLDOX) Converter VH0 (0.5+1/16)* VLDOX) Rtotal = 500K or 200K VM (0.5* VLDOX)
  • Page 109: Operational Amplifiers

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Operational Amplifiers There are two fully integrated Operational Amplifiers in the devices, OPA1 and OPA2. These OPAs can be used for signal amplification according to specific user requirements. The OPAs can be disabled or enabled entirely under software control using internal registers.
  • Page 110 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators A1OEN: OPA1 output enable or disable control bit Bit 1 0: disable 1: enable Note: If OPA1 enable and A1OEN set to 1, the MCU will consumption more DC power (100μA ~ 200μA).
  • Page 111: Operational Amplifier Operation

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators A2OEN: OPA2 output enable or disable control bit Bit 1 0: disable 1: enable Note: If OPA2 enable and A2OEN set to 1, the MCU will consumption more DC power (100μA ~ 200μA).
  • Page 112: Operational Amplifier Functions

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators A1O2N Connect AN6 (A/D) A1NS CINTO Edge Select CMPINT A1PS A1OEN CMPES[1:0] A1PSEL[1:0] C1NSEL C1OUTEN CMP1X A1O2CIN C1OUT C1INTEN A2O2N CINTO C2INTEN A2O2CIN PGAEN PGAEN C2OUT CMP2X C2OUTEN 560K A2NS A1O2A2N A1O2A2P...
  • Page 113 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators S10C CMP1 A1O2N A1O2C1N CMP2 A1O2C2N A1NS OPA2 A1O2A2P OPA1 A1PS A1OEN A1PS=1 will force A1PSEL[1:0]=00, i.e. S10C, S9C, S8C will be opened. A1EN=0 will force the S6C opened by hardware, then the related I/O pins can be used as the other functions.
  • Page 114 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators OPA2 Switch Control The following diagram and table illustrate the OPA2 switch control setting and the corresponding connections. Note that some switch control selections will force some switches to be controlled by hardware automatically.
  • Page 115 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators OPA2 switch control: The following table illustrates the relationship between OPA2 control register settings and the switches: OPA2 Control Bits in OPA2C0, OPA2C1, OPA2C2 Switch Description Results A2PSEL1 S12D~ OPA2 A2PS A2NS...
  • Page 116: Comparators

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Comparators Two analog comparators are contained within the devices. These functions offer flexibility via their register controlled features such as power-down, interrupt etc. Sharing their pins with normal I/O pins, the comparators do not waste precious I/O pins if there functions are otherwise unused. In addition, the devices provide the calibration function to adjust the comparator offset.
  • Page 117 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators CMP1C1 Register Name CNPSEL — — — C1INTEN C1OUTEN C1NSEL CMP1EN — — — — — — Bit 7 CNPSEL: Comparator non-inverting input control bit 0: from OPA output 1: from CNP pin Bit 6~4 unimplemented, read as “0”...
  • Page 118: Comparator Functions

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators CMP2C1 Register Name CMPES1 CMPES0 — — C2INTEN C2OUTEN C2PSEL CMP2EN — — — — Bit 7~6 CMPES1, CMPES0: Interrupt edge control bits 00: disable 01: rising edge trigger 10: falling edge trigger...
  • Page 119 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators The following diagram and table illustrate the comparators switch control setting and the corresponding connections. Note that some switch control selections will force some switches to be controlled by hardware automatically. For example: •...
  • Page 120 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators CMP1 & I/O status description: The following table illustrates the CMP1 & I/O settings. CMP1EN C1OUTEN CNPSEL C1NSEL Description PC5 and PA0 and PA1 are I/Os CNP is from OPA1 or OPA2 output, C1N is from VH0 input, PA1 is I/O...
  • Page 121: Interrupts

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators 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 an A/D converter 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.The devices contain several...
  • Page 122: Interrupt Priority

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Interrupt Priority Interrupts, occurring in the interval between the rising edges of two consecutive T2 pulses, will be serviced on the latter of the two T2 pulses, if the corresponding interrupts are enabled. In case of simultaneous requests, the following table shows the priority that is applied.
  • Page 123 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators INTC1 Register Name — SIMF — EMFI ESIM ET1I — — — — Bit 7 unimplemented, read as “0” MFF: Multi-function interrupt request flag Bit 6 0: inactive 1: active Bit 5...
  • Page 124 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators MFIC0 Register Name TB1F TB0F TB1E TB0E EADI Bit 7 PEF: External peripheral interrupt request flag 0: inactive 1: active Bit 6 TB1F: Time Base 1 interrupt request flag 0: inactive 1: active...
  • Page 125: External Interrupt

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators MFIC1 Register Name — LVDF — ELVDI EE2I — — — — Bit 7 unimplemented, read as “0” LVDF: LVD interrupt request flag Bit 6 0: inactive 1: active Bit 5 E2F: EEPROM interrupt request flag...
  • Page 126 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators M C U F i l t e r O n / O f f C o n f i g u r a t i o n O p t i o n...
  • Page 127: External Peripheral Interrupt

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators INTEDGE Register Name — — — — INT1S1 INT1S0 INT0S1 INT0S0 — — — — — — — — Bit 7~4 unimplemented, read as “0” INT1S1, INT1S0: INT1 Edge select Bit 3~2...
  • Page 128: Spi/I 2 C Interface Interrupt

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators SIM Interface Interrupt For an SIM interrupt to occur, the global interrupt enable bit, EMI, and the corresponding interrupt enable bit, ESIM must be first set. An actual SIM interrupt will take place when the SIM interface...
  • Page 129: Time Base Interrupt

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Time Base Interrupt The function of the Time Base Interrupts is to provide regular time signal in the form of an internal interrupt. They are controlled by the overflow signals from their respective timer functions. When these happens their respective interrupt request flags, TB0F or TB1F will be set.
  • Page 130: Comparator Interrupt

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Comparator Interrupt The Comparator Interrupt is contained within the Multi-function Interrupt. The comparator interrupt is controlled by the two internal comparators. A comparator interrupt request will take place when the comparator interrupt request flag, CF, is set, a situation that will occur when the comparator output changes state.
  • Page 131: Programming Considerations

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Programming Considerations By disabling the interrupt enable bits, a requested interrupt can be prevented from being serviced, however, once an interrupt request flag is set, it will remain in this condition in the INTC0, INTC1,MFIC0 and MFIC1 registers until the corresponding interrupt is serviced or until the request flag is cleared by the application program.
  • Page 132 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators BPCTL Register Name PMODE PWM0EN PWM1EN Bit 7~5 PWM control bits BC1~BC0: Buzzer or I/O Bit 4~3 00: PA7 is I/O, PA6 is I/O 01: PA7 is I/O, PA6 is BZ 10: reserved...
  • Page 133: Low Voltage Detector - Lvd

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators I n t e r n a l C l o c k S o u r c e , f P A 6 D a t a B Z O u t p u t a t P A 6...
  • Page 134: Lvd Operation

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators LVDC Register Name — — LVDO LVDEN — VLVD2 VLVD1 VLVD0 — — — — — — Bit 7~6 unimplemented, read as “0” LVDO: LVD Output Flag Bit 5 0: no Low Voltage Detect...
  • Page 135: Voice Output

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Voice Output Voice Control The voice control register controls the DAC circuit. If the DAC circuit is not enabled, any DAH/ DAL outputs will be invalid. Writing a “1” to the DACEN bit will enable the DAC circuit and channel the DAC output to its corresponding I/O pin, while writing a “0”...
  • Page 136: Configuration Options

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Configuration Options Configuration options refer to certain options within the MCU that are programmed into the OTP Program Memory devices during the programming process. During the development process, these options are selected using the HT-IDE software development tools. As these options are programmed into the device using the hardware programming tools, once they are selected they can not be changed later by the application software.
  • Page 137: Application Circuits

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Application Circuits P A 0 ~ P A 7 V D D 0 . 1 m F P B 0 ~ P B 6 V S S P C 0 ~ P C 6...
  • Page 138: Instruction Set

    In the case of Holtek microcontroller, a comprehensive and flexible set of over 60 instructions is provided to enable programmers to implement their application with the minimum of programming overheads.
  • Page 139: Logical And Rotate Operation

    The standard logical operations such as AND, OR, XOR and CPL all have their own instruction within the Holtek microcontroller instruction set. As with the case of most instructions involving data manipulation, data must pass through the Accumulator which may involve additional programming steps.
  • Page 140: Instruction Set Summary

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Instruction Set Summary The following table depicts a summary of the instruction set categorised according to function and can be consulted as a basic instruction reference using the following listed conventions. Table Conventions...
  • Page 141 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Mnemonic Description Cycles Flag Affected Data Move MOV A,[m] Move Data Memory to ACC None MOV [m],A Move ACC to Data Memory Note None MOV A,x Move immediate data to ACC None Bit Operation CLR [m].i...
  • Page 142: Instruction Definition

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators Instruction Definition Add Data Memory to ACC with Carry ADC A,[m] Description The contents of the specified Data Memory, Accumulator and the carry flag are added. The result is stored in the Accumulator.
  • Page 143 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators CALL addr Subroutine call Description Unconditionally calls a subroutine at the specified address. The Program Counter then increments by 1 to obtain the address of the next instruction which is then pushed onto the stack.
  • Page 144 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators CPLA [m] Complement Data Memory with result in ACC Description Each bit of the specified Data Memory is logically complemented (1′s complement). Bits which previously contained a 1 are changed to 0 and vice versa. The complemented result is stored in the Accumulator and the contents of the Data Memory remain unchanged.
  • Page 145 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators JMP addr Jump unconditionally Description The contents of the Program Counter are replaced with the specified address. Program execution then continues from this new address. As this requires the insertion of a dummy instruction while the new address is loaded, it is a two cycle instruction.
  • Page 146 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators RET A,x Return from subroutine and load immediate data to ACC Description The Program Counter is restored from the stack and the Accumulator loaded with the specified immediate data. Program execution continues at the restored address.
  • Page 147 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators RRA [m] Rotate Data Memory right with result in ACC Description Data in the specified Data Memory and the carry flag are rotated right by 1 bit with bit 0 rotated into bit 7. The rotated result is stored in the Accumulator and the contents of the Data Memory remain unchanged.
  • Page 148 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators SDZA [m] Skip if decrement Data Memory is zero with result in ACC Description The contents of the specified Data Memory are first decremented by 1. If the result is 0, the following instruction is skipped.
  • Page 149 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators SUBM A,[m] Subtract Data Memory from ACC with result in Data Memory Description The specified Data Memory is subtracted from the contents of the Accumulator. The result is stored in the Data Memory. Note that if the result of subtraction is negative, the C flag will be cleared to 0, otherwise if the result is positive or zero, the C flag will be set to 1.
  • Page 150 HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators TABRD [m] Read table (specific page or current page) to TBLH and Data Memory Description The low byte of the program code addressed by the table pointer (TBHP and TBLP or only TBLP if no TBHP) is moved to the specified Data Memory and the high byte moved to TBLH.
  • Page 151: Package Information

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators 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 the latest version of the Package/Carton Information.
  • Page 152: 16-Pin Nsop(150Mil) Outline Dimensions

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators 16-pin NSOP(150mil) Outline Dimensions & Dimensions in inch Symbol Min. Nom. Max. — 0.236 BSC — — 0.154 BSC — 0.012 — 0.020 C’ — 0.390 BSC — — — 0.069 —...
  • Page 153: 20-Pin Ssop (150Mil) Outline Dimensions

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators 20-pin SSOP (150mil) Outline Dimensions Dimensions in inch Symbol Min. Nom. Max. — 0.236 BSC — — 0.154 BSC — 0.008 — 0.012 C’ — 0.341 BSC — — — 0.069 —...
  • Page 154: 24-Pin Ssop (150Mil) Outline Dimensions

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators 24-pin SSOP (150mil) Outline Dimensions " Dimensions in inch Symbol Min. Nom. Max. — 0.236 BSC — — 0.154 BSC — 0.008 — 0.012 C’ — 0.341 BSC — — — 0.069 —...
  • Page 155: 28-Pin Ssop (150 Mil) Outline Dimensions

    HT45F23A/HT45F24A TinyPower Flash MCU with OPA & Comparators 28-pin SSOP (150 mil) Outline Dimensions &  " Dimensions in inch Symbol Min. Nom. Max. — 0.236 BSC — — 0.154 BSC — 0.008 — 0.012 C’ — 0.390 BSC —...
  • Page 156 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.

This manual is also suitable for:

Ht45f24a

Table of Contents