r8a66170dd Renesas Electronics Corporation., r8a66170dd Datasheet - Page 3

no-image

r8a66170dd

Manufacturer Part Number
r8a66170dd
Description
4-ch 16-bit Pwm Generator
Manufacturer
Renesas Electronics Corporation.
Datasheet
R8A66170DD/SP
OPERATION
Commands
The information on data bus inputs D0 through D7 is treated as command when command / data control input C/D = 1,
and is treated as data when C/D = 0.
There are three kinds of commands. (See Figure 1.)
Data input
At initialization, all 16-bit of prescaler values must be written.
In mode 0 or 1, the PWM values must be written to all 16-bits of H register (*1), In mode 2, the value must be written to
all 16-bits of H and L registers.
In case of changing the value of prescaler and PWM during for operation, the procedure is as follows.
When values are written to the lower byte (lower byte of L register in Mode 2), the write cycle of data registers is
completed.
(Note)
Figure 3 shows the flow chart of the basic operation.
The order of the prescaler’s and PWM counter’s data setting is not fixed.
REJ03F0272-0100 Rev.1.00 Apr.01.2008
Page 3 of 20
(*1): In mode0, at 8-bit resolution, only the lower byte of the H register is used.
Command 1 selects the output mode and external trigger input of each channel and sets the output polarity of H
width.
Command 2 specifies, on a byte basis, to which 16-bit register of the prescaler and PWM counter of each channel
data is to be written. The second and subsequent bytes of command 2 write prescaler value and PWM value.
Depending on the location specified by command 2, the data of the second and subsequent bytes must be written in
the order shown in Figure2.
Command 3 is used to start or stop the prescalers and PWM counters operation.
To change the values of all 16-bits in the prescaler or the PWM counter during operation, values should be written
to the upper byte first and then to the lower byte.
To change the values of the lower byte only, the values of only the lower byte should be written.
To change the values of the upper byte only, the values of all 16-bits should be written.
To change the values of H register in Mode 2, the H register values should be written followed by the L register
value.
If the data registers values is changed during a PWM signal is outputted (exactly, finish to write those values), the
PWM output is updated at the start of next cycle.
To change the mode (i.e., to execute command 1), disable the output first (i.e., execute command 3).

Related parts for r8a66170dd