PIC16F88

Manufacturer Part NumberPIC16F88
ManufacturerMicrochip Technology Inc.
PIC16F88 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
42
43
44
45
46
47
48
49
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
Page 121
122
Page 122
123
Page 123
124
Page 124
125
Page 125
126
Page 126
127
Page 127
128
Page 128
129
Page 129
130
Page 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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
Page 125/228:

Comparator Operation

Download datasheet (5Mb)Embed
PrevNext
13.2

Comparator Operation

A single comparator is shown in Figure 13-2, along with
the relationship between the analog input levels and
the digital output. When the analog input at V
than the analog input V
-, the output of the comparator
IN
is a digital low level. When the analog input at V
greater than the analog input V
-, the output of the
IN
comparator is a digital high level. The shaded areas of
the output of the comparator in Figure 13-2 represent
the uncertainty due to input offsets and response time.
13.3
Comparator Reference
An external or internal reference signal may be used
depending on the comparator operating mode. The
analog signal present at V
- is compared to the signal
IN
at V
+ and the digital output of the comparator is
IN
adjusted accordingly (Figure 13-2).
FIGURE 13-2:
SINGLE COMPARATOR
V
+
+
IN
V
-
IN
V
-
IN
V
IN–
V
+
IN
V
IN+
Output
Output
13.3.1
EXTERNAL REFERENCE SIGNAL
When external voltage references are used, the
comparator module can be configured to have the com-
parators operate from the same, or different reference
sources. However, threshold detector applications may
require the same reference. The reference signal must
be between V
and V
and can be applied to either
SS
DD
pin of the comparator(s).
 2005 Microchip Technology Inc.
13.3.2
INTERNAL REFERENCE SIGNAL
The comparator module also allows the selection of an
internally
generated
comparators. Section 14.0 “Comparator Voltage
+ is less
IN
Reference Module” contains a detailed description of
the Comparator Voltage Reference module that
+ is
IN
provides this signal. The internal reference signal is
used when comparators are in mode CM<2:0> = 010
(Figure 13-1). In this mode, the internal voltage
reference is applied to the V
comparators.
13.4
Comparator Response Time
Response time is the minimum time, after selecting a
new reference voltage or input source, before the
comparator output has a valid level. If the internal
reference is changed, the maximum delay of the inter-
nal voltage reference must be considered when using
the comparator outputs. Otherwise, the maximum
delay of the comparators should be used (Section 18.0
“Electrical Characteristics”).
13.5
Comparator Outputs
Output
The comparator outputs are read through the CMCON
register. These bits are read-only. The comparator
outputs may also be directly output to the RA3 and RA4
I/O pins. When enabled, multiplexors in the output path
of the RA3 and RA4 pins will switch and the output of
each pin will be the unsynchronized output of the com-
parator. The uncertainty of each of the comparators is
related to the input offset voltage and the response time
given in the specifications. Figure 13-3 shows the
comparator output block diagram.
The TRISA bits will still function as an output enable/
disable for the RA3 and RA4 pins while in this mode.
The polarity of the comparator outputs can be changed
using the C2INV and C1INV bits (CMCON<5:4>).
Note 1: When reading the Port register, all pins
configured as analog inputs will read as
‘0’. Pins configured as digital inputs will
convert an analog input, according to the
Schmitt Trigger input specification.
2: Analog levels, on any pin defined as a
digital input, may cause the input buffer to
consume more current than is specified.
PIC16F87/88
voltage
reference
for
the
+ pin of both
IN
DS30487C-page 123