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
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
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 43/228

Download datasheet (5Mb)Embed
PrevNext
FIGURE 4-6:
PIC16F87/88 CLOCK DIAGRAM
Primary Oscillator
OSC2
Sleep
OSC1
Secondary Oscillator
T1OSO
T1OSCEN
Enable
Oscillator
T1OSI
Internal
Oscillator
Block
31.25 kHz
Source
31.25 kHz
(INTRC)
4.6.4
MODIFYING THE IRCF BITS
The IRCF bits can be modified at any time regardless of
which clock source is currently being used as the
system clock. The internal oscillator allows users to
change the frequency during run time. This is achieved
by modifying the IRCF bits in the OSCCON register.
The sequence of events that occur after the IRCF bits
are modified is dependent upon the initial value of the
IRCF bits before they are modified. If the INTRC
(31.25 kHz, IRCF<2:0> = 000) is running and the IRCF
bits are modified to any other value than ‘000’, a 4 ms
(approx.) clock switch delay is turned on. Code execu-
tion continues at a higher than expected frequency
while the new frequency stabilizes. Time sensitive code
should wait for the IOFS bit in the OSCCON register to
become set before continuing. This bit can be moni-
tored to ensure that the frequency is stable before using
the system clock in time critical applications.
If the IRCF bits are modified while the internal oscillator
is running at any other frequency than INTRC
(31.25 kHz, IRCF<2:0>
000), there is no need for a
4 ms (approx.) clock switch delay. The new INTOSC
frequency will be stable immediately after the eight fall-
ing edges. The IOFS bit will remain set after clock
switching occurs.
Note:
Caution must be taken when modifying the
IRCF bits using BCF or BSF instructions. It
is possible to modify the IRCF bits to a
frequency that may be out of the V
ification range; for example, V
and IRCF = 111 (8 MHz).
 2005 Microchip Technology Inc.
LP, XT, HS, RC, EC
To Timer1
OSCCON<6:4>
8 MHz
111
4 MHz
110
2 MHz
101
1 MHz
100
500 kHz
8 MHz
011
(INTOSC)
250 kHz
010
125 kHz
001
31.25 kHz
000
4.6.5
CLOCK TRANSITION SEQUENCE
Following are three different sequences for switching
the internal RC oscillator frequency.
• Clock before switch: 31.25 kHz (IRCF<2:0> = 000)
1.
IRCF bits are modified to an INTOSC/INTOSC
postscaler frequency.
2.
The clock switching circuitry waits for a falling
edge of the current clock, at which point CLKO
is held low.
3.
The clock switching circuitry then waits for eight
falling edges of requested clock, after which it
switches CLKO to this new clock source.
4.
The IOFS bit is clear to indicate that the clock is
unstable and a 4 ms (approx.) delay is started.
Time dependent code should wait for IOFS to
become set.
5.
Switchover is complete.
• Clock before switch: One of INTOSC/INTOSC
postscaler (IRCF<2:0>
1.
IRCF
bits
(IRCF<2:0> = 000).
2.
The clock switching circuitry waits for a falling
edge of the current clock, at which point CLKO
is held low.
3.
The clock switching circuitry then waits for eight
falling edges of requested clock, after which it
switches CLKO to this new clock source.
spec-
DD
4.
Oscillator switchover is complete.
= 2.0V
DD
PIC16F87/88
Configuration Word 1 (FOSC2:FOSC0)
SCS<1:0> (T1OSC)
Peripherals
T1OSC
Internal Oscillator
CPU
WDT, FSCM
000)
are
modified
to
INTRC
DS30487C-page 41