
Rev. 1.00
��
��ne 1�� �01�
Rev. 1.00
�3
��ne 1�� �01�
HT46R003B
Cost-Effective A/D 8-bit OTP MCU
HT46R003B
Cost-Effective A/D 8-bit OTP MCU
Time Base
The device includes a Time Base function which is used to generate a regular time interval signal.
The Time Base time interval magnitude is determined using an internal 13 stage counter sets the
division ratio of theclock source. This division ratio is controlled by both the TBSEL0 and TBSEL1
bits in the CTRL1 register. The clock source is selected using the WDTCLS1~WDTCLS0 bits in the
WDTC register.
When the Time Base time out, a Time Base interrupt signal will be generated. It should be noted that
as the Time Base clock source is the same as the Timer/Event Counter clock source, care should be
taken when programming.
Pulse Width Modulator
The device includes one 8-bit PWM function. Useful for the 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.
PWM Operation
The register, known as PWM and located in the Data Memory is assigned to each Pulse Width
Modulator channel. It is here that the 8-bit value, which represents the overall duty cycle of one
modulation cycle of the output waveform, should be placed. To increase the PWM modulation
frequency, each modulation cycle is subdivided into two or four individual modulation subsections,
known as the 7+1 mode or 6+2 mode respectively. The required mode and the on/off control for
each PWM channel is selected using the CTRL0 register. Note that when using the PWM, it is only
necessary to write the required value into the PWM register and select the required mode set and on/
off control using the CTRL0 register, the subdivision of the waveform into its sub-modulation cycles
is implemented automatically within the microcontroller hardware. The PWM clock source f
S
comes
from the system clock f
SYS
, f
SYS
/4 or f
LIRC
.
This method of dividing the original modulation cycle into a further 2 or 4 sub-cycles enable the
generation of higher PWM frequencies which allow a wider range of applications to be served.
The difference between what is known as the PWM cycle frequency and the PWM modulation
frequency should be understood. As the PWM value is 8-bit wide, the overall PWM cycle frequency
is f
SYS
/256. However, when in the 7+1 mode of operation the PWM modulation frequency will be
f
S
/128, while the PWM modulation frequency for the 6+2 mode of operation will be f
S
/64.
PWM Modulation
PWM Cycle Frequency
PWM Cycle Duty
f
S
/6� for (6+�) bits mode
f
S
/1�8 for (7+1) bits mode
f
S
/�56
[PWM]/�56
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. Each one of these four sub-cycles
contains 64 clock cycles. In this mode, a modulation frequency increase of four is achieved. The
8-bit PWM register value, which represents the overall duty cycle of the PWM waveform, is divided
into two groups. The first group which consists of bit 2~bit 7 is denoted here as the DC value. The
second group which consists of bit 0~bit 1 is known as the AC value. In the 6+2 PWM mode, the
duty cycle value of each of the four modulation sub-cycles is shown in the following table.