4.2 One-Shot Mode

In TMR2, the One-Shot mode is identical to the Free-Running Period mode except that the ON bit is cleared and the timer is stopped when T2TMR matches T2PR and will not restart until the ON bit is cycled off and on. This can easily be achieved in UTMR using the One-Shot Enable (OSEN) bit. The following table shows UTMR settings in different TMR2 One-Shot modes:
Table 4-2. UTMR Settings for Different TMR2 One-Shot Modes

TMR2

MODE[4:0]

TMR2 ModeUTMR Settings
OutputOperationStartResetStopSTARTRESETSTOPOther
01000One-shotSoftware startON = 1ON = 0 (or) Next clock after PR matchNone (ON = 1)At PR MatchAt PR MatchOSEN = Enabled
01001

Edge-

Triggered Start

Rising edge start

ON = 1

(and)

Rising ERS Edge

Rising ERS Edge
01010Falling edge start

ON = 1

(and)

Falling ERS Edge

OSEN = Enabled (and) EPOL = Inverted
01011Any edge start

ON = 1

(and)

Either ERS Edge

Either ERS EdgeAt PR MatchOSEN = Enabled
01100

Edge-

Triggered Start and Hardware Reset

Rising edge start and

Rising edge Reset

ON = 1

(and)

Rising ERS Edge

ERS = Rising ERS EdgeON = 0 (or) Next clock after PR matchRising ERS EdgeAt Start + PR MatchAt PR MatchOSEN = Enabled
01101

Falling edge start and

Falling edge Reset

ON = 1

(and)

Falling ERS Edge

ERS = Falling ERS EdgeAt PR MatchOSEN = Enabled (and) EPOL = Inverted
01110

Rising edge start and

Low-level Reset

ON = 1

(and)

Rising ERS Edge

ERS = 0ERS Level - 0 + PR MatchOSEN = Enabled
01111

Falling edge start and

High-level Reset

ON = 1

(and)

Falling ERS Edge

ERS = 1OSEN = Enabled (and) EPOL = Inverted
10110Level Triggered Start and Hardware ResetHigh-level start and Low-level Reset

ON = 1

ERS = 0ON = 0 (or) Next clock after PR match (or) Held in ResetERS Level - 1ERS Level - 0 + PR MatchAt PR MatchOSEN = Enabled
10111

Low-level start and

High-level Reset

ON = 1

ERS = 1OSEN = Enabled (and) EPOL = Inverted