~ubuntu-branches/ubuntu/utopic/gputils/utopic

« back to all changes in this revision

Viewing changes to header/p16f876.inc

  • Committer: Bazaar Package Importer
  • Author(s): Samuel Tardieu
  • Date: 2002-01-21 11:14:50 UTC
  • Revision ID: james.westby@ubuntu.com-20020121111450-rayvyl8jzft0ninr
Tags: upstream-0.10.0
ImportĀ upstreamĀ versionĀ 0.10.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
        LIST
 
2
; P16F876.INC  Standard Header File, Version 1.00    Microchip Technology, Inc.
 
3
        NOLIST
 
4
 
 
5
; This header file defines configurations, registers, and other useful bits of
 
6
; information for the PIC16F876 microcontroller.  These names are taken to match 
 
7
; the data sheets as closely as possible.  
 
8
 
 
9
; Note that the processor must be selected before this file is 
 
10
; included.  The processor may be selected the following ways:
 
11
 
 
12
;       1. Command line switch:
 
13
;               C:\ MPASM MYFILE.ASM /PIC16F876
 
14
;       2. LIST directive in the source file
 
15
;               LIST   P=PIC16F876
 
16
;       3. Processor Type entry in the MPASM full-screen interface
 
17
 
 
18
;==========================================================================
 
19
;
 
20
;       Revision History
 
21
;
 
22
;==========================================================================
 
23
 
 
24
;Rev:   Date:    Reason:
 
25
 
 
26
;1.12   01/12/00 Changed some bit names, a register name, configuration bits
 
27
;                 to match datasheet (DS30292B)
 
28
;1.00   08/07/98 Initial Release
 
29
 
 
30
;==========================================================================
 
31
;
 
32
;       Verify Processor
 
33
;
 
34
;==========================================================================
 
35
 
 
36
        IFNDEF __16F876
 
37
           MESSG "Processor-header file mismatch.  Verify selected processor."
 
38
        ENDIF
 
39
 
 
40
;==========================================================================
 
41
;
 
42
;       Register Definitions
 
43
;
 
44
;==========================================================================
 
45
 
 
46
W                            EQU     H'0000'
 
47
F                            EQU     H'0001'
 
48
 
 
49
;----- Register Files------------------------------------------------------
 
50
 
 
51
INDF                         EQU     H'0000'
 
52
TMR0                         EQU     H'0001'
 
53
PCL                          EQU     H'0002'
 
54
STATUS                       EQU     H'0003'
 
55
FSR                          EQU     H'0004'
 
56
PORTA                        EQU     H'0005'
 
57
PORTB                        EQU     H'0006'
 
58
PORTC                        EQU     H'0007'
 
59
 
 
60
PCLATH                       EQU     H'000A'
 
61
INTCON                       EQU     H'000B'
 
62
PIR1                         EQU     H'000C'
 
63
PIR2                         EQU     H'000D'
 
64
TMR1L                        EQU     H'000E'
 
65
TMR1H                        EQU     H'000F'
 
66
T1CON                        EQU     H'0010'
 
67
TMR2                         EQU     H'0011'
 
68
T2CON                        EQU     H'0012'
 
69
SSPBUF                       EQU     H'0013'
 
70
SSPCON                       EQU     H'0014'
 
71
CCPR1L                       EQU     H'0015'
 
72
CCPR1H                       EQU     H'0016'
 
73
CCP1CON                      EQU     H'0017'
 
74
RCSTA                        EQU     H'0018'
 
75
TXREG                        EQU     H'0019'
 
76
RCREG                        EQU     H'001A'
 
77
CCPR2L                       EQU     H'001B'
 
78
CCPR2H                       EQU     H'001C'
 
79
CCP2CON                      EQU     H'001D'
 
80
ADRESH                       EQU     H'001E'
 
81
ADCON0                       EQU     H'001F'
 
82
 
 
83
OPTION_REG                   EQU     H'0081'
 
84
TRISA                        EQU     H'0085'
 
85
TRISB                        EQU     H'0086'
 
86
TRISC                        EQU     H'0087'
 
87
PIE1                         EQU     H'008C'
 
88
PIE2                         EQU     H'008D'
 
89
PCON                         EQU     H'008E'
 
90
SSPCON2                      EQU     H'0091'
 
91
PR2                          EQU     H'0092'
 
92
SSPADD                       EQU     H'0093'
 
93
SSPSTAT                      EQU     H'0094'
 
94
TXSTA                        EQU     H'0098'
 
95
SPBRG                        EQU     H'0099'
 
96
ADRESL                       EQU     H'009E'
 
97
ADCON1                       EQU     H'009F'
 
98
 
 
99
EEDATA                       EQU     H'010C'
 
100
EEADR                        EQU     H'010D'
 
101
EEDATH                       EQU     H'010E'
 
102
EEADRH                       EQU     H'010F'
 
103
 
 
104
EECON1                       EQU     H'018C'
 
105
EECON2                       EQU     H'018D'
 
106
 
 
107
;----- STATUS Bits --------------------------------------------------------
 
108
 
 
109
IRP                          EQU     H'0007'
 
110
RP1                          EQU     H'0006'
 
111
RP0                          EQU     H'0005'
 
112
NOT_TO                       EQU     H'0004'
 
113
NOT_PD                       EQU     H'0003'
 
114
Z                            EQU     H'0002'
 
115
DC                           EQU     H'0001'
 
116
C                            EQU     H'0000'
 
117
 
 
118
;----- INTCON Bits --------------------------------------------------------
 
119
 
 
120
GIE                          EQU     H'0007'
 
121
PEIE                         EQU     H'0006'
 
122
T0IE                         EQU     H'0005'
 
123
INTE                         EQU     H'0004'
 
124
RBIE                         EQU     H'0003'
 
125
T0IF                         EQU     H'0002'
 
126
INTF                         EQU     H'0001'
 
127
RBIF                         EQU     H'0000'
 
128
 
 
129
;----- PIR1 Bits ----------------------------------------------------------
 
130
 
 
131
ADIF                         EQU     H'0006'
 
132
RCIF                         EQU     H'0005'
 
133
TXIF                         EQU     H'0004'
 
134
SSPIF                        EQU     H'0003'
 
135
CCP1IF                       EQU     H'0002'
 
136
TMR2IF                       EQU     H'0001'
 
137
TMR1IF                       EQU     H'0000'
 
138
 
 
139
;----- PIR2 Bits ----------------------------------------------------------
 
140
 
 
141
EEIF                         EQU     H'0004'
 
142
BCLIF                        EQU     H'0003'
 
143
CCP2IF                       EQU     H'0000'
 
144
 
 
145
;----- T1CON Bits ---------------------------------------------------------
 
146
 
 
147
T1CKPS1                      EQU     H'0005'
 
148
T1CKPS0                      EQU     H'0004'
 
149
T1OSCEN                      EQU     H'0003'
 
150
NOT_T1SYNC                   EQU     H'0002'
 
151
T1INSYNC                     EQU     H'0002'    ; Backward compatibility only
 
152
T1SYNC                       EQU     H'0002'
 
153
TMR1CS                       EQU     H'0001'
 
154
TMR1ON                       EQU     H'0000'
 
155
 
 
156
;----- T2CON Bits ---------------------------------------------------------
 
157
 
 
158
TOUTPS3                      EQU     H'0006'
 
159
TOUTPS2                      EQU     H'0005'
 
160
TOUTPS1                      EQU     H'0004'
 
161
TOUTPS0                      EQU     H'0003'
 
162
TMR2ON                       EQU     H'0002'
 
163
T2CKPS1                      EQU     H'0001'
 
164
T2CKPS0                      EQU     H'0000'
 
165
 
 
166
;----- SSPCON Bits --------------------------------------------------------
 
167
 
 
168
WCOL                         EQU     H'0007'
 
169
SSPOV                        EQU     H'0006'
 
170
SSPEN                        EQU     H'0005'
 
171
CKP                          EQU     H'0004'
 
172
SSPM3                        EQU     H'0003'
 
173
SSPM2                        EQU     H'0002'
 
174
SSPM1                        EQU     H'0001'
 
175
SSPM0                        EQU     H'0000'
 
176
 
 
177
;----- CCP1CON Bits -------------------------------------------------------
 
178
 
 
179
CCP1X                        EQU     H'0005'
 
180
CCP1Y                        EQU     H'0004'
 
181
CCP1M3                       EQU     H'0003'
 
182
CCP1M2                       EQU     H'0002'
 
183
CCP1M1                       EQU     H'0001'
 
184
CCP1M0                       EQU     H'0000'
 
185
 
 
186
;----- RCSTA Bits ---------------------------------------------------------
 
187
 
 
188
SPEN                         EQU     H'0007'
 
189
RX9                          EQU     H'0006'
 
190
RC9                          EQU     H'0006'    ; Backward compatibility only
 
191
NOT_RC8                      EQU     H'0006'    ; Backward compatibility only
 
192
RC8_9                        EQU     H'0006'    ; Backward compatibility only
 
193
SREN                         EQU     H'0005'
 
194
CREN                         EQU     H'0004'
 
195
ADDEN                        EQU     H'0003'
 
196
FERR                         EQU     H'0002'
 
197
OERR                         EQU     H'0001'
 
198
RX9D                         EQU     H'0000'
 
199
RCD8                         EQU     H'0000'    ; Backward compatibility only
 
200
 
 
201
;----- CCP2CON Bits -------------------------------------------------------
 
202
 
 
203
CCP2X                        EQU     H'0005'
 
204
CCP2Y                        EQU     H'0004'
 
205
CCP2M3                       EQU     H'0003'
 
206
CCP2M2                       EQU     H'0002'
 
207
CCP2M1                       EQU     H'0001'
 
208
CCP2M0                       EQU     H'0000'
 
209
 
 
210
;----- ADCON0 Bits --------------------------------------------------------
 
211
 
 
212
ADCS1                        EQU     H'0007'
 
213
ADCS0                        EQU     H'0006'
 
214
CHS2                         EQU     H'0005'
 
215
CHS1                         EQU     H'0004'
 
216
CHS0                         EQU     H'0003'
 
217
GO                           EQU     H'0002'
 
218
NOT_DONE                     EQU     H'0002'
 
219
GO_DONE                      EQU     H'0002'
 
220
ADON                         EQU     H'0000'
 
221
 
 
222
;----- OPTION_REG Bits ----------------------------------------------------
 
223
 
 
224
NOT_RBPU                     EQU     H'0007'
 
225
INTEDG                       EQU     H'0006'
 
226
T0CS                         EQU     H'0005'
 
227
T0SE                         EQU     H'0004'
 
228
PSA                          EQU     H'0003'
 
229
PS2                          EQU     H'0002'
 
230
PS1                          EQU     H'0001'
 
231
PS0                          EQU     H'0000'
 
232
 
 
233
;----- PIE1 Bits ----------------------------------------------------------
 
234
 
 
235
ADIE                         EQU     H'0006'
 
236
RCIE                         EQU     H'0005'
 
237
TXIE                         EQU     H'0004'
 
238
SSPIE                        EQU     H'0003'
 
239
CCP1IE                       EQU     H'0002'
 
240
TMR2IE                       EQU     H'0001'
 
241
TMR1IE                       EQU     H'0000'
 
242
 
 
243
;----- PIE2 Bits ----------------------------------------------------------
 
244
 
 
245
EEIE                         EQU     H'0004'
 
246
BCLIE                        EQU     H'0003'
 
247
CCP2IE                       EQU     H'0000'
 
248
 
 
249
;----- PCON Bits ----------------------------------------------------------
 
250
 
 
251
NOT_POR                      EQU     H'0001'
 
252
NOT_BO                       EQU     H'0000'
 
253
NOT_BOR                      EQU     H'0000'
 
254
 
 
255
;----- SSPCON2 Bits --------------------------------------------------------
 
256
 
 
257
GCEN                         EQU     H'0007'
 
258
ACKSTAT                      EQU     H'0006'
 
259
ACKDT                        EQU     H'0005'
 
260
ACKEN                        EQU     H'0004'
 
261
RCEN                         EQU     H'0003'
 
262
PEN                          EQU     H'0002'
 
263
RSEN                         EQU     H'0001'   
 
264
SEN                          EQU     H'0000'   
 
265
 
 
266
;----- SSPSTAT Bits -------------------------------------------------------
 
267
 
 
268
SMP                          EQU     H'0007'
 
269
CKE                          EQU     H'0006'
 
270
D                            EQU     H'0005'
 
271
I2C_DATA                     EQU     H'0005'
 
272
NOT_A                        EQU     H'0005'
 
273
NOT_ADDRESS                  EQU     H'0005'
 
274
D_A                          EQU     H'0005'
 
275
DATA_ADDRESS                 EQU     H'0005'
 
276
P                            EQU     H'0004'
 
277
I2C_STOP                     EQU     H'0004'
 
278
S                            EQU     H'0003'
 
279
I2C_START                    EQU     H'0003'
 
280
R                            EQU     H'0002'
 
281
I2C_READ                     EQU     H'0002'
 
282
NOT_W                        EQU     H'0002'
 
283
NOT_WRITE                    EQU     H'0002'
 
284
R_W                          EQU     H'0002'
 
285
READ_WRITE                   EQU     H'0002'
 
286
UA                           EQU     H'0001'
 
287
BF                           EQU     H'0000'
 
288
 
 
289
;----- TXSTA Bits ---------------------------------------------------------
 
290
 
 
291
CSRC                         EQU     H'0007'
 
292
TX9                          EQU     H'0006'
 
293
NOT_TX8                      EQU     H'0006'    ; Backward compatibility only
 
294
TX8_9                        EQU     H'0006'    ; Backward compatibility only
 
295
TXEN                         EQU     H'0005'
 
296
SYNC                         EQU     H'0004'
 
297
BRGH                         EQU     H'0002'
 
298
TRMT                         EQU     H'0001'
 
299
TX9D                         EQU     H'0000'
 
300
TXD8                         EQU     H'0000'    ; Backward compatibility only
 
301
 
 
302
;----- ADCON1 Bits --------------------------------------------------------
 
303
 
 
304
ADFM                         EQU     H'0007'
 
305
PCFG3                        EQU     H'0003'
 
306
PCFG2                        EQU     H'0002'
 
307
PCFG1                        EQU     H'0001'
 
308
PCFG0                        EQU     H'0000'
 
309
 
 
310
;----- EECON1 Bits --------------------------------------------------------
 
311
 
 
312
EEPGD                        EQU     H'0007'
 
313
WRERR                        EQU     H'0003'
 
314
WREN                         EQU     H'0002'
 
315
WR                           EQU     H'0001'
 
316
RD                           EQU     H'0000'
 
317
 
 
318
;==========================================================================
 
319
;
 
320
;       RAM Definition
 
321
;
 
322
;==========================================================================
 
323
 
 
324
        __MAXRAM H'1FF'
 
325
          __BADRAM H'08'-H'09'
 
326
        __BADRAM H'88'-H'89', H'8F'-H'90', H'95'-H'97', H'9A'-H'9D'
 
327
        __BADRAM H'105', H'107'-H'109'
 
328
        __BADRAM H'185', H'187'-H'189', H'18E'-H'18F'
 
329
 
 
330
;==========================================================================
 
331
;
 
332
;       Configuration Bits
 
333
;
 
334
;==========================================================================
 
335
 
 
336
_CP_ALL                      EQU     H'0FCF'
 
337
_CP_HALF                     EQU     H'1FDF'
 
338
_CP_UPPER_256                EQU     H'2FEF'
 
339
_CP_OFF                      EQU     H'3FFF'
 
340
_DEBUG_ON                    EQU     H'37FF'
 
341
_DEBUG_OFF                   EQU     H'3FFF'
 
342
_WRT_ENABLE_ON               EQU     H'3FFF'
 
343
_WRT_ENABLE_OFF              EQU     H'3DFF'
 
344
_CPD_ON                      EQU     H'3EFF'
 
345
_CPD_OFF                     EQU     H'3FFF'
 
346
_LVP_ON                      EQU     H'3FFF'
 
347
_LVP_OFF                     EQU     H'3F7F'
 
348
_BODEN_ON                    EQU     H'3FFF'
 
349
_BODEN_OFF                   EQU     H'3FBF'
 
350
_PWRTE_OFF                   EQU     H'3FFF'
 
351
_PWRTE_ON                    EQU     H'3FF7'
 
352
_WDT_ON                      EQU     H'3FFF'
 
353
_WDT_OFF                     EQU     H'3FFB'
 
354
_LP_OSC                      EQU     H'3FFC'
 
355
_XT_OSC                      EQU     H'3FFD'
 
356
_HS_OSC                      EQU     H'3FFE'
 
357
_RC_OSC                      EQU     H'3FFF'
 
358
 
 
359
        LIST