PIC16F688

Manufacturer Part NumberPIC16F688
ManufacturerMicrochip Technology Inc.
PIC16F688 datasheet
 


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Page 41
42
Page 42
43
Page 43
44
Page 44
45
Page 45
46
Page 46
47
Page 47
48
Page 48
49
Page 49
50
Page 50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
Page 50/202:

TIMER1 MODULE WITH GATE CONTROL

Download datasheet (4Mb)Embed
PrevNext
PIC16F688
6.0
TIMER1 MODULE WITH GATE
CONTROL
The Timer1 module is a 16-bit timer/counter with the
following features:
• 16-bit timer/counter register pair (TMR1H:TMR1L)
• Programmable internal or external clock source
• 3-bit prescaler
• Optional LP oscillator
• Synchronous or asynchronous operation
• Timer1 gate (count enable) via comparator or
T1G pin
• Interrupt on overflow
• Wake-up on overflow (external clock,
Asynchronous mode only)
Figure 6-1 is a block diagram of the Timer1 module.
FIGURE 6-1:
TIMER1 BLOCK DIAGRAM
Set flag bit
TMR1IF on
Overflow
TMR1
TMR1H
Oscillator
OSC1/T1CKI
OSC2/T1G
INTOSC
Without CLKOUT
T1OSCEN
Note 1:
ST Buffer is low power type when using LP oscillator, or high speed type when using T1CKI.
2:
Timer1 register increments on rising edge.
3:
Synchronize does not operate while in Sleep.
DS41203D-page 48
6.1
Timer1 Operation
The Timer1 module is a 16-bit incrementing counter
which is accessed through the TMR1H:TMR1L register
pair. Writes to TMR1H or TMR1L directly update the
counter.
When used with an internal clock source, the module is
a timer. When used with an external clock source, the
module can be used as either a timer or counter.
6.2
Clock Source Selection
The TMR1CS bit of the T1CON register is used to select
the clock source. When TMR1CS = 0, the clock source
is F
/4. When TMR1CS = 1, the clock source is
OSC
supplied externally.
Clock Source
F
/4
OSC
T1CKI pin
TMR1ON
To C2 Comparator Module
Timer1 Clock
(2)
0
EN
TMR1L
1
(1)
T1SYNC
1
Prescaler
1, 2, 4, 8
F
/4
OSC
0
Internal
Clock
T1CKPS<1:0>
TMR1CS
TMR1CS
Clock Source
F
/4
0
OSC
T1CKI pin
1
TMR1GE
T1GINV
Synchronized
clock input
(3)
Synchronize
det
2
1
C2OUT
0
T1GSS
© 2007 Microchip Technology Inc.