8-Bit Pwm Output Operation - NEC V850ES/KE1+ User Manual

32-bit single-chip microcontrollers
Table of Contents

Advertisement

8.4.4 8-bit PWM output operation

By setting the TMC5n.TMC5n6 bit to 1, 8-bit timer/event counter 5n performs PWM output.
Pulses with a duty factor determined by the value set in the CR5n register are output from the TO5n pin.
Set the width of the active level of the PWM pulse in the CR5n register. The active level can be selected using the
TMC5n.TMC5n1 bit.
The count clock can be selected using the TCL5n register.
PWM output can be enabled/disabled by the TMC5n.TOE5n bit.
Caution The CR5n register rewrite interval must be three or more operation clocks (set by the TCL5n
register).
Use method
<1> Set each register.
• TCL5n register:
• CR5n register:
• TMC5n register: Stops count operation, selects PWM mode, and leave timer output F/F
• For the alternate-function pin settings, refer to Table 4-12 Settings When Port Pins Are Used
for Alternate Functions.
<2> When the TMC5n.TCE5n bit is set to 1, counting starts.
PWM output operation
<1> When counting starts, PWM output (output from the TO5n pin) outputs the inactive level until an
overflow occurs.
<2> When an overflow occurs, the active level set by setting method <1> is output. The active level is
output until the value of the CR5n register and the count value of the TM5n register match. An
interrupt request signal (INTTM5n) is generated.
<3> When the value of the CR5n register and the count value of the TM5n register match, the inactive
level is output and continues to be output until an overflow occurs again.
<4> Then, steps <2> and <3> are repeated until counting is stopped.
<5> When counting is stopped by clearing TCE5n bit to 0, PWM output becomes inactive.
Cycle = 256t, active level width = Nt, duty = N/256: N = 00H to FFH
Remarks 1. n = 0, 1
2. For the detailed timing, refer to Figure 8-5 Timing of PWM Output Operation and
CHAPTER 8 8-BIT TIMER/EVENT COUNTER 5
Selects the count clock (t).
Compare value (N)
unchanged, sets active level, and enables timer output.
(TMC5n register = 01000001B or 01000011B)
Figure 8-6 Timing of Operation Based on CR5n Register Transitions.
User's Manual U16896EJ2V0UD
305

Advertisement

Table of Contents
loading

This manual is also suitable for:

?pd70f3302?pd703302?pd70f3302y?pd703302y

Table of Contents