Wireless Charger A/D Flash 8-Bit MCU HT66FW2230 Revision: V1.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Table of Contents Features............................................................................................................. 7 CPU Features.......................................................................................................................... 7 Peripheral Features.................................................................................................................. 7 General Description...............................
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU EEPROM Data Memory................................................................................... 27 EEPROM Data Memory Structure......................................................................................... 27 EEPROM Registers............................................................................................................... 27 Reading Data from the EEPROM .............................................................................
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Timer Modules – TM....................................................................................... 58 Introduction............................................................................................................................ 58 TM Operation......................................................................................................................... 58 TM Clock Source..............................................................
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU I2C Interface .................................................................................................... 93 I2C Interface Operation .......................................................................................................... 93 I2C Registers.......................................................................................................................... 94 I2C Bus Communication .................................................
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Low Voltage Detector – LVD........................................................................ 128 LVD Register........................................................................................................................ 128 LVD Operation...................................................................................................................... 129 Application Circuits..................................................................
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Features CPU Features • Operating Voltage : fSYS = 20MHz: 4.0V~5.5V • Up to 0.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU General Description The device is Flash Memory A/D type 8-bit high performance ASSP architecture microcontrollers and specially designed for wireless power transmission control. Offering users the convenience of Flash Memory multi-programming features, this device also includes a wide range of functions and features.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Pin Assignment PC5/COMM�/AX PA6/A�6/CP 1 �8 PC�/COMM1/A� � �7 COMM0 PA1/C� 3 �6 PB1/CX PA0/SDA/A�0/ICPDA/OCDSDA � �5 5 �� PA7/TCK1/A�7 PA5/A�5 PA�/A�� PA�/SCL/A��/ICPCK/OCDSCK 6 �3 PA3/A�3/VREF VSS 7 �� OCP/A�1 PLLCOM VDD 8 �1 PC3/PWM3 PC�/PWM� 9 �0 10 19 AVSS AVDD PC1/PWM1 11 18 PC6/OSC1 PC0/PWM0 PB�/SDA/TP1_0 1� 17 PC7/OSC� 13 16 PB0/I�T1/TCK0 PB3/SCL/TP1_1 1� 15 PB�/TP0/I�T0/DEMO HT66FW2230 28 SSOP-A Pin Desc
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Pin Name PA5/AN5 PA6/ AN6/ CP PA7/TCK1/ AN7 PB0/INT1/ TCK0 PB1/CX PB2/SDA / TP1_0 PB3/SCL / TP1_1 PB4/TP0/ INT0/ DEMO PC0/PWM0 PC1/PWM1 PC2/PWM2 PC3/PWM3 PC4/ COMM1/ AN Rev. 1.10 Function OPT I/T O/T PA5 PAPU PAWU PAS1 Description ST CMOS AN5 PAS1 AN — PA6 PAPU PAWU PAS1 ST CMOS AN6 PAS1 AN — ADC input channel CP PAS1 AN — Comparator input PA7 PAPU PAWU PAS1 ST CMOS General purpose I/O.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Pin Name PC5/ COMM2/ AX PC6/OSC1 PC7/OSC2 Function OPT I/T O/T PC5 PCPU PCS1 Description ST CMOS COMM2 DCMISC PCS1 AN — Demodulation input AX PCS1 — AO OPA output PC6 PCPU PCS1 ST CMOS OSC1 PCS1 AN — PC7 PCPU PCS1 ST CMOS General purpose I/O. Register enabled pull-up. General purpose I/O. Register enabled pull-up. HXT General purpose I/O. Register enabled pull-up.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU D.C. Characteristics Ta= 25˚C Symbol Parameter Test Conditions VDD Conditions Min. Typ. Max. Unit VDD Operating Voltage — fSYS=20MHz 4.0 — 5.5 V IDD1 Operating Current, Normal Mode, fSYS=fH 5V No load, fH=20MHz, ADC off, WDT enable — 5.0 7.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU A.C. Characteristics Ta= 25˚C Symbol fSYS Parameter System Clock Test Conditions VDD Conditions 4.0V~5.5V 5V — Ta = 25°C Min. Typ. Max. Unit — — 20 MHz -10% 32 +10% kHz -30% 32 +60% kHz fSUB System Clock (LIRC) tTIMER TCKn , TPn Input Pin Pulse Width — — 0.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU PLL Electrical Characteristics Ta= 25˚C Symbol Parameter Test Conditions VDD Conditions 5V — IPLL Power Consumption fPLL PLL Frequency Deviation (HXT) tSTB0 Stable Time (Change Frequency) 5V tSTB1 Stable Time (PLL off→on) 5V Jitter PLL Timing Jitter 5V Min. Typ. Max. Unit mA — — 1.5 — 0.05 — % — 2 3 ms — — — 8 ms — — — 0.1 % 4.0~5.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Reference Voltage Electrical Characteristics Ta= 25˚C Symbol Parameter Test Conditions VDD Conditions — IBG Additional Power Consumption if VBG Reference with Buffer is used 5V Min. Typ. Max. Unit — 200 300 μA V VBG Reference Voltage 5V Ta=25°C -3% 1.04 +3% VREF Reference Voltage 5V Ta=25°C -3% 2.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU System Architecture A key factor in the high-performance features of the Holtek range of microcontrollers is attributed to their internal system architecture. The device takes advantage of the usual features found within RISC microcontrollers providing increased speed of operation and Periodic performance.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Instruction Fetching Program Counter During program execution, the Program Counter is used to keep track of the address of the next instruction to be executed.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU P ro g ra m T o p o f S ta c k S ta c k L e v e l 1 S ta c k L e v e l 2 S ta c k P o in te r B o tto m C o u n te r S ta c k L e v e l 3 o f S ta c k P ro g ra m M e m o ry S ta c k L e v e l 8 Arithmetic and Logic Unit – ALU The arithmetic-logic unit or ALU is a critical area of the microcontroller that carries out arithmetic and logic operations of the instruction set.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Program Memory Structure Look-up Table Any location within the Program Memory can be defined as a look-up table where programmers can store fixed data. To use the look-up table, the table pointer must first be setup by placing the address of the look up data to be retrieved in the table pointer register, TBLP and TBHP. These registers define the total address of the look-up table.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Table Program Example The following example shows how the table pointer and table data is defined and retrieved from the microcontroller. This example uses raw table data located in the Program Memory which is stored there using the ORG statement. The value at this ORG statement is “F00H” which refers to the start address of the last page within the 4K words Program Memory of the device. The table pointer is setup here to have an initial value of “06H”.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU In Circuit Programming – ICP The provision of Flash type Program Memory provides the user with a means of convenient and easy upgrades and modifications to their programs on the same device. As an additional convenience, Holtek has provided a means of programming the microcontroller in-circuit using a 4-pin interface.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU On-Chip Debug Support – OCDS There is an EV chip named HT66VW230 which is used to emulate the HT66FW2230 device. The HT66VW230 device also provides the “On-Chip Debug” function to debug the HT66FW2230 device during development process. The device, HT66FW2230, is almost functional compatible except the “On-Chip Debug” function and package types.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Special Function Register Description Most of the Special Function Register details will be described in the relevant functional section, however several registers require a separate description in this section. Indirect Addressing Registers – IAR0, IAR1, IAR2 The Indirect Addressing Registers, IAR0, IAR1 and IAR2, although having their locations in normal RAM register space, do not actually physically exist as normal registers.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Accumulator – ACC The Accumulator is central to the operation of any microcontroller and is closely related with operations carried out by the ALU. The Accumulator is the place where all intermediate results from the ALU are stored. Without the Accumulator it would be necessary to write the result of each calculation or logical operation such as addition, subtraction, shift, etc., to the Data Memory resulting in higher programming and timing overheads.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU • PDF is cleared by a system power-up or executing the “CLR WDT” instruction. PDF is set by executing the “HALT” instruction. • TO is cleared by a system power-up or executing the “CLR WDT” or “HALT” instruction. TO is set by a WDT time-out. • SC is the result of the “XOR” operation which is performed by the OV flag and the MSB of the current instruction operation result.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU EEPROM Data Memory One of the special features in the device 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. By incorporating this kind of data memory, a whole new host of application possibilities are made available to the designer.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU EED Register Bit 7 6 5 4 3 2 1 0 Name D7 D6 D5 D4 D3 D2 D1 D0 R/W R/W R/W R/W R/W R/W R/W R/W R/W POR 0 0 0 0 0 0 0 0 Bit 7 ~ 0 Data EEPROM data Data EEPROM data bit 7 ~ bit 0 EEC Register Bit 7 6 5 4 3 2 1 0 Name — — — — WREN WR RDEN RD R/W — — — — R/W R/W R/W R/W POR — — — — 0 0 0 0 Bit 7 ~ 4 Unimplemented, read as "0" Bit 3 WREN: Data EEPROM Write Enable 0: Disable 1: Enable This i
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU 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. If the RD bit in the EEC register is now set high, a read cycle will be initiated. Setting the RD bit high will not initiate a read operation if the RDEN bit has not been set.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU 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 Memory Pointer could be normally cleared to zero as this would inhibit access to Bank 1 where the EEPROM control register exist.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Oscillator Various oscillator configurations 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 the registers.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU External Crystal/ Ceramic Oscillator – HXT The External Crystal/Ceramic System Oscillator is one of the high frequency oscillator choices, which is selected via registers. For most crystal oscillator configurations, the simple connection of a crystal across OSC1 and OSC2 will create the necessary phase shift and feedback for oscillation, without requiring external capacitors.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Operating Modes and System Clocks Present day applications require that their microcontrollers have high performance but often still demand that they consume as little power as possible, conflicting requirements that are especially true in battery powered portable applications. The fast clocks required for high performance will by their nature increase current consumption and of course vice-versa, lower speed clocks reduce current consumption.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU System Operation Modes There are six different modes of operation for the microcontroller, each one with its own special characteristics and which can be chosen according to the specific performance and power requirements of the application. There are two modes allowing normal operation of the microcontroller, the NORMAL Mode and SLOW Mode.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU IDLE2 Mode The IDLE2 Mode is entered when an HALT instruction is executed and when the FHIDEN bit in the SCC register is high and the FSIDEN bit in the SCC register is low. In the IDLE2 Mode the CPU will be switched off but the high speed oscillator will be turned on to provide a clock source to keep some peripheral functions operational. MCD (Missing Clock Detector) function There is a Missing Clock Detector, MCD, in this device.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU HXTC Register Bit 7 6 5 4 3 2 1 0 Name — — — — — — HXTF HXTEN R/W — — — — — — R R/W POR — — — — — — 0 0 Bit 7~4 Unimplemented, read as “0” Bit 1 HXTF: HXT clock stable flag 0: unstable 1: stable This bit is used to indicate whether the HXT oscillator is stable or not.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Entering the SLEEP Mode There is only one way for the device to enter the SLEEP Mode and that is to execute the “HALT” instruction in the application program with both the FHIDEN and FLIDEN bits in the SCC register equal to “0”. When this instruction is executed under the conditions described above, the following will occur: • The system clock will be stopped and the application program will stop at the "HALT" instruction.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Entering the IDLE2 Mode There is only one way for the device to enter the IDLE2 Mode and that is to execute the “HALT” instruction in the application program with the FHIDEN bit in the SCC register equal to “1” and the FLIDEN bit in SCC register equal to “0”.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Wake-up To minimise power consumption the device can enter the SLEEP or any IDLE Mode, where the CPU will be switched off. However when the device is woken up again, it can take a considerable time for the original system oscillator to restart, stabilise and allow normal operation to resume.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU 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 The Watchdog Timer clock source is sourced from LIRC oscillators. The LIRC internal oscillator has an approximate frequency of 32kHz and this specified internal clock period can vary with VDD, temperature and process variations.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Bit 0 WRF: reset caused by WE[4:0] setting 0: Not occur 1: Occurred This bit is set to 1 by the WDT Control register software reset and cleared by the application program. Note that this bit can only be cleared to 0 by the application program. Watchdog Timer Operation The Watchdog Timer operates by providing a device reset when its timer overflows.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU WDTC WE�~WE0 �its Registe� Reset MCU CLR “HALT”Inst�uction “CLR WDT”Inst�uction fSUB 8-stage Divide� fSUB/�8 WDT P�escale� WS�~WS0 8-to-1 MUX WDT Ti�e-out (�8/fSUB ~ �18/fSUB) Watchdog Timer Reset and Initialisation A reset function is a fundamental part of any microcontroller ensuring that the device can be set to some predetermined condition irrespective of outside parameters.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Reset Functions There are several ways in which a microcontroller reset can occur, through events occurring internally. Power-on Reset The most fundamental and unavoidable reset is the one that occurs after power is first applied to the microcontroller. As well as ensuring that the Program Memory begins execution from the first memory address, a power-on reset also ensures that certain other registers are preset to known conditions.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU • LVRC Register Bit 7 6 5 4 3 2 1 0 Name LVS7 LVS6 LVS5 LVS4 LVS3 LVS2 LVS1 LVS0 R/W R/W R/W R/W R/W R/W R/W R/W R/W POR 0 1 0 1 0 1 0 1 Bit 2 ~ 0 LVS[7:0]: LVR voltage select 01010101B: 2.1V (default) 00110011B: 2.55V 10011001B: 3.15V 10101010B: 3.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Watchdog Time-out Reset during SLEEP or IDLE Mode The Watchdog time-out Reset during SLEEP or IDLE Mode is a little different from other kinds of reset. Most of the conditions remain unchanged except that the Program Counter and the Stack Pointer will be cleared to “0” and the TO flag will be set to “1”. Refer to the A.C. Characteristics for tSST details.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU 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.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Reset (Power On) WDT Time-out (Normal Operation) WDT Time-out (HALT)* INTC1 0000 0000 0000 0000 uuuu uuuu INTC2 0000 0000 0000 0000 uuuu uuuu MFI0 --00 --00 --00 --00 --uu --uu Register Rev. 1.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Reset (Power On) WDT Time-out (Normal Operation) WDT Time-out (HALT)* IICC0 ---- 000- ---- 000- ---- uuu- IICC1 1000 0001 1000 0001 uuuu uuuu IICD xxxx xxxx xxxx xxxx uuuu uuuu IICA 0000 000- 0000 000- uuuu uuu- I2CTOC 0000 0000 0000 0000 uuuu uuuu CKGEN 0000 ---- 0000 ---- uuuu ---- PLLFL 0000 0000 0000 0000 uuuu uuuu PLLFH ---- -000 ---- -000 ---- -uuu PWMC 0101 0000 0101 0000 uuuu uuuu DEMC0 00-- 0000 00-- 0000 00-
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU 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. The device provides bidirectional input/output lines labeled with port names PA, PB and PC.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU PCPU Register Bit 7 6 5 4 3 2 1 0 Name D7 D6 D5 D4 D3 D2 D1 D0 R/W R/W R/W R/W R/W R/W R/W R/W R/W POR 0 0 0 0 0 0 0 0 Bit 7 ~ 0 I/O Port C bit 7~ bit 0 Pull-High Control 0: Disable 1: Enable Port A Wake-up The HALT instruction forces the microcontroller into the SLEEP or IDLE Mode which preserves power, a feature that is important for battery and other low-power applications.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU PBC Register Bit 7 6 5 4 3 2 1 0 Name — — — D4 D3 D2 D1 D0 R/W — — — R/W R/W R/W R/W R/W POR — — — 1 1 1 1 1 3 2 1 0 Bit 7~ 5 Unimplemented, read as “0” Bit 4 ~ 0 I/O Port B bit 4 ~ bit 0 Input/Output Control 0: Output 1: Input PCC Register Bit 7 6 5 4 Name D7 D6 D5 D4 D3 D2 D1 D0 R/W R/W R/W R/W R/W R/W R/W R/W R/W POR 1 1 1 1 1 1 1 1 Bit 7 ~ 0 I/O Port C bit 7 ~ bit 0 Input/Output C
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU A/D Input/Output Structure Pin-sharing Functions The flexibility of the microcontroller ra
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU PAS1 Register Bit 7 6 5 4 3 2 1 0 Name PAS17 PAS16 PAS15 PAS14 PAS13 PAS12 PAS11 PAS10 R/W R/W R/W R/W R/W R/W R/W R/W R/W POR 0 0 0 0 0 0 0 0 Bit 7~6 PAS17~PAS16: PA7 Pin Share setting 00: PA7 01: PA7 10: PA7 11: AN7 Bit 5~4 PAS15~PAS14: PA6 Pin Share setting 00: PA6 01: PA6 10: CP/AN6 11: AN6 Bit 3~2 PAS13~PAS12: PA5 Pin Share setting 00: PA5 01: PA5 10: PA5 11: AN5 Bit 1~0 PAS11~PAS10: PA4 Pin Share setting 00: PA4
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU PCS0 Register Bit 7 6 5 4 3 2 1 0 Name PCS07 PCS06 PCS05 PCS04 PCS03 PCS02 PCS01 PCS00 R/W R/W R/W R/W R/W R/W R/W R/W R/W POR 0 0 0 0 0 0 0 0 Bit 7~6 PCS07~PCS06: PC3 Pin Share setting 00: PC3 01: PWM3 (=PWM13) 10: PWM3B (=PWM13B) 11: PC3 Bit 5~4 PCS05~PCS04: PC2 Pin Share setting 00: PC2 01: PWM2 (=PWM12) 10: PWM2B (=PWM12B) 11: PC2 Bit 3~2 PCS03~PCS02: PC1 Pin Share setting 00: PC1 01: PWM1 (=PWM11) 10: PWM1B (=PW
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU IFS0 Register Bit 7 6 5 4 3 2 1 0 Name — — — — — IFS02 IFS01 IFS00 R/W — — — — — R/W R/W R/W POR — — — — — 0 0 0 Bit 7~3 Unimplemented, read as 0 Bit 2 IFS02: I2C SDA input source selection 0: PA0 1: PB2 Bit 1 IFS01: I2C SCL input source selection 0: PA2 1: PB3 Bit 0 IFS00: TP0 input source selection 0: TP0 1: DEMO Programming Considerations Within the user program, one of the first things to consider is port initial
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Timer Modules – TM One of the most fundamental functions in any microcontroller device is the ability to control and measure time. To implement time related functions the device includes several Timer Modules, abbreviated to the name TM. The TMs are multi-purpose timing units and serve to provide operations such as Timer/Counter, Input Capture, Compare Match Output and Single Pulse Output as well as being the functional unit for the generation of PWM signals.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU TM Interrupts The two different types of TMs have two internal interrupts, the internal comparator A or comparator P, which generate a TM interrupt when a compare match condition occurs. When a TM interrupt is generated, it can be used to clear the counter and also to change the state of the TM output pin. TM External Pins Each of the TMs, irrespective of what type, has one TM input pin, with the label TCKn.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU 0 P B 2 O u tp u t F u n c tio n 1 O u tp u t P B 2 /T P 1 _ 0 P B S 0 3 ~ P B S 0 2 0 P B 3 O u tp u t F u n c tio n 1 O u tp u t P B 3 /T P 1 _ 1 P B S 0 5 ~ P B S 0 4 T C K In p u t P A 7 /T C K 1 TM1 Function Pin Control Block Diagram Note: 1. The I/O register data bits shown are used for TM output inversion control. 2. In the Capture Input Mode, the TM pin control register must never enable more than one TM input.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Compact Type TM – CTM Although the simplest form of the two TM types, the Compact TM type still contains three operating modes, which are Compare Match Output, Timer/Event Counter and PWM Output modes. The Compact TM can also be controlled with an external input pin and can drive two external output pins. These two external output pins can be the same signal or the inverse signal.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Compact Type TM Register Description Overall operation of the Compact TM is controlled using a series of registers. A read only register pair exists to store the internal counter 10-bit value, while a read/write register pair exists to store the internal 10-bit CCRA value. The remaining two registers are control registers which setup the different operating and control modes as well as the three or eight CCRP bits.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU TM1C0 Register Bit 7 6 5 4 3 2 1 0 Name T1PAU T1CK2 T1CK1 T1CK0 T1ON T1RP2 T1RP1 T1RP0 R/W R/W R/W R/W R/W R/W R/W R/W R/W POR 0 0 0 0 0 0 0 0 Bit 7 T1PAU: TM1 Counter Pause Control 0: Run 1: Pause The counter can be paused by setting this bit high. Clearing the bit to zero restores normal counter operation. When in a Pause condition the TM will remain powered up and continue to consume power.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU TM1C1 Register Rev. 1.10 Bit 7 6 5 4 3 2 1 0 Name T1M1 T1M0 T1IO1 T1IO0 T1OC T1POL T1DPX T1CCLR R/W R/W R/W R/W R/W R/W R/W R/W R/W POR 0 0 0 0 0 0 0 0 Bit 7~6 T1M1~T1M0: Select TM1 Operating Mode 00: Compare Match Output Mode 01: Undefined 10: PWM Mode 11: Timer/Counter Mode These bits setup the required operating mode for the TM.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Rev. 1.10 Bit 3 T1OC: TP1_0, TP1_1 Output control bit Compare Match Output Mode 0: Initial low 1: Initial high PWM Mode 0: Active low 1: Active high This is the output control bit for the TM1 output pin. Its operation depends upon whether TM1 is being used in the Compare Match Output Mode or in the PWM Mode. It has no effect if the TM1 is in the Timer/Counter Mode.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Compact Type TM Operating Modes The Compact Type TM can operate in one of three operating modes, Compare Match Output Mode, PWM Mode or Timer/Counter Mode. The operating mode is selected using the T1M1 and T1M0 bits in the TM1C1 register. Compare Match Output Mode To select this mode, bits T1M1 and T1M0 in the TM1C1 register, should be set to “00” respectively. In this mode once the counter is enabled and running it can be cleared by three methods.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Counter Value CCRP = 0 TnCCLR = 0; TnM[1:0] = 00 Counter overflow 0x3FF CCRP > 0 Counter cleared by CCRP value CCRP > 0 CCRP Pause Resume CCRA Counter Reset Stop Time TnON bit TnPAU bit TnAPOL bit CCRP Int. Flag TnPF CCRA Int.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU TnCCLR = 1; TnM1, TnM0 = 00 Counter Value CCRA = 0 Counter overflows CCRA > 0 Counter cleared by CCRA value 0x3FF CCRA = 0 CCRA Pause Resume Counter Reset Stop CCRP Time TnON bit TnPAU bit TnPOL bit No TnAF flag generated on CCRA overflow CCRA Int. Flag TnAF CCRP Int.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Timer/Counter Mode To select this mode, bits T1M1 and T1M0 in the TM1C1 register should be set to 11 respectively. The Timer/Counter Mode operates in an identical way to the Compare Match Output Mode generating the same interrupt flags. The exception is that in the Timer/Counter Mode the TM output pin is not used. Therefore the above description and Timing Diagrams for the Compare Match Output Mode can be used to understand its function.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Counter Value TnDPX = 0; TnM1, TnM0 = 10 Counter Cleared by CCRP CCRP Pause Resume Counter Stop if TnON bit low Counter reset when TnON returns high CCRA Time TnON bit TnPAU bit TnPOL bit Interrupts still generated CCRA Int. Flag TnAF CCRP Int.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Counter Cleared by CCRA Counter Value TnDPX = 1; TnM1, TnM0 = 10 CCRA Pause Resume Counter Stop if TnON bit low Counter reset when TnON returns high CCRP Time TnON bit TnPAU bit TnPOL bit Interrupts still generated CCRP Int. Flag TnPF CCRA Int.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Standard Type TM – STM The Standard Type TM contains five operating modes, which are Compare Match Output, Timer/ Event Counter, Capture Input, Single Pulse Output and PWM Output modes. The Standard TM can also be controlled with an external input pin and can drive one external output pins. Name TM No.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Standard Type TM Register Description Overall operation of the Standard TM is controlled using a series of registers. A read only register pair exists to store the internal counter 10-bit value, while a read/write register pair exists to store the internal 10-bit CCRA value. The remaining two registers are control registers which setup the different operating and control modes as well as the three CCRP bits.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Bit 2~0 T0RP2~T0RP0: TM0 CCRP 3-bit register, compared with the TM0 Counter bit 9~bit 7 Comparator P Match Period 000: 1024 TM0 clocks 001: 128 TM0 clocks 010: 256 TM0 clocks 011: 384 TM0 clocks 100: 512 TM0 clocks 101: 640 TM0 clocks 110: 768 TM0 clocks 111: 896 TM0 clocks These three bits are used to setup the value on the internal CCRP 3-bit register, which are then compared with the internal counter’s highest three bits.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU TM0 output pin changes state when a compare match occurs from the Comparator A. The TM0 output pin can be setup to switch high, switch low or to toggle its present state when a compare match occurs from the Comparator A. When the bits are both zero, then no change will take place on the output. The initial value of the TM0 output pin should be setup using the T0OC bit in the TM0C1 register.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU TM0DL Register Bit 7 6 5 4 3 2 1 0 Name D7 D6 D5 D4 D3 D2 D1 D0 R/W R R R R R R R R POR 0 0 0 0 0 0 0 0 Bit 7~0 TM0DL: TM0 Counter Low Byte Register bit 7~bit 0 TM0 10-bit Counter bit 7~bit 0 TM0DH Register – 10-bit STM Bit 7 6 5 4 3 2 1 0 Name — — — — — — D9 D8 R/W — — — — — — R R POR — — — — — — 0 0 Bit 7~2 Unimplemented, read as "0" Bit 1~0 TM0DH: TM0 Counter High Byte Register bit
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU If the T0CCLR bit in the TM0C1 register is high then the counter will be cleared when a compare match occurs from Comparator A. However, here only the T0AF interrupt request flag will be generated even if the value of the CCRP bits is less than that of the CCRA registers. Therefore when T0CCLR is high no T0PF interrupt request flag will be generated. In the Compare Match Output Mode, the CCRA can not be set to “0”.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU TnCCLR = 1; TnM1, TnM0 = 00 Counter Value CCRA = 0 Counter overflows CCRA > 0 Counter cleared by CCRA value 0x3FF CCRA = 0 CCRA Pause Resume Counter Reset Stop CCRP Time TnON bit TnPAU bit TnPOL bit No TnAF flag generated on CCRA overflow CCRA Int. Flag TnAF CCRP Int.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Timer/Counter Mode To select this mode, bits T0M1 and T0M0 in the TM0C1 register should be set to 11 respectively. The Timer/Counter Mode operates in an identical way to the Compare Match Output Mode generating the same interrupt flags. The exception is that in the Timer/Counter Mode the TM output pin is not used. Therefore the above description and Timing Diagrams for the Compare Match Output Mode can be used to understand its function.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Counter Value TnDPX = 0; TnM1, TnM0 = 10 Counter Cleared by CCRP CCRP Pause Resume Counter Stop if TnON bit low Counter reset when TnON returns high CCRA Time TnON bit TnPAU bit TnPOL bit Interrupts still generated CCRA Int. Flag TnAF CCRP Int.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Counter Cleared by CCRA Counter Value TnDPX = 1; TnM1, TnM0 = 10 CCRA Pause Resume Counter reset when TnON returns high Counter Stop if TnON bit low CCRP Time TnON bit TnPAU bit TnPOL bit Interrupts still generated CCRP Int. Flag TnPF CCRA Int.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Single Pulse Generation (n=0) TnM1, TnM0 = 10; TnIO1, TnIO0 = 11 Counter Stopped by CCRA Counter Value CCRA Pause CCRP Resume Counter reset when TnON returns high Counter Stops by softw
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Capture Input Mode To select this mode bits T0M1 and T0M0 in the TM0C1 register should be set to 01 respectively. This mode enables external signals to capture and store the present value of the internal counter and can therefore be used for applications such as pulse width measurements.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Analog to Digital Converter The need to interface to real world analog signals is a common requirement for many electronic systems. However, to properly process these signals by a microcontroller, they must first be converted into digital signals by A/D converters.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU A/D Converter Data Registers – ADRL, ADRH As the device contains an internal 12-bit A/D converter, they require two data registers to store the converted value. These are a high byte register, known as ADRH, and a low byte register, known as ADRL. After the conversion process takes place, these registers can be directly read by the microcontroller to obtain the digitised conversion value.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Bit 5 ADOFF : ADC module power on/off control bit 0: ADC module power on 1: ADC module power off This bit controls the power to the A/D internal function. This bit should be cleared to zero to enable the A/D converter. If the bit is set high then the A/D converter will be switched off reducing the device power consumption.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Bit 4 ~ 3 VREFS1~VREF0: Select ADC reference voltage 00: Internal ADC power 01: External VREF pin 1x: Internal VREF These bits are used to select the reference voltage for the A/D converter. If these bits are “01” then the A/D converter reference voltage is supplied on the external VREF pin. If these bits are set to “1x” then the A/D converter reference voltage is supplied on the internal VREF.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU A/D Clock Period (tADCK) ADCK2, ADCK1, ADCK0 =000 (fSYS) ADCK2, ADCK1, ADCK0 =001 (fSYS/2) ADCK2, ADCK1, ADCK0 =010 (fSYS/4) ADCK2, ADCK1, ADCK0 =011 (fSYS/8) ADCK2, ADCK1, ADCK0 =100 (fSYS/16) ADCK2, ADCK1, ADCK0 =101 (fSYS/32) ADCK2, ADCK1, ADCK0 =110 (fSYS/64) ADCK2, ADCK1, ADCK0 =111 (fSUB) 5MHz 200ns* 400ns* 800ns 1.6μs 3.2μs 6.4μs 12.8μs* Undefined 10MHz 100ns* 200ns* 400ns* 800ns 1.6μs 3.2μs 6.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Summary of A/D Conversion Steps The following summarises the individual steps that should be executed in order to implement an A/ D conversion process. • Step 1 Select the required A/D conversion clock by correctly programming bits ADCK2~ADCK0 in the ADCR1 register. • Step 2 Enable the A/D by clearing the ADOFF bit in the ADCR0 register to zero.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU A/D Programming Examples The following two programming examples illustrate how to setup and implement an A/D conversion. In the first example, the method of polling the EOCB bit in the ADCR0 register is used to detect when the conversion cycle is complete, whereas in the second example, the A/D interrupt is used to determine when the conversion is complete.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Example: using the interrupt method to detect the end of conversion clr ADE ; disable ADC interrupt mov a,03H mov ADCR1,a ; select fSYS/8 as A/D clock and switch off 1.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU I2C Interface The I 2C interface is used to communicate with external peripheral devices such as sensors, EEPROM memory etc. Originally developed by Philips, it is a two line low speed serial interface for synchronous serial data transfer.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU I2C Registers There are four control registers associated with the I2C bus, IICC0, IICC1, IICA and I2CTOC and one data register, IICD. The IICD register, is used to store the data being transmitted and received on the I2C bus. Before the microcontroller writes data to the I2C bus, the actual data to be transmitted must be placed in the IICD register. After the data is received from the I2C bus, the microcontroller can read it from the IICD register.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU IICC1 Register Bit 7 6 5 4 3 2 1 0 Name IICHCF IICHAAS IICHBB IICHTX IICTXAK IICSRW IICRNIC IICRXAK R/W R R R R/W R/W R R/W R POR 1 0 0 0 0 0 0 1 Bit 7 IICHCF: I C Bus data transfer completion flag 0: Data is being transferred 1: Completion of an 8-bit data transfer The IICHCF flag is the data transfer flag. This flag will be zero when data is being transferred.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU in transmit mode or receive mode. If the IICSRW flag is high, the master is requesting to read data from the bus, so the slave device should be in transmit mode. When the IICSRW flag is zero, the master will write data to the bus, therefore the slave device should be in receive mode to read this data.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU I2C Bus Initialisation Flow Chart I2C Bus Start Signal The START signal can only be generated by the master device co
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU I2C Bus Read/Write Signal The IICSRW bit in the IICC1 register defines whether the slave device wishes to read data from the I2C bus or write data to the I2C bus. The slave device should examine this bit to determine if it is to be a transmitter or a receiver. If the IICSRW flag is “1” then this indicates that the master device wishes to read data from the I2C bus, therefore the slave device must be setup to send data to the I2C bus as a transmitter.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU I2C Time-out Control In order to reduce the problem of I2C lockup due to reception of erroneous clock sources, a time-out function is provided. If the clock source to the I2C is not received then after a fixed time period, the I2C circuitry and registers will be reset. The time-out counter starts counting on an I2C bus “START” & “address match” condition, and is cleared by an SCL falling edge.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU PLL Clock Generator The device provides a clock generator output which can be used as a PWM driver signal. The accompanying block diagram shows the overall internal structure of the clock generator, together with its associated registers.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Clock gene�ato� PWM0� PWM1� PWM� PWM0B Clock Generator and PWMn Output Waveform Clock Generator Register Description Three registers control the overall operation of the clock generator. These are the generator overall control register, CKGEN, the generator 1 frequency selection registers, PLLFL and PLLFH, and the PWM output control register, PWMC.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU PLLFL Register Bit 7 6 5 4 3 2 1 0 Name PFQ7 PFQ6 PFQ5 PFQ4 PFQ3 PFQ2 PFQ1 PFQ0 R/W R/W R/W R/W R/W R/W R/W R/W R/W POR 0 0 0 0 0 0 0 0 PLLFH Register Bit 7 6 5 4 3 2 1 0 Name — — — — — PFQ10 PFQ9 PFQ8 R/W — — — — — R/W R/W R/W POR — — — — — 0 0 0 3 2 1 0 PFQ10 ~ PFQ0: PLL frequency control bit 0: 100kHz 1:100.1kHz 2: 100.2kHz 3: 100.3kHz 4: 100.4kHz … ... 254: 125.4kHz 255: 125.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU PWM output control Mode 0 Clock gene�ato� PWM00� PWM0��PWM03 PWM01 OC (Ove� cu��ent) PWM00 Clock gene�ato� output PWM01 PWM0� PWM03 PWM0E� PWM1E� PWM�E� PWM3E� PWM10 PWM11 PWM1� PWM13 Mode 1 (Protection mechanism is only existed in mode1) Clock gene�ato� tD PWM00 tD PWM01 tD PWM0� tD PWM03 OC (Ove� cu��ent) PWM0E� PWM00 Clock gene�ato� output PWM01 PWM0� PWM03 PWM10 PWM11 PWM1� PWM13 P�otection : avoid acting si�ultaneously Rev.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU CPR Register (Complementary PWM control register) Rev. 1.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Demodulation Function The Demodulator demodulates the communication signal from the receiver end. D[7:0] M[1:0] fFLT=fH/� 8 �it DAC COMM0 COMM1 S0 S1 Analog Mux COMM� DMS3 A S� S3 R1 (R1=�K) DMS0 MCU �eading Filte� clock G=1/5/10/15/�0/30/�0/50 C Filte� DMS� DEMO pad R� A�8 DMS1 AIS[1:0] A� AX G[�:0] CP C� CX FLT[�:0] HT66FW2230 Signal afte� de�odulation ( �ias �V) COMM0 10K CMP OPA �.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Input Voltage Range The input voltage can be positive or negative, which together with the PGA operating mode, provides for a more flexible application. (1) If VIN > 0 and the PGA operates in the non-inverting mode, the output voltage of the PGA is VOPGA = (1 + R2 / R1 ) ×V IN (2) (2) When the PGA operates in the non-inverter mode, it also provides a unity gain buffer function.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Demodulator Register Description The DEMC0 and DEMC1registers are demodulator control registers which control the demodulator operation mode, PGA and filter functions. The DEMREF register is used to provide the reference voltages for the demodulator. DEMACAL and DEMCCAL are used to cancel out the operational amplifier and comparator input offset. DEMC0 Register Rev. 1.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU DEMC1 Register Bit 7 6 5 4 3 2 Name DEMO — DEMG2 DEMG1 DEMG0 DEMFLT2 R/W R — R/W R/W R/W R/W R/W R/W POR 0 — 0 0 0 0 0 0 bit 7 1 0 DEMFLT1 DEMFLT0 DEMO : DEMO output (read only) Bit 6 Unimplemented, read as 0 Bit 5~3 DEMG2~DEMG0: OPA Gain Inverter mode: 000: -1 001: -5 010: -10 011: -15 100: -20 101: -30 110: -40 111: -50 Non-inverter mode: 000: 1 001: 6 010: 11 011: 16 100: 21 101: 31 110: 41 111: 51 bit 2~0 DEMFLT2~D
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU DEMACAL Register Bit 7 6 5 4 3 2 1 0 Name DEMAOFM DEMARS DEMAOF5 DEMAOF4 DEMAOF3 DEMAOF2 DEMAOF1 DEMAOF0 R/W R/W R/W R/W R/W R/W R/W R/W R/W POR 0 0 0 0 0 0 0 0 Bit 7 DEMAOFM: Input offset voltage cancellation mode or normal operating mode selection 0: Normal operating mode 1: Input offset voltage cancellation mode Bit 6 DEMARS: Input offset voltage cancellation reference selection bit 0: Select negative input as the reference inp
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU OCP Function OCP is an abbreviation for over current protection. The OCP detects an input voltage which is proportional to the monitored source current. If the input voltage is larger than the reference voltage set by the DAC, the OCP will generate an output signal to indicate that the source current is outwith the specification.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Offset Calibration The OCP circuit has 4 operating mode controlled by OCPM1~OCPM0. One of these modes is the calibration mode. In the calibration mode, the OP and comparator offset can be calibrated. OPAMP calibration: • Step1: Set OCPM[1:0] =11, OCPAOFM=1, the OCP is now in the OPAMP calibration mode. • Step2: Set OCPAOF4~OCPAOF0 =00000 then read the OCPAX bit status.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU OCPC1 Register Bit 7 6 5 4 3 Name OCPO — OCPG2 OCPG1 OCPG0 2 1 0 R/W R — R/W R/W R/W R/W R/W R/W POR 0 — 0 0 0 0 0 0 OCPFLT2 OCPFLT1 OCPFLT0 Bit 7 OCPO : OCPO output (read only) Bit 6 Unimplemented reead as 0 Bit 5~3 OCPG2~OCPG0: OPA Gain Inverter mode: 000: -1 001: -5 010: -10 011: -15 100: -20 101: -30 110: -40 111: -50 Non-inverter mode: 000: 1 001: 6 010: 11 011: 16 100: 21 101: 31 110: 41 111: 51 bit 2~0 OCPFLT2~OC
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU OCPACAL Register – Over Current OPA Calibration Register Bit 7 6 5 4 3 2 1 0 Name OCPAOFM OCPARS OCPAOF5 OCPAOF4 OCPAOF3 OCPAOF2 OCPAOF1 OCPAOF0 R/W R/W R/W R/W R/W R/W R/W R/W R/W POR 0 0 0 0 0 0 0 0 Bit7 OCPAOFM: Input offset voltage cancellation mode or normal operating mode selection 0: Normal operating mode 1: Input offset voltage cancellation mode Bit6 OCPARS: Input offset voltage cancellation reference selection bit 0: Sele
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Internal Reference Voltage – IVREF To ADC Input G=� VBG Band gap IVREF A To ADC VREF R1 R� Internal Reference Voltage Circuit The bandgap circuit will automatically switch on if either the LVR or LVD is enabled or if the VREF is enabled.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Interrupts Interrupts are an important part of any microcontroller system. When an external event or an internal function such as a Timer Module 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 device contains several external interrupt and internal interrupts functions.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU INTEG Register Bit 7 6 5 4 3 2 1 0 Name — — — — INT1S1 INT1S0 INT0S1 INT0S0 R/W — — — — R/W R/W R/W R/W POR — — — — 0 0 0 0 0 Bit 7 ~ 4 Unimplemented, read as "0" Bit 3 ~ 2 INT1S1, INT1S0: Defines INT1 interrupt active edge 00: Disabled Interrupt 01: Rising Edge Interrupt 10: Falling Edge Interrupt 11: Dual Edge Interrupt Bit 1 ~ 0 INT0S1, INT0S0: Defines INT0 interrupt active edge 00: Disabled Interrupt 01: Rising Edg
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU INTC1 Register Bit 7 6 5 4 3 2 1 0 Name ADF MF2F MF1F MF0F ADE MF2E MF1E MF0E R/W R/W R/W R/W R/W R/W R/W R/W R/W POR 0 0 0 0 0 0 0 0 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 ADF : A/D Converter Interrupt Request Flag 0: No request 1: Interrupt request MF2F: Multi-function Interrupt 2 Request Flag 0: No request 1: Interrupt request MF1F: Multi-function Interrupt 1 Request Flag 0: No request 1: Interrupt request MF0F:
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU MFI0 Register Bit 7 6 5 4 3 2 1 0 Name — — T0AF T0PF — — T0AE T0PE R/W — — R/W R/W — — R/W R/W POR — — 0 0 — — 0 0 Bit 7 ~ 6 Unimplemented, read as "0" Bit 5 T0AF: TM0 Comparator A match interrupt request flag 0: No request 1: Interrupt request Bit 4 T0PF: TM0 Comparator P match interrupt request flag 0: No request 1: Interrupt request Bit 3 ~ 2 Unimplemented, read as "0" Bit 1 T0AE: TM0 Comparator A match interrupt
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU MFI2 Register Bit 7 6 5 4 3 2 1 0 Name — — DEF LVF — — DEE LVE R/W — — R/W R/W — — R/W R/W POR — — 0 0 — — 0 0 Bit 7 ~ 6 Bit 5 Bit 4 Bit 3 ~ 2 Bit 1 Bit 0 Unimplemented, read as "0" DEF: Data EEPROM interrupt request flag 0: No request 1: Interrupt request LVF: LVD interrupt request flag 0: No request 1: Interrupt request Unimplemented, read as "0" DEE: Data EEPROM Interrupt Control 0: Disable 1: Enable LVE: LVD Interrupt C
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Legend xxF Request Flag� no auto �eset in ISR xxF Request Flag� auto �eset in ISR XXE EMI auto disa�led in ISR Inte��upt �a�e Ena�le Bits Inte��upt �a�e Request Flags TM0 P T0PF T0PE TM0 A T0AF T0AE TM1 P T1PF T1PE TM1 A T1AF T1AE EEPROM DEF DEE LVD LVF LVE Request Flags Ena�le Bits Maste� Ena�le Vector P�io�ity High OCP OCPF OCPE EMI 0�H De�odulation DEMF DEME EMI 08H I�T0F I�T0E EMI 0CH I�T0 Ena�le Bits Multi-Fu
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Multi-function Interrupt Within this device there are up to three Multi-function interrupts. Unlike the other independent interrupts, these interrupts have no independent source, but rather are formed from other existing interrupt sources, namely the TM Interrupts, LVD interrupt and EEPROM Interrupt. A Multi-function interrupt request will take place when any of the Multi-function interrupt request flags, MF0F~MF2F are set.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Time Base Interrupts 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.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU PSCR Register Bit 7 6 5 4 3 2 Name — — — — — — R/W — — — — — — R/W R/W POR — — — — — — 0 0 Bit 7~2 Unimplemented, read as "0" Bit 1 ~ 0 CLKSEL1 ~ CLKSEL0: fTB clock source selection 00: fSYS 01: fSYS/4 11: fSUB 1 0 CLKSEL1 CLKSEL0
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU TM Interrupts The Standard Type TM and Compact Type TM have two interrupts each. All of the TM interrupts are contained within the Multi-function Interrupts. For each of the Standard and Compact Type TM there are two interrupt request flags TnPF and TnAF and two enable bits TnPE and TnAE. A TM interrupt request will take place when any of the TM request flags are set, a situation which occurs when a TM comparator P or comparator A match situation happens.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Programming Considerations By disabling the relevant 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 interrupt register until the corresponding interrupt is serviced or until the request flag is cleared by the application program.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Low Voltage Detector – LVD The device has a Low Voltage Detector function, also known as LVD. This enables the device to monitor the power supply voltage, VDD, and provides a warning signal should it fall below a certain level. This function may be especially useful in battery applications where the supply voltage will gradually reduce as the battery ages, as it allows an early warning battery low signal to be generated.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU LVD Operation The Low Voltage Detector function operates by comparing the power supply voltage, VDD, with a pre-specified voltage level stored in the LVDC register. This has a range of between 2.0V and 4.0V. When the power supply voltage, VDD, falls below this pre-determined value, the LVDO bit will be set high indicating a low power supply voltage condition.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Application Circuits WPC Type A11 Transmitter Rev. 1.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Rev. 1.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Bill of Materials Part Name Designator Part Number Package Type Quantity MCU U6 HT66FW2230 SSOP28 1 OPA U7 HT9252 SOP8 1 GATE DRIVER U8, U9 TI TPS28225 SOP8 2 OPA U10 TI INA199 SC70 1 SOP8 N-MOSFET U1, U2 AP4226GM INDUCTOR U3, U4 INDUCTOR (L) 1 2 USB_MICRO U5 USB_MICRO 1 CRYSTAL Y1 ABM8G-20.000MHZ-4Y-T3 CAPACITOR C1, C7, C10, C16, C19, C22, C23, C29, C31, C35, C37 0.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Instruction Set Introduction Central to the successful operation of any microcontroller is its instruction set, which is a set of program instruction codes that directs the microcontroller to perform certain operations. 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.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU 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. In all logical data operations, the zero flag may be set if the result of the operation is zero.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU 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.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Mnemonic Description Cycles Flag Affected Move Data Memory to ACC Move ACC to Data Memory Move immediate data to ACC 1 1Note 1 None None None Clear bit of Data Memory Set bit of Data Memory 1Note 1Note None None Jump unconditionally Skip if Data Memory is zero Skip if Data Memory is zero with data movement to ACC Skip if bit i of Data Memory is zero Skip if bit i of Data Memory is not zero Skip if increment Data Memory is zero Skip if decrement Data
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Instruction Definition ADC A,[m] Description Operation Affected flag(s) ADCM A,[m] Description Operation Affected flag(s) ADD A,[m] Description Add Data Memory to ACC with Carry The contents of the specified Data Memory, Accumulator and the carry flag are added. The result is stored in the Accumulator. ACC ← ACC + [m] + C OV, Z, AC, C Add ACC to Data Memory with Carry The contents of the specified Data Memory, Accumulator and the carry flag are added.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Affected flag(s) Subroutine call 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. The specified address is then loaded and the program continues execution from this new address. As this instruction requires an additional operation, it is a two cycle instruction.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU CPLA [m] Description Operation Affected flag(s) Complement Data Memory with result in ACC 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.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Operation Affected flag(s) Jump unconditionally 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.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU RET A,x Description Operation Affected flag(s) RETI Description Operation Affected flag(s) RL [m] Description Operation Affected flag(s) RLA [m] Description Operation Affected flag(s) RLC [m] Description Operation Affected flag(s) RLCA [m] Description Operation Affected flag(s) RR [m] Description Operation Affected flag(s) Rev. 1.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU RRA [m] Description Operation Affected flag(s) RRC [m] Description Operation Affected flag(s) RRCA [m] Description Operation Affected flag(s) SBC A,[m] Description Operation Affected flag(s) SBCM A,[m] Description Operation Affected flag(s) SDZ [m] Description Operation Affected flag(s) Rev. 1.10 Rotate Data Memory right with result in ACC Data in the specified Data Memory and the carry flag are rotated right by 1 bit with bit 0 rotated into bit 7.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Affected flag(s) Skip if decrement Data Memory is zero with result in ACC The contents of the specified Data Memory are first decremented by 1. If the result is 0, the following instruction is skipped. The result is stored in the Accumulator but the specified Data Memory contents remain unchanged. As this requires the insertion of a dummy instruction while the next instruction is fetched, it is a two cycle instruction.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU SUBM A,[m] Description Operation Affected flag(s) Subtract Data Memory from ACC with result in Data Memory 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.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU TABRD [m] Description Operation Affected flag(s) TABRDC [m] Description Operation Affected flag(s) TABRDL [m] Description Operation Affected flag(s) XOR A,[m] Description Operation Affected flag(s) XORM A,[m] Description Operation Affected flag(s) XOR A,x Description Operation Affected flag(s) Rev. 1.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Package Information Note that the package information provided here is for consultation purposes only. As this information may be updated at regular intervals users are reminded to consult the Holtek website for the latest version of the package information. Additional supplementary information with regard to packaging is listed below. Click on the relevant section to be transferred to the relevant website page.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU 28-pin SSOP (150mil) Outline Dimensions Symbol Dimensions in inch Min. Nom. Max. A — 0.236 BSC — B — 0.154 BSC — C 0.008 — 0.012 C’ — 0.390 BSC — D — — 0.069 E — 0.025 BSC — F 0.004 — 0.0098 G 0.016 — 0.050 H 0.004 — 0.010 α 0° — 8° Symbol Rev. 1.10 Dimensions in mm Min. Nom. Max. A — 6.000 BSC — B — 3.900 BSC — C 0.20 — 0.30 C’ — 9.900 BSC — D — — 1.
HT66FW2230 Wireless Charger A/D Flash 8-Bit MCU Copyright© 2014 by HOLTEK SEMICONDUCTOR INC. The information appearing in this Data Sheet is believed to be accurate at the time of publication. However, Holtek assumes no responsibility arising from the use of the specifications described.