2 * This definitions of the PIC16F1509 MCU.
4 * This file is part of the GNU PIC library for SDCC, originally
5 * created by Molnar Karoly <molnarkaroly@users.sf.net> 2016.
7 * This file is generated automatically by the cinc2h.pl, 2016-04-13 17:23:06 UTC.
9 * SDCC is licensed under the GNU Public license (GPL) v2. Note that
10 * this license covers the code to the compiler and other executables,
11 * but explicitly does not cover any code or objects generated by sdcc.
13 * For pic device libraries and header files which are derived from
14 * Microchip header (.inc) and linker script (.lkr) files Microchip
15 * requires that "The header files should state that they are only to be
16 * used with authentic Microchip devices" which makes them incompatible
17 * with the GPL. Pic device libraries and header files are located at
18 * non-free/lib and non-free/include directories respectively.
19 * Sdcc should be run with the --use-non-free command line option in
20 * order to include non-free header files and libraries.
22 * See http://sdcc.sourceforge.net/ for the latest information on sdcc.
25 #include <pic16f1509.h>
27 //==============================================================================
29 __at(0x0000) __sfr INDF0
;
31 __at(0x0001) __sfr INDF1
;
33 __at(0x0002) __sfr PCL
;
35 __at(0x0003) __sfr STATUS
;
36 __at(0x0003) volatile __STATUSbits_t STATUSbits
;
38 __at(0x0004) __sfr FSR0
;
40 __at(0x0004) __sfr FSR0L
;
42 __at(0x0005) __sfr FSR0H
;
44 __at(0x0006) __sfr FSR1
;
46 __at(0x0006) __sfr FSR1L
;
48 __at(0x0007) __sfr FSR1H
;
50 __at(0x0008) __sfr BSR
;
51 __at(0x0008) volatile __BSRbits_t BSRbits
;
53 __at(0x0009) __sfr WREG
;
55 __at(0x000A) __sfr PCLATH
;
57 __at(0x000B) __sfr INTCON
;
58 __at(0x000B) volatile __INTCONbits_t INTCONbits
;
60 __at(0x000C) __sfr PORTA
;
61 __at(0x000C) volatile __PORTAbits_t PORTAbits
;
63 __at(0x000D) __sfr PORTB
;
64 __at(0x000D) volatile __PORTBbits_t PORTBbits
;
66 __at(0x000E) __sfr PORTC
;
67 __at(0x000E) volatile __PORTCbits_t PORTCbits
;
69 __at(0x0011) __sfr PIR1
;
70 __at(0x0011) volatile __PIR1bits_t PIR1bits
;
72 __at(0x0012) __sfr PIR2
;
73 __at(0x0012) volatile __PIR2bits_t PIR2bits
;
75 __at(0x0013) __sfr PIR3
;
76 __at(0x0013) volatile __PIR3bits_t PIR3bits
;
78 __at(0x0015) __sfr TMR0
;
80 __at(0x0016) __sfr TMR1
;
82 __at(0x0016) __sfr TMR1L
;
84 __at(0x0017) __sfr TMR1H
;
86 __at(0x0018) __sfr T1CON
;
87 __at(0x0018) volatile __T1CONbits_t T1CONbits
;
89 __at(0x0019) __sfr T1GCON
;
90 __at(0x0019) volatile __T1GCONbits_t T1GCONbits
;
92 __at(0x001A) __sfr TMR2
;
94 __at(0x001B) __sfr PR2
;
96 __at(0x001C) __sfr T2CON
;
97 __at(0x001C) volatile __T2CONbits_t T2CONbits
;
99 __at(0x008C) __sfr TRISA
;
100 __at(0x008C) volatile __TRISAbits_t TRISAbits
;
102 __at(0x008D) __sfr TRISB
;
103 __at(0x008D) volatile __TRISBbits_t TRISBbits
;
105 __at(0x008E) __sfr TRISC
;
106 __at(0x008E) volatile __TRISCbits_t TRISCbits
;
108 __at(0x0091) __sfr PIE1
;
109 __at(0x0091) volatile __PIE1bits_t PIE1bits
;
111 __at(0x0092) __sfr PIE2
;
112 __at(0x0092) volatile __PIE2bits_t PIE2bits
;
114 __at(0x0093) __sfr PIE3
;
115 __at(0x0093) volatile __PIE3bits_t PIE3bits
;
117 __at(0x0095) __sfr OPTION_REG
;
118 __at(0x0095) volatile __OPTION_REGbits_t OPTION_REGbits
;
120 __at(0x0096) __sfr PCON
;
121 __at(0x0096) volatile __PCONbits_t PCONbits
;
123 __at(0x0097) __sfr WDTCON
;
124 __at(0x0097) volatile __WDTCONbits_t WDTCONbits
;
126 __at(0x0099) __sfr OSCCON
;
127 __at(0x0099) volatile __OSCCONbits_t OSCCONbits
;
129 __at(0x009A) __sfr OSCSTAT
;
130 __at(0x009A) volatile __OSCSTATbits_t OSCSTATbits
;
132 __at(0x009B) __sfr ADRES
;
134 __at(0x009B) __sfr ADRESL
;
136 __at(0x009C) __sfr ADRESH
;
138 __at(0x009D) __sfr ADCON0
;
139 __at(0x009D) volatile __ADCON0bits_t ADCON0bits
;
141 __at(0x009E) __sfr ADCON1
;
142 __at(0x009E) volatile __ADCON1bits_t ADCON1bits
;
144 __at(0x009F) __sfr ADCON2
;
145 __at(0x009F) volatile __ADCON2bits_t ADCON2bits
;
147 __at(0x010C) __sfr LATA
;
148 __at(0x010C) volatile __LATAbits_t LATAbits
;
150 __at(0x010D) __sfr LATB
;
151 __at(0x010D) volatile __LATBbits_t LATBbits
;
153 __at(0x010E) __sfr LATC
;
154 __at(0x010E) volatile __LATCbits_t LATCbits
;
156 __at(0x0111) __sfr CM1CON0
;
157 __at(0x0111) volatile __CM1CON0bits_t CM1CON0bits
;
159 __at(0x0112) __sfr CM1CON1
;
160 __at(0x0112) volatile __CM1CON1bits_t CM1CON1bits
;
162 __at(0x0113) __sfr CM2CON0
;
163 __at(0x0113) volatile __CM2CON0bits_t CM2CON0bits
;
165 __at(0x0114) __sfr CM2CON1
;
166 __at(0x0114) volatile __CM2CON1bits_t CM2CON1bits
;
168 __at(0x0115) __sfr CMOUT
;
169 __at(0x0115) volatile __CMOUTbits_t CMOUTbits
;
171 __at(0x0116) __sfr BORCON
;
172 __at(0x0116) volatile __BORCONbits_t BORCONbits
;
174 __at(0x0117) __sfr FVRCON
;
175 __at(0x0117) volatile __FVRCONbits_t FVRCONbits
;
177 __at(0x0118) __sfr DACCON0
;
178 __at(0x0118) volatile __DACCON0bits_t DACCON0bits
;
180 __at(0x0119) __sfr DACCON1
;
181 __at(0x0119) volatile __DACCON1bits_t DACCON1bits
;
183 __at(0x011D) __sfr APFCON
;
184 __at(0x011D) volatile __APFCONbits_t APFCONbits
;
186 __at(0x018C) __sfr ANSELA
;
187 __at(0x018C) volatile __ANSELAbits_t ANSELAbits
;
189 __at(0x018D) __sfr ANSELB
;
190 __at(0x018D) volatile __ANSELBbits_t ANSELBbits
;
192 __at(0x018E) __sfr ANSELC
;
193 __at(0x018E) volatile __ANSELCbits_t ANSELCbits
;
195 __at(0x0191) __sfr PMADR
;
197 __at(0x0191) __sfr PMADRL
;
199 __at(0x0192) __sfr PMADRH
;
201 __at(0x0193) __sfr PMDAT
;
203 __at(0x0193) __sfr PMDATL
;
205 __at(0x0194) __sfr PMDATH
;
207 __at(0x0195) __sfr PMCON1
;
208 __at(0x0195) volatile __PMCON1bits_t PMCON1bits
;
210 __at(0x0196) __sfr PMCON2
;
212 __at(0x0197) __sfr VREGCON
;
213 __at(0x0197) volatile __VREGCONbits_t VREGCONbits
;
215 __at(0x0199) __sfr RCREG
;
217 __at(0x019A) __sfr TXREG
;
219 __at(0x019B) __sfr SPBRG
;
221 __at(0x019B) __sfr SPBRGL
;
223 __at(0x019C) __sfr SPBRGH
;
225 __at(0x019D) __sfr RCSTA
;
226 __at(0x019D) volatile __RCSTAbits_t RCSTAbits
;
228 __at(0x019E) __sfr TXSTA
;
229 __at(0x019E) volatile __TXSTAbits_t TXSTAbits
;
231 __at(0x019F) __sfr BAUDCON
;
232 __at(0x019F) volatile __BAUDCONbits_t BAUDCONbits
;
234 __at(0x020C) __sfr WPUA
;
235 __at(0x020C) volatile __WPUAbits_t WPUAbits
;
237 __at(0x020D) __sfr WPUB
;
238 __at(0x020D) volatile __WPUBbits_t WPUBbits
;
240 __at(0x0211) __sfr SSP1BUF
;
242 __at(0x0211) __sfr SSPBUF
;
244 __at(0x0212) __sfr SSP1ADD
;
246 __at(0x0212) __sfr SSPADD
;
248 __at(0x0213) __sfr SSP1MSK
;
250 __at(0x0213) __sfr SSPMSK
;
252 __at(0x0214) __sfr SSP1STAT
;
253 __at(0x0214) volatile __SSP1STATbits_t SSP1STATbits
;
255 __at(0x0214) __sfr SSPSTAT
;
256 __at(0x0214) volatile __SSPSTATbits_t SSPSTATbits
;
258 __at(0x0215) __sfr SSP1CON1
;
259 __at(0x0215) volatile __SSP1CON1bits_t SSP1CON1bits
;
261 __at(0x0215) __sfr SSPCON
;
262 __at(0x0215) volatile __SSPCONbits_t SSPCONbits
;
264 __at(0x0215) __sfr SSPCON1
;
265 __at(0x0215) volatile __SSPCON1bits_t SSPCON1bits
;
267 __at(0x0216) __sfr SSP1CON2
;
268 __at(0x0216) volatile __SSP1CON2bits_t SSP1CON2bits
;
270 __at(0x0216) __sfr SSPCON2
;
271 __at(0x0216) volatile __SSPCON2bits_t SSPCON2bits
;
273 __at(0x0217) __sfr SSP1CON3
;
274 __at(0x0217) volatile __SSP1CON3bits_t SSP1CON3bits
;
276 __at(0x0217) __sfr SSPCON3
;
277 __at(0x0217) volatile __SSPCON3bits_t SSPCON3bits
;
279 __at(0x0391) __sfr IOCAP
;
280 __at(0x0391) volatile __IOCAPbits_t IOCAPbits
;
282 __at(0x0392) __sfr IOCAN
;
283 __at(0x0392) volatile __IOCANbits_t IOCANbits
;
285 __at(0x0393) __sfr IOCAF
;
286 __at(0x0393) volatile __IOCAFbits_t IOCAFbits
;
288 __at(0x0394) __sfr IOCBP
;
289 __at(0x0394) volatile __IOCBPbits_t IOCBPbits
;
291 __at(0x0395) __sfr IOCBN
;
292 __at(0x0395) volatile __IOCBNbits_t IOCBNbits
;
294 __at(0x0396) __sfr IOCBF
;
295 __at(0x0396) volatile __IOCBFbits_t IOCBFbits
;
297 __at(0x0498) __sfr NCO1ACC
;
299 __at(0x0498) __sfr NCO1ACCL
;
300 __at(0x0498) volatile __NCO1ACCLbits_t NCO1ACCLbits
;
302 __at(0x0499) __sfr NCO1ACCH
;
303 __at(0x0499) volatile __NCO1ACCHbits_t NCO1ACCHbits
;
305 __at(0x049A) __sfr NCO1ACCU
;
306 __at(0x049A) volatile __NCO1ACCUbits_t NCO1ACCUbits
;
308 __at(0x049B) __sfr NCO1INC
;
310 __at(0x049B) __sfr NCO1INCL
;
311 __at(0x049B) volatile __NCO1INCLbits_t NCO1INCLbits
;
313 __at(0x049C) __sfr NCO1INCH
;
314 __at(0x049C) volatile __NCO1INCHbits_t NCO1INCHbits
;
316 __at(0x049D) __sfr NCO1INCU
;
318 __at(0x049E) __sfr NCO1CON
;
319 __at(0x049E) volatile __NCO1CONbits_t NCO1CONbits
;
321 __at(0x049F) __sfr NCO1CLK
;
322 __at(0x049F) volatile __NCO1CLKbits_t NCO1CLKbits
;
324 __at(0x0611) __sfr PWM1DCL
;
325 __at(0x0611) volatile __PWM1DCLbits_t PWM1DCLbits
;
327 __at(0x0612) __sfr PWM1DCH
;
328 __at(0x0612) volatile __PWM1DCHbits_t PWM1DCHbits
;
330 __at(0x0613) __sfr PWM1CON
;
331 __at(0x0613) volatile __PWM1CONbits_t PWM1CONbits
;
333 __at(0x0613) __sfr PWM1CON0
;
334 __at(0x0613) volatile __PWM1CON0bits_t PWM1CON0bits
;
336 __at(0x0614) __sfr PWM2DCL
;
337 __at(0x0614) volatile __PWM2DCLbits_t PWM2DCLbits
;
339 __at(0x0615) __sfr PWM2DCH
;
340 __at(0x0615) volatile __PWM2DCHbits_t PWM2DCHbits
;
342 __at(0x0616) __sfr PWM2CON
;
343 __at(0x0616) volatile __PWM2CONbits_t PWM2CONbits
;
345 __at(0x0616) __sfr PWM2CON0
;
346 __at(0x0616) volatile __PWM2CON0bits_t PWM2CON0bits
;
348 __at(0x0617) __sfr PWM3DCL
;
349 __at(0x0617) volatile __PWM3DCLbits_t PWM3DCLbits
;
351 __at(0x0618) __sfr PWM3DCH
;
352 __at(0x0618) volatile __PWM3DCHbits_t PWM3DCHbits
;
354 __at(0x0619) __sfr PWM3CON
;
355 __at(0x0619) volatile __PWM3CONbits_t PWM3CONbits
;
357 __at(0x0619) __sfr PWM3CON0
;
358 __at(0x0619) volatile __PWM3CON0bits_t PWM3CON0bits
;
360 __at(0x061A) __sfr PWM4DCL
;
361 __at(0x061A) volatile __PWM4DCLbits_t PWM4DCLbits
;
363 __at(0x061B) __sfr PWM4DCH
;
364 __at(0x061B) volatile __PWM4DCHbits_t PWM4DCHbits
;
366 __at(0x061C) __sfr PWM4CON
;
367 __at(0x061C) volatile __PWM4CONbits_t PWM4CONbits
;
369 __at(0x061C) __sfr PWM4CON0
;
370 __at(0x061C) volatile __PWM4CON0bits_t PWM4CON0bits
;
372 __at(0x0691) __sfr CWG1DBR
;
373 __at(0x0691) volatile __CWG1DBRbits_t CWG1DBRbits
;
375 __at(0x0692) __sfr CWG1DBF
;
376 __at(0x0692) volatile __CWG1DBFbits_t CWG1DBFbits
;
378 __at(0x0693) __sfr CWG1CON0
;
379 __at(0x0693) volatile __CWG1CON0bits_t CWG1CON0bits
;
381 __at(0x0694) __sfr CWG1CON1
;
382 __at(0x0694) volatile __CWG1CON1bits_t CWG1CON1bits
;
384 __at(0x0695) __sfr CWG1CON2
;
385 __at(0x0695) volatile __CWG1CON2bits_t CWG1CON2bits
;
387 __at(0x0F0F) __sfr CLCDATA
;
388 __at(0x0F0F) volatile __CLCDATAbits_t CLCDATAbits
;
390 __at(0x0F10) __sfr CLC1CON
;
391 __at(0x0F10) volatile __CLC1CONbits_t CLC1CONbits
;
393 __at(0x0F11) __sfr CLC1POL
;
394 __at(0x0F11) volatile __CLC1POLbits_t CLC1POLbits
;
396 __at(0x0F12) __sfr CLC1SEL0
;
397 __at(0x0F12) volatile __CLC1SEL0bits_t CLC1SEL0bits
;
399 __at(0x0F13) __sfr CLC1SEL1
;
400 __at(0x0F13) volatile __CLC1SEL1bits_t CLC1SEL1bits
;
402 __at(0x0F14) __sfr CLC1GLS0
;
403 __at(0x0F14) volatile __CLC1GLS0bits_t CLC1GLS0bits
;
405 __at(0x0F15) __sfr CLC1GLS1
;
406 __at(0x0F15) volatile __CLC1GLS1bits_t CLC1GLS1bits
;
408 __at(0x0F16) __sfr CLC1GLS2
;
409 __at(0x0F16) volatile __CLC1GLS2bits_t CLC1GLS2bits
;
411 __at(0x0F17) __sfr CLC1GLS3
;
412 __at(0x0F17) volatile __CLC1GLS3bits_t CLC1GLS3bits
;
414 __at(0x0F18) __sfr CLC2CON
;
415 __at(0x0F18) volatile __CLC2CONbits_t CLC2CONbits
;
417 __at(0x0F19) __sfr CLC2POL
;
418 __at(0x0F19) volatile __CLC2POLbits_t CLC2POLbits
;
420 __at(0x0F1A) __sfr CLC2SEL0
;
421 __at(0x0F1A) volatile __CLC2SEL0bits_t CLC2SEL0bits
;
423 __at(0x0F1B) __sfr CLC2SEL1
;
424 __at(0x0F1B) volatile __CLC2SEL1bits_t CLC2SEL1bits
;
426 __at(0x0F1C) __sfr CLC2GLS0
;
427 __at(0x0F1C) volatile __CLC2GLS0bits_t CLC2GLS0bits
;
429 __at(0x0F1D) __sfr CLC2GLS1
;
430 __at(0x0F1D) volatile __CLC2GLS1bits_t CLC2GLS1bits
;
432 __at(0x0F1E) __sfr CLC2GLS2
;
433 __at(0x0F1E) volatile __CLC2GLS2bits_t CLC2GLS2bits
;
435 __at(0x0F1F) __sfr CLC2GLS3
;
436 __at(0x0F1F) volatile __CLC2GLS3bits_t CLC2GLS3bits
;
438 __at(0x0F20) __sfr CLC3CON
;
439 __at(0x0F20) volatile __CLC3CONbits_t CLC3CONbits
;
441 __at(0x0F21) __sfr CLC3POL
;
442 __at(0x0F21) volatile __CLC3POLbits_t CLC3POLbits
;
444 __at(0x0F22) __sfr CLC3SEL0
;
445 __at(0x0F22) volatile __CLC3SEL0bits_t CLC3SEL0bits
;
447 __at(0x0F23) __sfr CLC3SEL1
;
448 __at(0x0F23) volatile __CLC3SEL1bits_t CLC3SEL1bits
;
450 __at(0x0F24) __sfr CLC3GLS0
;
451 __at(0x0F24) volatile __CLC3GLS0bits_t CLC3GLS0bits
;
453 __at(0x0F25) __sfr CLC3GLS1
;
454 __at(0x0F25) volatile __CLC3GLS1bits_t CLC3GLS1bits
;
456 __at(0x0F26) __sfr CLC3GLS2
;
457 __at(0x0F26) volatile __CLC3GLS2bits_t CLC3GLS2bits
;
459 __at(0x0F27) __sfr CLC3GLS3
;
460 __at(0x0F27) volatile __CLC3GLS3bits_t CLC3GLS3bits
;
462 __at(0x0F28) __sfr CLC4CON
;
463 __at(0x0F28) volatile __CLC4CONbits_t CLC4CONbits
;
465 __at(0x0F29) __sfr CLC4POL
;
466 __at(0x0F29) volatile __CLC4POLbits_t CLC4POLbits
;
468 __at(0x0F2A) __sfr CLC4SEL0
;
469 __at(0x0F2A) volatile __CLC4SEL0bits_t CLC4SEL0bits
;
471 __at(0x0F2B) __sfr CLC4SEL1
;
472 __at(0x0F2B) volatile __CLC4SEL1bits_t CLC4SEL1bits
;
474 __at(0x0F2C) __sfr CLC4GLS0
;
475 __at(0x0F2C) volatile __CLC4GLS0bits_t CLC4GLS0bits
;
477 __at(0x0F2D) __sfr CLC4GLS1
;
478 __at(0x0F2D) volatile __CLC4GLS1bits_t CLC4GLS1bits
;
480 __at(0x0F2E) __sfr CLC4GLS2
;
481 __at(0x0F2E) volatile __CLC4GLS2bits_t CLC4GLS2bits
;
483 __at(0x0F2F) __sfr CLC4GLS3
;
484 __at(0x0F2F) volatile __CLC4GLS3bits_t CLC4GLS3bits
;
486 __at(0x0F8C) __sfr ICDIO
;
487 __at(0x0F8C) volatile __ICDIObits_t ICDIObits
;
489 __at(0x0F8D) __sfr ICDCON0
;
490 __at(0x0F8D) volatile __ICDCON0bits_t ICDCON0bits
;
492 __at(0x0F91) __sfr ICDSTAT
;
493 __at(0x0F91) volatile __ICDSTATbits_t ICDSTATbits
;
495 __at(0x0F95) __sfr DEVSEL
;
496 __at(0x0F95) volatile __DEVSELbits_t DEVSELbits
;
498 __at(0x0F96) __sfr ICDINSTL
;
499 __at(0x0F96) volatile __ICDINSTLbits_t ICDINSTLbits
;
501 __at(0x0F97) __sfr ICDINSTH
;
502 __at(0x0F97) volatile __ICDINSTHbits_t ICDINSTHbits
;
504 __at(0x0F9C) __sfr ICDBK0CON
;
505 __at(0x0F9C) volatile __ICDBK0CONbits_t ICDBK0CONbits
;
507 __at(0x0F9D) __sfr ICDBK0L
;
508 __at(0x0F9D) volatile __ICDBK0Lbits_t ICDBK0Lbits
;
510 __at(0x0F9E) __sfr ICDBK0H
;
511 __at(0x0F9E) volatile __ICDBK0Hbits_t ICDBK0Hbits
;
513 __at(0x0FE3) __sfr BSRICDSHAD
;
515 __at(0x0FE4) __sfr STATUS_SHAD
;
516 __at(0x0FE4) volatile __STATUS_SHADbits_t STATUS_SHADbits
;
518 __at(0x0FE5) __sfr WREG_SHAD
;
520 __at(0x0FE6) __sfr BSR_SHAD
;
522 __at(0x0FE7) __sfr PCLATH_SHAD
;
524 __at(0x0FE8) __sfr FSR0L_SHAD
;
526 __at(0x0FE9) __sfr FSR0H_SHAD
;
528 __at(0x0FEA) __sfr FSR1L_SHAD
;
530 __at(0x0FEB) __sfr FSR1H_SHAD
;
532 __at(0x0FED) __sfr STKPTR
;
534 __at(0x0FEE) __sfr TOSL
;
536 __at(0x0FEF) __sfr TOSH
;