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
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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
|
//
// Register Declarations for Microchip 16F873 Processor
//
//
// This header file was automatically generated by:
//
// inc2h.pl V1.5
//
// Copyright (c) 2002, Kevin L. Pauba, All Rights Reserved
//
// SDCC is licensed under the GNU Public license (GPL) v2. Note that
// this license covers the code to the compiler and other executables,
// but explicitly does not cover any code or objects generated by sdcc.
// We have not yet decided on a license for the run time libraries, but
// it will not put any requirements on code linked against it. See:
//
// http://www.gnu.org/copyleft/gpl/html
//
// See http://sdcc.sourceforge.net/ for the latest information on sdcc.
//
//
#ifndef P16F873_H
#define P16F873_H
#define udata udata_shr
#ifndef BIT_AT
#define BIT_AT(base,bitno) sbit at ((base<<3)+bitno)
#endif
//
// Register addresses.
//
#define INDF_ADDR 0x0000
#define TMR0_ADDR 0x0001
#define PCL_ADDR 0x0002
#define STATUS_ADDR 0x0003
#define FSR_ADDR 0x0004
#define PORTA_ADDR 0x0005
#define PORTB_ADDR 0x0006
#define PORTC_ADDR 0x0007
#define PCLATH_ADDR 0x000A
#define INTCON_ADDR 0x000B
#define PIR1_ADDR 0x000C
#define PIR2_ADDR 0x000D
#define TMR1L_ADDR 0x000E
#define TMR1H_ADDR 0x000F
#define T1CON_ADDR 0x0010
#define TMR2_ADDR 0x0011
#define T2CON_ADDR 0x0012
#define SSPBUF_ADDR 0x0013
#define SSPCON_ADDR 0x0014
#define CCPR1L_ADDR 0x0015
#define CCPR1H_ADDR 0x0016
#define CCP1CON_ADDR 0x0017
#define RCSTA_ADDR 0x0018
#define TXREG_ADDR 0x0019
#define RCREG_ADDR 0x001A
#define CCPR2L_ADDR 0x001B
#define CCPR2H_ADDR 0x001C
#define CCP2CON_ADDR 0x001D
#define ADRESH_ADDR 0x001E
#define ADCON0_ADDR 0x001F
#define OPTION_REG_ADDR 0x0081
#define TRISA_ADDR 0x0085
#define TRISB_ADDR 0x0086
#define TRISC_ADDR 0x0087
#define PIE1_ADDR 0x008C
#define PIE2_ADDR 0x008D
#define PCON_ADDR 0x008E
#define SSPCON2_ADDR 0x0091
#define PR2_ADDR 0x0092
#define SSPADD_ADDR 0x0093
#define SSPSTAT_ADDR 0x0094
#define TXSTA_ADDR 0x0098
#define SPBRG_ADDR 0x0099
#define ADRESL_ADDR 0x009E
#define ADCON1_ADDR 0x009F
#define EEDATA_ADDR 0x010C
#define EEADR_ADDR 0x010D
#define EEDATH_ADDR 0x010E
#define EEADRH_ADDR 0x010F
#define EECON1_ADDR 0x018C
#define EECON2_ADDR 0x018D
//
// Memory organization.
//
#pragma maxram 0x1FF
#pragma memmap 0x0020 0x007f RAM 0x100
#pragma memmap 0x00a0 0x00ff RAM 0x100
#pragma memmap INDF_ADDR INDF_ADDR SFR 0x000 // INDF
#pragma memmap TMR0_ADDR TMR0_ADDR SFR 0x000 // TMR0
#pragma memmap PCL_ADDR PCL_ADDR SFR 0x000 // PCL
#pragma memmap STATUS_ADDR STATUS_ADDR SFR 0x000 // STATUS
#pragma memmap FSR_ADDR FSR_ADDR SFR 0x000 // FSR
#pragma memmap PORTA_ADDR PORTA_ADDR SFR 0x000 // PORTA
#pragma memmap PORTB_ADDR PORTB_ADDR SFR 0x000 // PORTB
#pragma memmap PORTC_ADDR PORTC_ADDR SFR 0x000 // PORTC
#pragma memmap PCLATH_ADDR PCLATH_ADDR SFR 0x000 // PCLATH
#pragma memmap INTCON_ADDR INTCON_ADDR SFR 0x000 // INTCON
#pragma memmap PIR1_ADDR PIR1_ADDR SFR 0x000 // PIR1
#pragma memmap PIR2_ADDR PIR2_ADDR SFR 0x000 // PIR2
#pragma memmap TMR1L_ADDR TMR1L_ADDR SFR 0x000 // TMR1L
#pragma memmap TMR1H_ADDR TMR1H_ADDR SFR 0x000 // TMR1H
#pragma memmap T1CON_ADDR T1CON_ADDR SFR 0x000 // T1CON
#pragma memmap TMR2_ADDR TMR2_ADDR SFR 0x000 // TMR2
#pragma memmap T2CON_ADDR T2CON_ADDR SFR 0x000 // T2CON
#pragma memmap SSPBUF_ADDR SSPBUF_ADDR SFR 0x000 // SSPBUF
#pragma memmap SSPCON_ADDR SSPCON_ADDR SFR 0x000 // SSPCON
#pragma memmap CCPR1L_ADDR CCPR1L_ADDR SFR 0x000 // CCPR1L
#pragma memmap CCPR1H_ADDR CCPR1H_ADDR SFR 0x000 // CCPR1H
#pragma memmap CCP1CON_ADDR CCP1CON_ADDR SFR 0x000 // CCP1CON
#pragma memmap RCSTA_ADDR RCSTA_ADDR SFR 0x000 // RCSTA
#pragma memmap TXREG_ADDR TXREG_ADDR SFR 0x000 // TXREG
#pragma memmap RCREG_ADDR RCREG_ADDR SFR 0x000 // RCREG
#pragma memmap CCPR2L_ADDR CCPR2L_ADDR SFR 0x000 // CCPR2L
#pragma memmap CCPR2H_ADDR CCPR2H_ADDR SFR 0x000 // CCPR2H
#pragma memmap CCP2CON_ADDR CCP2CON_ADDR SFR 0x000 // CCP2CON
#pragma memmap ADRESH_ADDR ADRESH_ADDR SFR 0x000 // ADRESH
#pragma memmap ADCON0_ADDR ADCON0_ADDR SFR 0x000 // ADCON0
#pragma memmap OPTION_REG_ADDR OPTION_REG_ADDR SFR 0x000 // OPTION_REG
#pragma memmap TRISA_ADDR TRISA_ADDR SFR 0x000 // TRISA
#pragma memmap TRISB_ADDR TRISB_ADDR SFR 0x000 // TRISB
#pragma memmap TRISC_ADDR TRISC_ADDR SFR 0x000 // TRISC
#pragma memmap PIE1_ADDR PIE1_ADDR SFR 0x000 // PIE1
#pragma memmap PIE2_ADDR PIE2_ADDR SFR 0x000 // PIE2
#pragma memmap PCON_ADDR PCON_ADDR SFR 0x000 // PCON
#pragma memmap SSPCON2_ADDR SSPCON2_ADDR SFR 0x000 // SSPCON2
#pragma memmap PR2_ADDR PR2_ADDR SFR 0x000 // PR2
#pragma memmap SSPADD_ADDR SSPADD_ADDR SFR 0x000 // SSPADD
#pragma memmap SSPSTAT_ADDR SSPSTAT_ADDR SFR 0x000 // SSPSTAT
#pragma memmap TXSTA_ADDR TXSTA_ADDR SFR 0x000 // TXSTA
#pragma memmap SPBRG_ADDR SPBRG_ADDR SFR 0x000 // SPBRG
#pragma memmap ADRESL_ADDR ADRESL_ADDR SFR 0x000 // ADRESL
#pragma memmap ADCON1_ADDR ADCON1_ADDR SFR 0x000 // ADCON1
#pragma memmap EEDATA_ADDR EEDATA_ADDR SFR 0x000 // EEDATA
#pragma memmap EEADR_ADDR EEADR_ADDR SFR 0x000 // EEADR
#pragma memmap EEDATH_ADDR EEDATH_ADDR SFR 0x000 // EEDATH
#pragma memmap EEADRH_ADDR EEADRH_ADDR SFR 0x000 // EEADRH
#pragma memmap EECON1_ADDR EECON1_ADDR SFR 0x000 // EECON1
#pragma memmap EECON2_ADDR EECON2_ADDR SFR 0x000 // EECON2
// LIST
// P16F873.INC Standard Header File, Version 1.00 Microchip Technology, Inc.
// NOLIST
// This header file defines configurations, registers, and other useful bits of
// information for the PIC16F873 microcontroller. These names are taken to match
// the data sheets as closely as possible.
// Note that the processor must be selected before this file is
// included. The processor may be selected the following ways:
// 1. Command line switch:
// C:\ MPASM MYFILE.ASM /PIC16F873
// 2. LIST directive in the source file
// LIST P=PIC16F873
// 3. Processor Type entry in the MPASM full-screen interface
//==========================================================================
//
// Revision History
//
//==========================================================================
//Rev: Date: Reason:
//1.12 01/12/00 Changed some bit names, a register name, configuration bits
// to match datasheet (DS30292B)
//1.11 10/18/98 Changes to file registers to match updated DOS
//1.10 08/17/98 Fixed typo in processor name, RCSTA and ADCON1
//1.00 08/07/98 Initial Release
//==========================================================================
//
// Verify Processor
//
//==========================================================================
// IFNDEF __16F873
// MESSG "Processor-header file mismatch. Verify selected processor."
// ENDIF
//==========================================================================
//
// Register Definitions
//
//==========================================================================
#define W 0x0000
#define F 0x0001
//----- Register Files------------------------------------------------------
data at INDF_ADDR volatile char INDF;
sfr at TMR0_ADDR TMR0;
data at PCL_ADDR volatile char PCL;
sfr at STATUS_ADDR STATUS;
sfr at FSR_ADDR FSR;
sfr at PORTA_ADDR PORTA;
sfr at PORTB_ADDR PORTB;
sfr at PORTC_ADDR PORTC;
sfr at PCLATH_ADDR PCLATH;
sfr at INTCON_ADDR INTCON;
sfr at PIR1_ADDR PIR1;
sfr at PIR2_ADDR PIR2;
sfr at TMR1L_ADDR TMR1L;
sfr at TMR1H_ADDR TMR1H;
sfr at T1CON_ADDR T1CON;
sfr at TMR2_ADDR TMR2;
sfr at T2CON_ADDR T2CON;
sfr at SSPBUF_ADDR SSPBUF;
sfr at SSPCON_ADDR SSPCON;
sfr at CCPR1L_ADDR CCPR1L;
sfr at CCPR1H_ADDR CCPR1H;
sfr at CCP1CON_ADDR CCP1CON;
sfr at RCSTA_ADDR RCSTA;
sfr at TXREG_ADDR TXREG;
sfr at RCREG_ADDR RCREG;
sfr at CCPR2L_ADDR CCPR2L;
sfr at CCPR2H_ADDR CCPR2H;
sfr at CCP2CON_ADDR CCP2CON;
sfr at ADRESH_ADDR ADRESH;
sfr at ADCON0_ADDR ADCON0;
sfr at OPTION_REG_ADDR OPTION_REG;
sfr at TRISA_ADDR TRISA;
sfr at TRISB_ADDR TRISB;
sfr at TRISC_ADDR TRISC;
sfr at PIE1_ADDR PIE1;
sfr at PIE2_ADDR PIE2;
sfr at PCON_ADDR PCON;
sfr at SSPCON2_ADDR SSPCON2;
sfr at PR2_ADDR PR2;
sfr at SSPADD_ADDR SSPADD;
sfr at SSPSTAT_ADDR SSPSTAT;
sfr at TXSTA_ADDR TXSTA;
sfr at SPBRG_ADDR SPBRG;
sfr at ADRESL_ADDR ADRESL;
sfr at ADCON1_ADDR ADCON1;
sfr at EEDATA_ADDR EEDATA;
sfr at EEADR_ADDR EEADR;
sfr at EEDATH_ADDR EEDATH;
sfr at EEADRH_ADDR EEADRH;
sfr at EECON1_ADDR EECON1;
sfr at EECON2_ADDR EECON2;
//----- STATUS Bits --------------------------------------------------------
BIT_AT(STATUS_ADDR,7) IRP;
BIT_AT(STATUS_ADDR,6) RP1;
BIT_AT(STATUS_ADDR,5) RP0;
BIT_AT(STATUS_ADDR,4) NOT_TO;
BIT_AT(STATUS_ADDR,3) NOT_PD;
BIT_AT(STATUS_ADDR,2) Z;
BIT_AT(STATUS_ADDR,1) DC;
BIT_AT(STATUS_ADDR,0) C;
//----- INTCON Bits --------------------------------------------------------
BIT_AT(INTCON_ADDR,7) GIE;
BIT_AT(INTCON_ADDR,6) PEIE;
BIT_AT(INTCON_ADDR,5) T0IE;
BIT_AT(INTCON_ADDR,4) INTE;
BIT_AT(INTCON_ADDR,3) RBIE;
BIT_AT(INTCON_ADDR,2) T0IF;
BIT_AT(INTCON_ADDR,1) INTF;
BIT_AT(INTCON_ADDR,0) RBIF;
//----- PIR1 Bits ----------------------------------------------------------
BIT_AT(PIR1_ADDR,6) ADIF;
BIT_AT(PIR1_ADDR,5) RCIF;
BIT_AT(PIR1_ADDR,4) TXIF;
BIT_AT(PIR1_ADDR,3) SSPIF;
BIT_AT(PIR1_ADDR,2) CCP1IF;
BIT_AT(PIR1_ADDR,1) TMR2IF;
BIT_AT(PIR1_ADDR,0) TMR1IF;
//----- PIR2 Bits ----------------------------------------------------------
BIT_AT(PIR2_ADDR,6) CMIF;
BIT_AT(PIR2_ADDR,4) EEIF;
BIT_AT(PIR2_ADDR,3) BCLIF;
BIT_AT(PIR2_ADDR,0) CCP2IF;
//----- T1CON Bits ---------------------------------------------------------
BIT_AT(T1CON_ADDR,5) T1CKPS1;
BIT_AT(T1CON_ADDR,4) T1CKPS0;
BIT_AT(T1CON_ADDR,3) T1OSCEN;
BIT_AT(T1CON_ADDR,2) NOT_T1SYNC;
BIT_AT(T1CON_ADDR,2) T1INSYNC; // Backward compatibility only
BIT_AT(T1CON_ADDR,2) T1SYNC;
BIT_AT(T1CON_ADDR,1) TMR1CS;
BIT_AT(T1CON_ADDR,0) TMR1ON;
//----- T2CON Bits ---------------------------------------------------------
BIT_AT(T2CON_ADDR,6) TOUTPS3;
BIT_AT(T2CON_ADDR,5) TOUTPS2;
BIT_AT(T2CON_ADDR,4) TOUTPS1;
BIT_AT(T2CON_ADDR,3) TOUTPS0;
BIT_AT(T2CON_ADDR,2) TMR2ON;
BIT_AT(T2CON_ADDR,1) T2CKPS1;
BIT_AT(T2CON_ADDR,0) T2CKPS0;
//----- SSPCON Bits --------------------------------------------------------
BIT_AT(SSPCON_ADDR,7) WCOL;
BIT_AT(SSPCON_ADDR,6) SSPOV;
BIT_AT(SSPCON_ADDR,5) SSPEN;
BIT_AT(SSPCON_ADDR,4) CKP;
BIT_AT(SSPCON_ADDR,3) SSPM3;
BIT_AT(SSPCON_ADDR,2) SSPM2;
BIT_AT(SSPCON_ADDR,1) SSPM1;
BIT_AT(SSPCON_ADDR,0) SSPM0;
//----- CCP1CON Bits -------------------------------------------------------
BIT_AT(CCP1CON_ADDR,5) CCP1X;
BIT_AT(CCP1CON_ADDR,4) CCP1Y;
BIT_AT(CCP1CON_ADDR,3) CCP1M3;
BIT_AT(CCP1CON_ADDR,2) CCP1M2;
BIT_AT(CCP1CON_ADDR,1) CCP1M1;
BIT_AT(CCP1CON_ADDR,0) CCP1M0;
//----- RCSTA Bits ---------------------------------------------------------
BIT_AT(RCSTA_ADDR,7) SPEN;
BIT_AT(RCSTA_ADDR,6) RX9;
BIT_AT(RCSTA_ADDR,6) RC9; // Backward compatibility only
BIT_AT(RCSTA_ADDR,6) NOT_RC8; // Backward compatibility only
BIT_AT(RCSTA_ADDR,6) RC8_9; // Backward compatibility only
BIT_AT(RCSTA_ADDR,5) SREN;
BIT_AT(RCSTA_ADDR,4) CREN;
BIT_AT(RCSTA_ADDR,3) ADDEN;
BIT_AT(RCSTA_ADDR,2) FERR;
BIT_AT(RCSTA_ADDR,1) OERR;
BIT_AT(RCSTA_ADDR,0) RX9D;
BIT_AT(RCSTA_ADDR,0) RCD8; // Backward compatibility only
//----- CCP2CON Bits -------------------------------------------------------
BIT_AT(CCP2CON_ADDR,5) CCP2X;
BIT_AT(CCP2CON_ADDR,4) CCP2Y;
BIT_AT(CCP2CON_ADDR,3) CCP2M3;
BIT_AT(CCP2CON_ADDR,2) CCP2M2;
BIT_AT(CCP2CON_ADDR,1) CCP2M1;
BIT_AT(CCP2CON_ADDR,0) CCP2M0;
//----- ADCON0 Bits --------------------------------------------------------
BIT_AT(ADCON0_ADDR,7) ADCS1;
BIT_AT(ADCON0_ADDR,6) ADCS0;
BIT_AT(ADCON0_ADDR,5) CHS2;
BIT_AT(ADCON0_ADDR,4) CHS1;
BIT_AT(ADCON0_ADDR,3) CHS0;
BIT_AT(ADCON0_ADDR,2) GO;
BIT_AT(ADCON0_ADDR,2) NOT_DONE;
BIT_AT(ADCON0_ADDR,2) GO_DONE;
BIT_AT(ADCON0_ADDR,0) ADON;
//----- OPTION_REG Bits ----------------------------------------------------
BIT_AT(OPTION_REG_ADDR,7) NOT_RBPU;
BIT_AT(OPTION_REG_ADDR,6) INTEDG;
BIT_AT(OPTION_REG_ADDR,5) T0CS;
BIT_AT(OPTION_REG_ADDR,4) T0SE;
BIT_AT(OPTION_REG_ADDR,3) PSA;
BIT_AT(OPTION_REG_ADDR,2) PS2;
BIT_AT(OPTION_REG_ADDR,1) PS1;
BIT_AT(OPTION_REG_ADDR,0) PS0;
//----- PIE1 Bits ----------------------------------------------------------
BIT_AT(PIE1_ADDR,6) ADIE;
BIT_AT(PIE1_ADDR,5) RCIE;
BIT_AT(PIE1_ADDR,4) TXIE;
BIT_AT(PIE1_ADDR,3) SSPIE;
BIT_AT(PIE1_ADDR,2) CCP1IE;
BIT_AT(PIE1_ADDR,1) TMR2IE;
BIT_AT(PIE1_ADDR,0) TMR1IE;
//----- PIE2 Bits ----------------------------------------------------------
BIT_AT(PIE2_ADDR,4) EEIE;
BIT_AT(PIE2_ADDR,3) BCLIE;
BIT_AT(PIE2_ADDR,0) CCP2IE;
//----- PCON Bits ----------------------------------------------------------
BIT_AT(PCON_ADDR,1) NOT_POR;
BIT_AT(PCON_ADDR,0) NOT_BO;
BIT_AT(PCON_ADDR,0) NOT_BOR;
//----- SSPCON2 Bits --------------------------------------------------------
BIT_AT(SSPCON2_ADDR,7) GCEN;
BIT_AT(SSPCON2_ADDR,6) ACKSTAT;
BIT_AT(SSPCON2_ADDR,5) ACKDT;
BIT_AT(SSPCON2_ADDR,4) ACKEN;
BIT_AT(SSPCON2_ADDR,3) RCEN;
BIT_AT(SSPCON2_ADDR,2) PEN;
BIT_AT(SSPCON2_ADDR,1) RSEN;
BIT_AT(SSPCON2_ADDR,0) SEN;
//----- SSPSTAT Bits -------------------------------------------------------
BIT_AT(SSPSTAT_ADDR,7) SMP;
BIT_AT(SSPSTAT_ADDR,6) CKE;
BIT_AT(SSPSTAT_ADDR,5) D;
BIT_AT(SSPSTAT_ADDR,5) I2C_DATA;
BIT_AT(SSPSTAT_ADDR,5) NOT_A;
BIT_AT(SSPSTAT_ADDR,5) NOT_ADDRESS;
BIT_AT(SSPSTAT_ADDR,5) D_A;
BIT_AT(SSPSTAT_ADDR,5) DATA_ADDRESS;
BIT_AT(SSPSTAT_ADDR,4) P;
BIT_AT(SSPSTAT_ADDR,4) I2C_STOP;
BIT_AT(SSPSTAT_ADDR,3) S;
BIT_AT(SSPSTAT_ADDR,3) I2C_START;
BIT_AT(SSPSTAT_ADDR,2) R;
BIT_AT(SSPSTAT_ADDR,2) I2C_READ;
BIT_AT(SSPSTAT_ADDR,2) NOT_W;
BIT_AT(SSPSTAT_ADDR,2) NOT_WRITE;
BIT_AT(SSPSTAT_ADDR,2) R_W;
BIT_AT(SSPSTAT_ADDR,2) READ_WRITE;
BIT_AT(SSPSTAT_ADDR,1) UA;
BIT_AT(SSPSTAT_ADDR,0) BF;
//----- TXSTA Bits ---------------------------------------------------------
BIT_AT(TXSTA_ADDR,7) CSRC;
BIT_AT(TXSTA_ADDR,6) TX9;
BIT_AT(TXSTA_ADDR,6) NOT_TX8; // Backward compatibility only
BIT_AT(TXSTA_ADDR,6) TX8_9; // Backward compatibility only
BIT_AT(TXSTA_ADDR,5) TXEN;
BIT_AT(TXSTA_ADDR,4) SYNC;
BIT_AT(TXSTA_ADDR,2) BRGH;
BIT_AT(TXSTA_ADDR,1) TRMT;
BIT_AT(TXSTA_ADDR,0) TX9D;
BIT_AT(TXSTA_ADDR,0) TXD8; // Backward compatibility only
//----- ADCON1 Bits --------------------------------------------------------
BIT_AT(ADCON1_ADDR,7) ADFM;
BIT_AT(ADCON1_ADDR,3) PCFG3;
BIT_AT(ADCON1_ADDR,2) PCFG2;
BIT_AT(ADCON1_ADDR,1) PCFG1;
BIT_AT(ADCON1_ADDR,0) PCFG0;
//----- EECON1 Bits --------------------------------------------------------
BIT_AT(EECON1_ADDR,7) EEPGD;
BIT_AT(EECON1_ADDR,3) WRERR;
BIT_AT(EECON1_ADDR,2) WREN;
BIT_AT(EECON1_ADDR,1) WR;
BIT_AT(EECON1_ADDR,0) RD;
//==========================================================================
//
// RAM Definition
//
//==========================================================================
// __MAXRAM H'1FF'
// __BADRAM H'8F'-H'90', H'95'-H'97', H'9A'-H'9D'
// __BADRAM H'105', H'107'-H'109', H'110'-H'11F'
// __BADRAM H'185', H'187'-H'189', H'18E'-H'19F'
//==========================================================================
//
// Configuration Bits
//
//==========================================================================
#define _CP_ALL 0x0FCF
#define _CP_HALF 0x1FDF
#define _CP_UPPER_256 0x2FEF
#define _CP_OFF 0x3FFF
#define _DEBUG_ON 0x37FF
#define _DEBUG_OFF 0x3FFF
#define _WRT_ENABLE_ON 0x3FFF
#define _WRT_ENABLE_OFF 0x3DFF
#define _CPD_ON 0x3EFF
#define _CPD_OFF 0x3FFF
#define _LVP_ON 0x3FFF
#define _LVP_OFF 0x3F7F
#define _BODEN_ON 0x3FFF
#define _BODEN_OFF 0x3FBF
#define _PWRTE_OFF 0x3FFF
#define _PWRTE_ON 0x3FF7
#define _WDT_ON 0x3FFF
#define _WDT_OFF 0x3FFB
#define _LP_OSC 0x3FFC
#define _XT_OSC 0x3FFD
#define _HS_OSC 0x3FFE
#define _RC_OSC 0x3FFF
// LIST
#endif
|