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 124/228:

Comparator Configuration

Download datasheet (5Mb)Embed
PrevNext
PIC16F87/88
13.1

Comparator Configuration

There are eight modes of operation for the compara-
tors. The CMCON register is used to select these
modes. Figure 13-1 shows the eight possible modes.
The TRISA register controls the data direction of the
comparator pins for each mode. If the Comparator
mode is changed, the comparator output level may not
be valid for the specified mode change delay shown in
Section 18.0 “Electrical Characteristics”.
FIGURE 13-1:
COMPARATOR I/O OPERATING MODES
Comparators Reset
CM2:CM0 = 000
A
V
-
IN
RA0/AN0
Off
C1
V
+
RA3/AN3/
A
IN
C1OUT
A
V
-
IN
RA1/AN1
Off
C2
RA2/AN2/
A
V
+
IN
CV
REF
Two Independent Comparators
CM2:CM0 = 100
A
V
-
IN
RA0/AN0
C1OUT
C1
A
V
+
IN
RA3/AN3/
C1OUT
A
V
-
IN
RA1/AN1
C2OUT
C2
A
V
+
IN
RA2/AN2/
CV
REF
Two Common Reference Comparators
CM2:CM0 = 011
A
V
-
IN
RA0/AN0
C1OUT
C1
V
+
D
RA3/AN3/
IN
C1OUT
A
V
-
IN
RA1/AN1
C2OUT
C2
V
+
A
IN
RA2/AN2/
CV
REF
One Independent Comparator
CM2:CM0 = 101
D
V
-
IN
RA0/AN0
Off
C1
V
+
D
RA3/AN3/
IN
C1OUT
A
V
-
IN
RA1/AN1
C2OUT
C2
V
+
RA2/AN2/
A
IN
CV
REF
A = Analog Input, port reads zeros always.
D = Digital Input.
CIS (CMCON<3>) is the Comparator Input Switch.
DS30487C-page 122
Note:
Comparator interrupts should be disabled
during a Comparator mode change;
otherwise, a false interrupt may occur.
Comparators Off (POR Default Value)
CM2:CM0 = 111
D
RA0/AN0
(Read as ‘0’)
D
RA3/AN3/
C1OUT
D
RA1/AN1
(Read as ‘0’)
D
RA2/AN2/
CV
REF
Four Inputs Multiplexed to Two Comparators
CM2:CM0 = 010
A
RA0/AN0
A
RA3/AN3/
C1OUT
A
RA1/AN1
RA2/AN2/
A
CV
REF
Two Common Reference Comparators with Outputs
CM2:CM0 = 110
A
RA0/AN0
D
RA3/AN3/
C1OUT
A
RA1/AN1
RA2/AN2/
A
CV
REF
RA4/T0CKI/C2OUT
Three Inputs Multiplexed to Two Comparators
CM2:CM0 = 001
A
RA0/AN0
(Read as ‘0’)
A
RA3/AN3/
C1OUT
A
RA1/AN1
RA2/AN2/
A
CV
REF
V
-
IN
Off
C1
(Read as ‘0’)
V
+
IN
V
-
IN
Off
C2
(Read as ‘0’)
V
+
IN
CIS = 0
V
-
IN
CIS = 1
C1OUT
C1
V
+
IN
CIS = 0
V
-
IN
CIS = 1
C2OUT
C2
V
+
IN
From V
Module
REF
V
-
IN
C1OUT
C1
V
+
IN
V
-
IN
C2OUT
C2
V
+
IN
CIS = 0
V
-
IN
CIS = 1
C1OUT
C1
V
+
IN
V
-
IN
C2OUT
C2
V
+
IN
 2005 Microchip Technology Inc.