Download Print this page

Holtek HT46RU66 Manual

A/d type 8-bit mcu with lcd

Advertisement

Quick Links

Technical Document
·
Tools Information
·
FAQs
·
Application Note
-
HA0003E Communicating between the HT48 & HT46 Series MCUs and the HT93LC46 EEPROM
-
HA0004E HT48 & HT46 MCU UART Software Implementation Method
-
HA0005E Controlling the I2C bus with the HT48 & HT46 MCU Series
-
HA0047E An PWM application example using the HT46 series of MCUs
-
HA0075E MCU Reset and Oscillator Circuits Application Note
Features
·
Operating voltage:
f
=4MHz: 2.2V~5.5V
SYS
f
=8MHz: 3.3V~5.5V
SYS
·
32 bidirectional I/O lines
·
Two external interrupt inputs
·
Two 16-bit programmable timer/event counters with
Programmable Frequency Divider, PFD, function
·
One 8-bit programmable timer/event counter with
source clock prescaler
·
47´3 or 46´4 segment LCD driver with logic
output option for SEG0~SEG23)
·
16K´16 program memory
·
576´8 data memory RAM
·
Universal Asynchronous Receiver Transmitter
(UART)
·
PFD function for sound generation
·
Real Time Clock - RTC
General Description
The HT46RU66/HT46CU66 are 8-bit, high perfor-
mance, RISC architecture microcontroller devices spe-
cifically designed for A/D product applications that
interface directly to analog signals and which require an
LCD Interface. The HT46CU66 mask version device, is
fully pin and functionally compatible with its sister
HT46RU66 OTP device.
The advantages of low power consumption, I/O flexibility,
timer functions, oscillator options, multi-channel A/D
Rev. 1.20
HT46RU66/HT46CU66
A/D Type 8-Bit MCU with LCD
·
8-bit RTC prescaler
·
Watchdog Timer
·
Buzzer output function
·
Crystal, RC and 32768Hz crystal system oscillator
option
·
Power down and wake-up functions reduce power
consumption
·
16-level subroutine nesting
·
8-channel 12-bit resolution A/D converter
·
4-channel PWM output shared with 4 I/O lines
·
Bit manipulation instruction
·
16-bit table read instruction
·
Up to 0.5ms instruction cycle with 8MHz system clock
·
63 powerful instructions
·
Instruction execution within 1 or 2 machine cycles
·
Low voltage reset/detector function
·
52-pin QFP, 56-pin SSOP, 100-pin QFP packages
Converter, Pulse Width Modulation function, Power
Down and Wake-up functions, in addition to a flexible
and configurable LCD interface enhance the versatility of
these devices to control a wide range of applications re-
quiring analog signal processing and LCD interfacing,
such as electronic metering, environmental monitoring,
handheld measurement tools, motor driving, etc. for both
the industrial and home appliance application areas.
1
October 2, 2007

Advertisement

loading
Need help?

Need help?

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

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Holtek HT46RU66

  • Page 1 Real Time Clock - RTC · 52-pin QFP, 56-pin SSOP, 100-pin QFP packages General Description The HT46RU66/HT46CU66 are 8-bit, high perfor- Converter, Pulse Width Modulation function, Power mance, RISC architecture microcontroller devices spe- Down and Wake-up functions, in addition to a flexible...
  • Page 2: Block Diagram

    HT46RU66/HT46CU66 Block Diagram Rev. 1.20 October 2, 2007...
  • Page 3: Pin Assignment

    HT46RU66/HT46CU66 Pin Assignment H T 4 6 R U 6 6 / H T 4 6 C U 6 6 1 0 0 Q F P - A H T 4 6 R U 6 6 / H T 4 6 C U 6 6...
  • Page 4 HT46RU66/HT46CU66 Pin Description Configuration Pin Name Description Option Bidirectional 8-bit input/output port. Each individual pin on this port can PA0/BZ Pull-high be configured as a wake-up input by a configuration option. Software in- PA1/BZ Wake-up structions determine if the pin is a CMOS output or Schmitt Trigger input.
  • Page 5 HT46RU66/HT46CU66 Configuration Pin Name Description Option ¾ VREF Reference voltage input pin. ¾ Schmitt Trigger reset input. Active low. ¾ ¾ Positive power supply ¾ ¾ Negative power supply, ground ¾ AVDD Positive analog power supply ¾ AVSS Negative analog power supply, ground Note: Each pin on Port A can be programmed through a configuration option to have a wake-up function.
  • Page 6 HT46RU66/HT46CU66 Test Conditions Symbol Parameter Min. Typ. Max. Unit Conditions ¾ ¾ 3V No load, system HALT, Standby Current STB1 =T1) LCD Off at HALT, UART Off ¾ ¾ ¾ 3V No load, system HALT, Standby Current LCD On at HALT, C type,...
  • Page 7 HT46RU66/HT46CU66 Test Conditions Symbol Parameter Min. Typ. Max. Unit Conditions ¾ Pull-high Resistance of I/O Ports and INT0, INT1 ¾ ¾ Additional Power Consumption =1ms if A/D Converter is Used ¾ =5V, V ¾ ¾ ±2 ADC Differential Non-Linear =1ms =5V, V ¾...
  • Page 8: Functional Description

    HT46RU66/HT46CU66 Functional Description Program Counter - PC Execution Flow The system clock is derived from either a crystal or an The program counter is 14 bits wide and controls the se- RC oscillator or a 32768Hz crystal oscillator. It is inter- quence in which the instructions stored in the program nally divided into four non-overlapping clocks.
  • Page 9 HT46RU66/HT46CU66 microcontroller manages program control by loading the required address into the Program Counter. For condi- tional skip instructions, once the condition has been met, the next instruction, which has already been fetched during the present instruction execution, is dis- carded and a dummy cycle takes its place while the cor- rect instruction is obtained.
  • Page 10 HT46RU66/HT46CU66 · Location 018H This area is reserved for the Multi-function interrupt service program. If a timer interrupt results from a Timer/Event Counter 2 overflow, or the real time clock time out, or Time base time out, and if the interrupt is enabled and the stack is not full, the program will jump to this location and begin execution.
  • Page 11 HT46RU66/HT46CU66 The function of data movement between two indirect ad- and Bank 3: 192´8 bits). Most of these registers are dressing registers is not supported. The memory pointer readable and writeable, although some are read only. registers, MP0 and MP1, are both 8-bit registers used to...
  • Page 12 HT46RU66/HT46CU66 Bit No. Label Function C is set if an operation results in a carry during an addition operation or if a borrow does not take place during a subtraction operation, otherwise C is cleared. C is also affected by a ro- tate through carry instruction.
  • Page 13 HT46RU66/HT46CU66 The Multi-Function Interrupt, MFI, is initialised by setting During the execution of an interrupt subroutine, other the interrupt request flag, MFF; bit 6 of the INTC1 regis- maskable interrupt acknowledgments are all held until the ²RETI² instruction is executed or the EMI bit and the ter, that is caused by a Timer 2 overflow, T2F;...
  • Page 14 HT46RU66/HT46CU66 flag, RTF; bit 6 of the MFIC register, the time base inter- Interrupt Source Priority Vector rupt flag, TBF; bit 5 of the MFIC register, indicate that a External Interrupt 0 related interrupt has occurred. As these flags will not be...
  • Page 15 HT46RU66/HT46CU66 If the crystal oscillator is to be used, a crystal across give a time of about 2.1s~4.3s for the internal WDT os- OSC1 and OSC2 is needed to provide the feedback and cillator. If the WDT oscillator is disabled, the WDT clock phase shift required for oscillation, no other external may still come from the instruction clock.
  • Page 16 HT46RU66/HT46CU66 Power Down Operation - HALT Time Base The Power Down mode is initialised by the ²HALT² in- The time base offers a periodic time-out period to gener- ate a regular internal interrupt. Its time-out period struction and results in the following.
  • Page 17 HT46RU66/HT46CU66 Reset The functional unit chip reset status is shown below. There are several ways in which a reset may occur. Program Counter 000H · RES is reset during normal operation Interrupt Disabled · Power on reset Prescaler, Divider Cleared ·...
  • Page 18 HT46RU66/HT46CU66 The register states are summarized below: Reset WDT Time-out RES Reset RES Reset WDT Time-out Register (Power On) (Normal Operation) (Normal Operation) (HALT) (HALT)* xxxx xxxx uuuu uuuu uuuu uuuu uuuu uuuu uuuu uuuu xxxx xxxx uuuu uuuu uuuu uuuu...
  • Page 19 HT46RU66/HT46CU66 Reset WDT Time-out RES Reset RES Reset WDT Time-out Register (Power On) (Normal Operation) (Normal Operation) (HALT) (HALT)* UCR1 0000 00x0 0000 00x0 0000 00x0 0000 00x0 uuuu uuuu UCR2 0000 0000 0000 0000 0000 0000 0000 0000 uuuu uuuu...
  • Page 20 HT46RU66/HT46CU66 The overflow of the Timer/Event Counter 0/1/2 is one of timer control register. Note that setting the timer enable the wake-up sources. The Timer/Event Counter 0/1 can bit high to turn the timer on, should only be executed af- also be applied to a PFD or Programmable Frequency ter the timer mode bits have been properly setup.
  • Page 21 HT46RU66/HT46CU66 Timer/Event Counter 2 PFD Source Option The bit0~bit2 of the TMR0C/TMR2C (T0PSC2~0/ T2PSC2~0) can be used to define the pre-scaling stages of the inter- nal clock sources of the timer/event counter. The overflow signal of the timer/event counter can be used to generate the PFD signal.
  • Page 22 HT46RU66/HT46CU66 Bit No. Label Function ¾ Unused bit, read as ²0² Defines the TMR1 active edge of the timer/event counter: In Event Counter Mode (T1M1,T1M0)=(0,1): 1:count on falling edge; 0:count on rising edge In Pulse Width measurement mode (T1M1,T1M0)=(1,1): 1: start counting on the rising edge, stop on the falling edge;...
  • Page 23 HT46RU66/HT46CU66 Input/Output Ports put/output latches can be set or cleared by the ²SET [m].i² and ²CLR [m].i² bit manipulation instructions. There are 32 bidirectional input/output lines in the device, labeled as PA, PB, PC and PD, which are mapped to the...
  • Page 24 HT46RU66/HT46CU66 Port PB can also be used as A/D converter inputs. There is a PWM function shared with PD0/PD1/PD2/PD3. If the PWM function is enabled, the PWM0/PWM1/PWM2/ PWM3 signal will appear on PD0/PD1/PD2/PD3, if PD0/ PD1/ PD2/PD3 are operating in output mode. Writing ²1² to the PD0~PD3 data register will enable the PWM output function while writing ²0²...
  • Page 25 HT46RU66/HT46CU66 PC6/TX Input/Output Ports PC7/RX Input/Output Ports Pulse Width Modulator duty cycle of one modulation cycle of the output wave- form, should be placed. To increase the PWM modula- Each devices is provided with either three or four Pulse tion frequency, each modulation cycle is subdivided into...
  • Page 26 HT46RU66/HT46CU66 For all devices, the PWM clock source is the system clock f Package Channels PWM Mode Output Pin PWM Register Name PWM0/PWM1/PWM2 52/56-pin 6+2 or 7+1 PD0/PD1/PD2 PWM0/PWM1/PWM2/PWM3 100-pin 6+2 or 7+1 PD0/PD1/PD2/PD3 PWM Function Table four individual sub-cycles known as modulation cycle This method of dividing the original modulation cycle 0 ~ modulation cycle 3, denoted as ²i²...
  • Page 27 HT46RU66/HT46CU66 · 7+1 PWM Mode Parameter AC (0~1) Duty Cycle Each full PWM cycle, as it is controlled by an 8-bit DC + 1 i<AC PWM register, has 256 clock periods. However, in the Modulation cycle i 7+1 PWM mode, each PWM cycle is subdivided into...
  • Page 28 HT46RU66/HT46CU66 The following sample program shows how the PWM outputs are setup and controlled, the corresponding PWM out- put configuration option must first be selected. clr PDC.0 ; set pin PD0 as output clr PDC.1 ; set pin PD1 as output clr PDC.2...
  • Page 29 HT46RU66/HT46CU66 Bit No. Label Function Selects the A/D converter clock source 00=system clock/2 ADCS0 01=system clock/8 ADCS1 10=system clock/32 11=undefined ¾ Unused bit, read as ²0² TEST For test mode used only ACSR (27H) Register Bit No. Label Function ACS2, ACS1, ACS0: Select A/D channel...
  • Page 30 HT46RU66/HT46CU66 The following programming example illustrates how to setup and implement an A/D conversion. The method of polling the EOCB bit in the ADCR register is used to detect when the conversion cycle is complete. Example: using EOCB Polling Method to detect end of conversion...
  • Page 31 HT46RU66/HT46CU66 LCD Memory only by indirect addressing mode using MP1. When data is written into the display data area, it is automati- The device provides an area of embedded data memory cally read by the LCD driver which then generates the for LCD display.
  • Page 32 HT46RU66/HT46CU66 D u r i n g a R e s e t P u l s e N o r m a l O p e r a t i o n M o d e H A L T M o d e LCD Driver Output (1/3 Duty, 1/2 Byte, R/C Type) Rev.
  • Page 33 HT46RU66/HT46CU66 LCD Driver Output Rev. 1.20 October 2, 2007...
  • Page 34 HT46RU66/HT46CU66 Low Voltage Reset/Detector Functions There is a low voltage detector (LVD) and a low voltage reset circuit (LVR) implemented in this microcontroller. These two functions can be enabled/disabled by options. Once the LVD option is enabled, the user can use the RTCC.3 to en- able/disable (1/0) the LVD circuit and read the LVD detector status (0/1) from RTCC.5, otherwise, the LVD function is...
  • Page 35 I/O pin, if the pin is not configured as a receiver, which occurs The HT46RU66/HT46CU66 devices contain an inte- if the RXEN bit in the UCR2 register is equal to zero.
  • Page 36 HT46RU66/HT46CU66 · USR register RXIF flag is cleared when the USR register is read with RXIF set, followed by a read from the RXR reg- The USR register is the status register for the UART, ister, and if the RXR register has no data available.
  • Page 37 HT46RU66/HT46CU66 ¨ used, if the bit is equal to ²0² then only one stop bit PERR is used. The PERR flag is the parity error flag. When this read only flag is ²0² it indicates that a parity error ¨...
  • Page 38 HT46RU66/HT46CU66 · to ²0² and if the MCU is in the Power Down Mode, UCR2 register any edge transitions on the RX pin will not wake-up The UCR2 register is the second of the two UART control registers and serves several purposes. One of the device.
  • Page 39 HT46RU66/HT46CU66 ¨ TXEN By programming the BRGH bit which allows selection of the related formula and programming the required The TXEN bit is the Transmitter Enable Bit. When this bit is equal to ²0² the transmitter will be disabled value in the BRG register, the required baud rate can be setup.
  • Page 40 HT46RU66/HT46CU66 Baud Rates for BRGH=1 Baud Rate =8MHz =7.159MHz =4MHz =3.579545MHz K/BPS Kbaud Error Kbaud Error Kbaud Error Kbaud Error ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ 1.202 0.16 1.203...
  • Page 41 HT46RU66/HT46CU66 ¨ Transmitting data Start Data Address Parity Stop When the UART is transmitting data, the data is Bits Bits Bits shifted on the TX pin from the shift register, with the Example of 8-bit Data Formats least significant bit first. In the transmit mode, the TXR register forms a buffer between the internal bus and the transmitter shift register.
  • Page 42 HT46RU66/HT46CU66 ¨ Transmit break Set the RXEN bit to ensure that the RX pin is used as a UART receiver pin and not as an I/O pin. If the TXBRK bit is set then break characters will be sent on the next transmission. Break character At this point the receiver will be enabled which will transmission consists of a start bit, followed by 13´...
  • Page 43 HT46RU66/HT46CU66 ¨ Receiver interrupt No interrupt will be generated. However this bit rises at the same time as the RXIF bit which itself The read only receive interrupt flag RXIF in the USR generates an interrupt. register is set by an edge generated by the receiver.
  • Page 44 HT46RU66/HT46CU66 the UCR2 register is set. The two transmitter interrupt mode is enabled, then to ensure correct operation, the conditions have their own corresponding enable bits, parity function should be disabled by resetting the par- while the two receiver interrupt conditions have a ity enable bit to zero.
  • Page 45 HT46RU66/HT46CU66 Options WDT enable/disable selection. WDT can be enabled or disabled by option. WDT time-out period selection. There are four types of selection: WDT clock source divided by 2 CLR WDT times selection. This option defines the method to clear the WDT by instruction. ²One time² means that the ²CLR WDT² can clear the WDT.
  • Page 46: Application Circuits

    HT46RU66/HT46CU66 Application Circuits R e s e t C i r c u i t R C S y s t e m O s c i l l a t o r C r y s t a l / R e s o n a t o r...
  • Page 47: Instruction Set

    For easier understanding of the various instruction The standard logical operations such as AND, OR, XOR codes, they have been subdivided into several func- and CPL all have their own instruction within the Holtek tional groupings. microcontroller instruction set. As with the case of most...
  • Page 48 In addition to the above functional instructions, a range of other instructions also exist such as the ²HALT² in- ory is an extremely flexible feature of all Holtek microcontrollers. This feature is especially useful for struction for Power-down operations and instructions to...
  • Page 49 HT46RU66/HT46CU66 Mnemonic Description Cycles Flag Affected Rotate RRA [m] Rotate Data Memory right with result in ACC None Note RR [m] Rotate Data Memory right None RRCA [m] Rotate Data Memory right through Carry with result in ACC Note RRC [m]...
  • Page 50: Instruction Definition

    HT46RU66/HT46CU66 Instruction Definition ADC A,[m] Add Data Memory to ACC with Carry Description 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...
  • Page 51 HT46RU66/HT46CU66 CALL addr Subroutine call Description Unconditionally calls a subroutine at the specified address. The Program Counter then in- crements 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.
  • Page 52 HT46RU66/HT46CU66 CPL [m] Complement Data Memory 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. [m] ¬ [m] Operation Affected flag(s) CPLA [m]...
  • Page 53 HT46RU66/HT46CU66 INC [m] Increment Data Memory Description Data in the specified Data Memory is incremented by 1. [m] ¬ [m] + 1 Operation Affected flag(s) INCA [m] Increment Data Memory with result in ACC Description Data in the specified Data Memory is incremented by 1. The result is stored in the Accumu- lator.
  • Page 54 HT46RU66/HT46CU66 OR A,x Logical OR immediate data to ACC Description Data in the Accumulator and the specified immediate data perform a bitwise logical OR op- eration. The result is stored in the Accumulator. ACC ¬ ACC ²OR² x Operation Affected flag(s)
  • Page 55 HT46RU66/HT46CU66 RLC [m] Rotate Data Memory left through Carry Description The contents of the specified Data Memory and the carry flag are rotated left by 1 bit. Bit 7 replaces the Carry bit and the original carry flag is rotated into bit 0.
  • Page 56 HT46RU66/HT46CU66 SBC A,[m] Subtract Data Memory from ACC with Carry Description The contents of the specified Data Memory and the complement of the carry flag are sub- tracted from the Accumulator. The result is stored in the Accumulator. 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 57 HT46RU66/HT46CU66 SIZ [m] Skip if increment Data Memory is 0 Description The contents of the specified Data Memory are first incremented by 1. If the result is 0, the following instruction is skipped. As this requires the insertion of a dummy instruction while the next instruction is fetched, it is a two cycle instruction.
  • Page 58 HT46RU66/HT46CU66 SWAP [m] Swap nibbles of Data Memory Description The low-order and high-order nibbles of the specified Data Memory are interchanged. [m].3~[m].0 « [m].7 ~ [m].4 Operation Affected flag(s) None SWAPA [m] Swap nibbles of Data Memory with result in ACC Description The low-order and high-order nibbles of the specified Data Memory are interchanged.
  • Page 59 HT46RU66/HT46CU66 XOR A,[m] Logical XOR Data Memory to ACC Description Data in the Accumulator and the specified Data Memory perform a bitwise logical XOR op- eration. The result is stored in the Accumulator. ACC ¬ ACC ²XOR² [m] Operation Affected flag(s)
  • Page 60: Package Information

    HT46RU66/HT46CU66 Package Information 52-pin QFP (14´14) Outline Dimensions Dimensions in mm Symbol Min. Nom. Max. ¾ 17.3 17.5 ¾ 13.9 14.1 ¾ 17.3 17.5 ¾ 13.9 14.1 ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ ¾ 0.73 1.03 ¾...
  • Page 61 HT46RU66/HT46CU66 56-pin SSOP (300mil) Outline Dimensions Dimensions in mil Symbol Min. Nom. Max. ¾ ¾ ¾ ¾ C¢ ¾ ¾ ¾ ¾ ¾ ¾ ¾ 0° 8° Rev. 1.20 October 2, 2007...
  • Page 62 HT46RU66/HT46CU66 100-pin QFP (14´20) Outline Dimensions Dimensions in mm Symbol Min. Nom. Max. ¾ 18.50 19.20 ¾ 13.90 14.10 ¾ 24.50 25.20 ¾ 19.90 20.10 ¾ ¾ 0.65 ¾ ¾ 0.30 ¾ 2.50 3.10 ¾ ¾ 3.40 ¾ ¾ 0.10 ¾...
  • Page 63 Copyright Ó 2007 by HOLTEK SEMICONDUCTOR INC. The information appearing in this Data Sheet is believed to be accurate at the time of publication. However, Holtek as- sumes no responsibility arising from the use of the specifications described. The applications mentioned herein are used...

This manual is also suitable for:

Ht46cu66