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 ...........................
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.
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...
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 —...
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 —...
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...
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.
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.
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.
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.
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.
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...
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.
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.
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.
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.
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 — —...
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.
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.
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.
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.
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.
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.
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”...
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.
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.
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”.
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 •...
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...
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.
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...
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.
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.
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.
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 )
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.
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.
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...
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.
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.
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.
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.
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.
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.
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...
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.
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.
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 ;...
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.
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.
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 )
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 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.
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...
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.
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...
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)
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).
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 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...
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 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...
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...
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...
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...
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.
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.
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...
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”...
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.
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.
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.
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...
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.
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.
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.
Need help?
Do you have a question about the HT45F23A and is the answer not in the manual?
Questions and answers