
R01UH0336EJ0102 Rev.1.02
Page 932 of 1538
Jul 17, 2014
V850E2/PG4-L
Section 16 TPBA
(3) Relationship between TPBAnCNT1 Read Value and TPBAnBUFm
The duty value of the currently output PWM waveform can be obtained by
reading the TPBAnCNT1 count value during operation. TPBAnBUFm in
which the currently output duty value is stored can be found by one of the
following formulas.
(1)
When TPBAnDPS = 0 and the TPBAnCNT1
≠
00
H
The applicable register is found by the formula TPBAnCNT1 - 01
H
.
(Example) When TPBAnCNT1 = 08
H
: 08
H
- 01
H
= 07
H
-> TPBA0BUF07
(2)
When TPBAnDPS = 0 and the TPBAnCNT1 = 00
H
The applicable register is found by the TPBAnCMP1 value.
(Example) When TPBAnCMP1 = 08
H
: TPBAnBUF08
(3)
When TPBAnDPS = 1 and the TPBAnCNT1 = an odd number
The applicable register is found by the formula TPBAnCNT1 / 2
(Example) When TPBAnCNT1 = 07
H
: 07
H
/ 02
H
= 03
H
-> TPBAnBUF03
(lower 8 bits)
(4)
When TPBAnDPS = 1 and the TPBAnCNT1 = an even number
The applicable register is found by the formula (TPBAnCNT1 / 2) - 01
H
.
(Example) When TPBAnCNT1 = 08
H
: (08
H
/ 02
H
) - 01
H
= 03
H
->
TPBAnBUF03 (upper 8 bits)
(5)
When TPBAnDPS = 1 and the TPBAnCNT1 = 00
H
The applicable register is found by the formula TPBAnCMP1 / 2.
(Example) When TPBAnCMP1 = 08
H
: 08
H
/ 2 = 04
H
-> TPBAnBUF04
(lower 8 bits)
TPBAnDPS0 Bit
Formula
TPBAnCNT1
00
H
TPBAnCNT1 = 00
H
0: 16 bits × 64
patterns mode
(1) TPBAnCNT1 - 01
H
(2) TPBAnCMP1
1: 8 bits × 128
patterns mode
TPBAnCNT1 value
is an odd number
(3) TPBAnCNT1/2
(5) TPBAnCMP1/2
TPBAnCNT1 value
is an even number
(4) (TPBAnCNT1 /
2) - 01
H