Prescaler
With the exception of TMR1C, bits 0~2 of the timer control register can be used to define the
pre-scaling stages of the internal clock sources of the Timer/Event Counter. The Timer/Event
Counter overflow signal can be used to generate signals for the PFD and as a Timer Interrupt.
I/O Interfacing
The Timer/Event Counter when configured to run in the event counter or pulse width measure-
ment mode, require the use of the external timer pin for correct operation. This external timer pin
may be pin-shared with other I/O pins, depending upon which device is selected. Pull-high resis-
tors can be selected for connection to the timer input pins. The timers can also be setup to drive
the PFD pin. When the PFD output is selected by selecting the correct configuration option, the out-
put of the chosen timer can be made to drive this at a frequency determined by the contents of the
timer register and the timer.
Programming Considerations
When configured to run in the timer mode, the internal system clock is used as the timer clock
source and is therefore synchronized with the overall operation of the microcontroller. In this mode
when the appropriate timer register is full, the microcontroller will generate an internal interrupt sig-
nal directing the program flow to the respective internal interrupt vector. For the pulse width mea-
surement mode, the internal system clock is also used as the timer clock source but the timer will
only run when the correct logic condition appears on the external timer input pin. As this is an exter-
nal event and not synchronized with the internal timer clock, the microcontroller will only see this
external event when the next timer clock pulse arrives. As a result, there may be small differences
in measured values requiring programmers to take this into account during programming. The
same applies if the timer is configured to be in the event counting mode which again is an external
event and not synchronized with the internal system or timer clock.
Pulse Width Modulator
Each microcontroller in the A/D series is provided with one or more Pulse Width Modulation
(PWM) outputs. Useful for such applications such as motor speed control, the PWM function pro-
vides outputs with a fixed frequency but with a duty cycle that can be varied by setting particular
values into the corresponding PWM register.
A single register, located in the Data Memory is assigned to each PWM. For devices with a single
PWM output, this register is known as PWM. For devices with two PWM outputs, the registers as-
sume the names PWM0 and PWM1 while devices with four PWM outputs require a further addi-
tional two registers known as PWM2 and PWM3. 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 in-
crease the PWM modulation frequency, each modulation cycle is modulated into two or four indi-
vidual modulation sub-sections, known as the 7+1 mode or 6+2 mode respectively. With the
exception of the HT46R47/HT46C47 devices, which have a fixed 6+2 mode, each device can
choose which mode to use by selecting the appropriate configuration option. When a mode config-
uration option is chosen, it applies to all PWM outputs on that device. Note that when using the
PWM it is only necessary to write the required value into the appropriate PWM register and select
the required mode configuration option, the subdivision of the waveform into its sub-modulation cy-
cles is done automatically within the microcontroller hardware.
42
A/D Type MCU
Summary of Contents for HT46R22
Page 7: ...vi A D Type MCU...
Page 9: ...viii A D Type MCU...
Page 10: ...P a r t I Microcontroller Profile Part I Microcontroller Profile 1...
Page 11: ...2 A D Type MCU...
Page 90: ...P a r t I I Programming Language Part II Programming Language 81...
Page 91: ...82 A D Type MCU...
Page 97: ...88 A D Type MCU...
Page 128: ...P a r t I I I Development Tools Part III Development Tools 119...
Page 129: ...120 A D Type MCU...
Page 140: ...Appendix Appendix 131...
Page 141: ...132 A D Type MCU...
Page 151: ...142 A D Type MCU...
Page 152: ...A p p e n d i x B Package Information Appendix B Package Information 143 B...
Page 161: ...A D Type MCU...
Page 162: ...Amendments...