beautypg.com

1 up count pwm output mode, 12 .1 .5 .1 up count pwm output mode -8, Figure 12-6 – Maxim Integrated MAX31782 User Manual

Page 110: 1upcountpwmoutputmode

background image

MaximIntegrated 12-8

MAX31782 User’s Guide

Revision 0; 8/11

12.1.5.1UpCountPWMOutputMode

When operating in PWM output mode and configured for up count (DCEN = 0), the value in TB0V is incremented until it
reaches the reload value, TB0R . At this point, TB0V is reloaded with 0000h, the TFB flag is set (which can generate an
interrupt if enabled), and counting continues .

Figure 12-6

illustrates the PWM waveforms when the Timer B is operating

in up count PWM output mode . The period of the PWM waveform is set by the value in the TB0R register . The set and
reset modes provide similar functionality . The formulas for period and duty cycle are:

PWM PERIOD = (TB0R + 1)

× TIMER B CLOCK PERIOD

Duty Cycle in Set Mode =

TB0R TB0C

TB0R 1

+

Duty Cycle in Reset Mode =

TB0C

TB0R 1

+

The toggle mode generates a 50% duty-cycle waveform if the TB0C register remains fixed with the Timer B running .
The period of the waveform is:

PERIOD = 2

× (TB0R + 1) × TIMER B CLOCK PERIOD

Figure 12-6. TBB Pin Waveform in Up Count PWM Output Mode

TB0C > TB0R

TB0C < TB0R

0000

TB0V

SET MODE

RESET MODE

TOGGLE MODE

SET MODE

RESET MODE

TOGGLE MODE

TB0R

TB0C < TB0R

TB0C > TB0R