PIC12F1516 MICROCHIP [Microchip Technology], PIC12F1516 Datasheet - Page 162

no-image

PIC12F1516

Manufacturer Part Number
PIC12F1516
Description
28/40/44-Pin Flash Microcontrollers with nanoWatt XLP Technology
Manufacturer
MICROCHIP [Microchip Technology]
Datasheet
PIC16(L)F1516/7/8/9
18.6.2.1
The T1G pin is one source for Timer1 Gate Control. It
can be used to supply an external source to the Timer1
Gate circuitry.
18.6.2.2
When Timer0 increments from FFh to 00h, a
low-to-high pulse will automatically be generated and
internally supplied to the Timer1 Gate circuitry.
18.6.2.3
When Timer2 increments and matches PR2, a
low-to-high pulse will automatically be generated and
internally supplied to the Timer1 Gate circuitry.
18.6.3
When Timer1 Gate Toggle mode is enabled, it is possi-
ble to measure the full-cycle length of a Timer1 gate
signal, as opposed to the duration of a single level
pulse.
The Timer1 Gate source is routed through a flip-flop
that changes state on every incrementing edge of the
signal. See
Timer1 Gate Toggle mode is enabled by setting the
T1GTM bit of the T1GCON register. When the T1GTM
bit is cleared, the flip-flop is cleared and held clear. This
is necessary in order to control which edge is
measured.
DS41452B-page 162
Note:
TIMER1 GATE TOGGLE MODE
Figure 18-4
Enabling Toggle mode at the same time
as changing the gate polarity may result in
indeterminate operation.
T1G Pin Gate Operation
Timer0 Overflow Gate Operation
Timer2 Match PR2 Operation
for timing details.
Preliminary
18.6.4
When Timer1 Gate Single-Pulse mode is enabled, it is
possible to capture a single-pulse gate event. Timer1
Gate Single-Pulse mode is first enabled by setting the
T1GSPM bit in the T1GCON register. Next, the
T1GGO/DONE bit in the T1GCON register must be set.
The Timer1 will be fully enabled on the next incrementing
edge. On the next trailing edge of the pulse, the
T1GGO/DONE bit will automatically be cleared. No other
gate events will be allowed to increment Timer1 until the
T1GGO/DONE bit is once again set in software. See
Figure 18-5
If the Single-Pulse Gate mode is disabled by clearing the
T1GSPM bit in the T1GCON register, the T1GGO/DONE
bit should also be cleared.
Enabling the Toggle mode and the Single-Pulse mode
simultaneously will permit both sections to work
together. This allows the cycle times on the Timer1
Gate source to be measured. See
timing details.
18.6.5
When Timer1 Gate Value Status is utilized, it is possible
to read the most current level of the gate control value.
The value is stored in the T1GVAL bit in the T1GCON
register. The T1GVAL bit is valid even when the Timer1
Gate is not enabled (TMR1GE bit is cleared).
18.6.6
When Timer1 Gate Event Interrupt is enabled, it is pos-
sible to generate an interrupt upon the completion of a
gate event. When the falling edge of T1GVAL occurs,
the TMR1GIF flag bit in the PIR1 register will be set. If
the TMR1GIE bit in the PIE1 register is set, then an
interrupt will be recognized.
The TMR1GIF flag bit operates even when the Timer1
Gate is not enabled (TMR1GE bit is cleared).
TIMER1 GATE SINGLE-PULSE
MODE
TIMER1 GATE VALUE STATUS
TIMER1 GATE EVENT INTERRUPT
for timing details.
 2011 Microchip Technology Inc.
Figure 18-6
for

Related parts for PIC12F1516