HT46R49 Holtek Semiconductor, HT46R49 Datasheet - Page 26

no-image

HT46R49

Manufacturer Part Number
HT46R49
Description
Cost-Effective A/D Type 8-Bit MCU
Manufacturer
Holtek Semiconductor
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Company:
Part Number:
HT46R49
Quantity:
50 000
www.datasheet4u.com
The following diagram illustrates the waveforms associ-
ated with the 6+2 mode of PWM operation. It is impor-
tant to note how the single PWM cycle is subdivided into
4 individual modulation cycles, numbered from 0~3 and
how the AC value is related to the PWM value.
PWM Output Control
On all devices, the PWM outputs are pin-shared with
pins PD0 and PD1. To operate as PWM outputs and not
as I/O pins, the correct PWM configuration options must
be selected. A 0 must also be written to the corre-
sponding bits in the I/O port control register PDC to en-
sure that the required PWM output pin is setup as an
output. After these two initial steps have been carried
PWM Programming Example
The following sample program shows how the PWM outputs are setup and controlled. Before use the corresponding
PWM output configuration options must first be selected.
mov a,64h
mov pwm,a
clr pdc.0
set pd.0
clr pd.0
Rev. 1.30
:
:
:
:
; setup PWM value of 100 decimal which is 64H
; setup pin PD0 as an output
; PD.0=1; enable the PWM output
; disable the PWM output
Pulse Width Modulation Registers
6+2 PWM Mode
PD0 will remain low
HT46R46/C46/R47/C47/R48A/C48A/R49
26
out, and of course after the required PWM value has
been written into the PWM register, writing a 1 to the
corresponding bit in the PD output data register will en-
able the PWM data to appear on the pin. Writing a 0 to
the corresponding bit in the PD output data register will
disable the PWM output function and force the output
low. In this way, the Port D data output register can be
used as an on/off control for the PWM function. Note
that if the configuration options have selected the PWM
function, but a 1 has been written to its corresponding
bit in the PDC control register to configure the pin as an
input, then the pin can still function as a normal input
line, with pull-high resistor options.
June 5, 2008

Related parts for HT46R49