PIC18 LaurTec Library
3.3.1
Open Source C Library for PIC18 Microcontrollers based on C18 - XC8 Compilers
Main Page
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
PIC18F4431_config.h
Go to the documentation of this file.
1
/*******************************************************************************
2
3
Author : Mauro Laurenti
4
Version : 1.0
5
Created on Date : 02/02/2013
6
Last update : 02/02/2013
7
8
CopyRight 2006-2013 all rights are reserved
9
10
********************************************************
11
SOFTWARE LICENSE AGREEMENT
12
********************************************************
13
14
The usage of the supplied software imply the acceptance of the following license.
15
16
The software supplied herewith by Mauro Laurenti (the Author) is intended for
17
use solely and exclusively on Microchip PIC Microcontroller (registered mark).
18
The software is owned by the Author, and is protected under applicable
19
copyright laws. All rights are reserved.
20
Any use in violation of the foregoing restrictions may subject the
21
user to criminal sanctions under applicable laws, as well as to civil liability
22
for the breach of the terms and conditions of this license.
23
Commercial use is forbidden without a written acknowledgement with the Author.
24
Personal or educational use is allowed if the application containing the
25
following software doesn't aim to commercial use or monetary earning of any kind.
26
27
THIS SOFTWARE IS PROVIDED IN AN "AS IS" CONDITION. NO WARRANTIES,
28
WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED
29
TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
30
PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. THE AUTHOR SHALL NOT,
31
IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL OR
32
CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
33
34
35
********************************************************
36
PURPOSES
37
********************************************************
38
39
This file contains all the configuration words needed for the PIC18F4431.
40
It can be easily adapted to other PICs according to the available configurations.
41
42
****** WARNING ******
43
44
The configurations must be changed to reflect the application needs!
45
46
*****************************************************************************/
47
48
49
#ifndef PIC18F4431_CONFIG_H
50
#define PIC18F4431_CONFIG_H
51
52
#ifdef __XC8
53
#include <xc.h>
54
#endif
55
56
57
//******************************************************************************
58
// Register: CONFIG1H @ 0x300001
59
//******************************************************************************
60
61
//Internal External Oscillator Switchover bit
62
//OFF Internal External Switchover mode disabled
63
//ON Internal External Switchover mode enabled
64
#pragma config IESO = OFF
65
66
//Oscillator Selection bits
67
//RC 11XX External RC oscillator, CLKO function on RA6
68
//RC1 101X External RC oscillator, CLKO function on RA6
69
//IRCIO Internal oscillator block, port function on RA6 and port function on RA7
70
//RCIO External RC oscillator, port function on RA6
71
//RC2 External RC oscillator, CLKO function on RA6
72
//XT XT oscillator
73
//LP LP oscillator
74
//IRC Internal oscillator block, CLKO function on RA6 and port function on RA7
75
//HSPLL HS oscillator, PLL enabled (clock frequency = 4 x FOSC1)
76
//ECIO EC oscillator, port function on RA6
77
//EC EC oscillator, CLKO function on RA6
78
//HS HS oscillator
79
#pragma config OSC = HSPLL
80
81
//Fail-Safe Clock Monitor Enable bit
82
//OFF Fail-Safe Clock Monitor disabled
83
//ON Fail-Safe Clock Monitor enabled
84
#pragma config FCMEN = OFF
85
86
//******************************************************************************
87
// Register: CONFIG2L @ 0x300002
88
//******************************************************************************
89
90
//Brown-out Reset Enable bits
91
//OFF Brown-out Reset disabled
92
//ON Brown-out Reset enabled
93
#pragma config BOREN = OFF
94
95
//Brown Out Reset Voltage bits
96
//42 VBOR set to 4.2V
97
//27 VBOR set to 2.7V
98
//45 VBOR set to 4.5V
99
#pragma config BORV = 42
100
101
//Power-up Timer Enable bit
102
//OFF PWRT disabled
103
//ON PWRT enabled
104
#pragma config PWRTEN = OFF
105
106
107
//******************************************************************************
108
// Register: CONFIG2H @ 0x300003
109
//******************************************************************************
110
111
//Watchdog Timer Postscale Select bits
112
//8 1:8
113
//1 1:1
114
//32768 1:32768
115
//1024 1:1024
116
//2 1:2
117
//32 1:32
118
//16 1:16
119
//16384 1:16384
120
//128 1:128
121
//4096 1:4096
122
//64 1:64
123
//8192 1:8192
124
//2048 1:2048
125
//512 1:512
126
//256 1:256
127
//4 1:4
128
#pragma config WDPS = 1
129
130
//Watchdog Timer Enable bit
131
//OFF WDT disabled (control is placed on the SWDTEN bit)
132
//ON WDT enabled
133
//WINEN = Watchdog Timer Window Enable bit
134
//OFF WDT window disabled
135
//ON WDT window enabledbled
136
#pragma config WDTEN = OFF
137
138
139
//******************************************************************************
140
// Register: CONFIG3L @ 0x300004
141
//******************************************************************************
142
143
//Timer1 Oscillator MUX
144
//OFF Standard (legacy) Timer1 oscillator operation
145
//ON Low-power Timer1 operation when microcontroller is in Sleep mode
146
#pragma config T1OSCMX = OFF
147
148
//PWM output pins Reset state control
149
//OFF PWM outputs disabled upon Reset (default)
150
//ON PWM outputs drive active states upon Reset
151
#pragma config PWMPIN = OFF
152
153
//High-Side Transistors Polarity
154
//HIGH PWM1, 3, 5 and 7 are active-high
155
//LOW PWM1, 3, 5 and 7 are active-low
156
#pragma config HPOL = HIGH
157
158
//Low-Side Transistors Polarity
159
//HIGH PWM0, 2, 4 and 6 are active-high
160
//LOW PWM0, 2, 4 and 6 are active-low
161
#pragma config LPOL = HIGH
162
163
164
//******************************************************************************
165
// Register: CONFIG3H @ 0x300005
166
//******************************************************************************
167
168
//FLTA MUX bit
169
//RC1 FLTA input is multiplexed with RC1
170
//RD4 FLTA input is multiplexed with RD4
171
#pragma config FLTAMX = RD4
172
173
//MCLR Pin Enable bit
174
//OFF Disabled
175
//ON Enabled
176
#pragma config MCLRE = ON
177
178
//PWM4 MUX bit
179
//RB5 PWM4 output is multiplexed with RB5
180
//RD5 PWM4 output is multiplexed with RD5
181
#pragma config PWM4MX = RB5
182
183
//SSP I/O MUX bit
184
//RD1 SCK/SCL clocks and SDA/SDI data are multiplexed with RD3 and RD2, respectively. SDO output is multiplexed with RD1.
185
//RC7 SCK/SCL clocks and SDA/SDI data are multiplexed with RC5 and RC4, respectively. SDO output is multiplexed with RC7.
186
#pragma config SSPMX = RD1
187
188
//TMR0/T5CKI External clock MUX bit
189
//RD0 TMR0/T5CKI external clock input is multiplexed with RD0
190
//RC3 TMR0/T5CKI external clock input is multiplexed with RC3
191
#pragma config EXCLKMX = RD0
192
193
194
//******************************************************************************
195
// Register: CONFIG4L @ 0x300006
196
//******************************************************************************
197
198
//Background Debugger Enable bit
199
//OFF Background debugger disabled; RB6 and RB7 configured as general purpose I/O pins
200
//ON Background debugger enabled; RB6 and RB7 are dedicated to In-Circuit Debug
201
#pragma config DEBUG = OFF
202
203
//Stack Full/Underflow Reset Enable bit
204
//OFF Stack full/underflow will not cause Reset
205
//ON Stack full/underflow will cause Reset
206
#pragma config STVREN = ON
207
208
//Low-Voltage ICSP Enable bit
209
//OFF Low-voltage ICSP disabled
210
//ON Low-voltage ICSP enabled
211
#pragma config LVP = OFF
212
213
214
//******************************************************************************
215
// Register: CONFIG5L @ 0x300008
216
//******************************************************************************
217
218
//Code Protection bit
219
//OFF Block 0 (000200-000FFFh) not code-protected
220
//ON Block 0 (000200-000FFFh) code-protected
221
#pragma config CP0 = OFF
222
223
//Code Protection bit
224
//OFF Block 1 (001000-001FFF) not code-protected
225
//ON Block 1 (001000-001FFF) code-protected
226
#pragma config CP1 = OFF
227
228
//Code Protection bit
229
//OFF Block 2 (002000-002FFFh) not code-protected
230
//ON Block 2 (002000-002FFFh) code-protected
231
#pragma config CP2 = OFF
232
233
//Code Protection bit
234
//OFF Block 3 (003000-003FFFh) not code-protected
235
//ON Block 3 (003000-003FFFh) code-protected
236
#pragma config CP3 = OFF
237
238
239
//******************************************************************************
240
// Register: CONFIG5H @ 0x300009
241
//******************************************************************************
242
243
//Data EEPROM Code Protection bit
244
//OFF Data EEPROM not code-protected
245
//ON Data EEPROM code-protected
246
#pragma config CPD = OFF
247
248
//Boot Block Code Protection bit
249
//OFF Boot Block (000000-0001FFh) not code-protected
250
//ON Boot Block (000000-0001FFh) code-protected
251
#pragma config CPB = OFF
252
253
254
//******************************************************************************
255
// Register: CONFIG6L @ 0x30000A
256
//******************************************************************************
257
258
//Write Protection bit
259
//OFF Block 0 (000200-000FFFh) not write-protected
260
//ON Block 0 (000200-000FFFh) write-protected
261
#pragma config WRT0 = OFF
262
263
//Write Protection bit
264
//OFF Block 1 (001000-001FFF) not write-protected
265
//ON Block 1 (001000-001FFF) write-protected
266
#pragma config WRT1 = OFF
267
268
//Write Protection bit
269
//OFF Block 2 (002000-002FFFh) not write-protected
270
//ON Block 2 (002000-002FFFh) write-protected
271
#pragma config WRT2 = OFF
272
273
//Write Protection bit
274
//OFF Block 3 (003000-003FFFh) not write-protected
275
//ON Block 3 (003000-003FFFh) write-protected
276
#pragma config WRT3 = OFF
277
278
279
//******************************************************************************
280
// Register: CONFIG6H @ 0x30000B
281
//******************************************************************************
282
283
//Boot Block Write Protection bit
284
//OFF Boot Block (000000-0001FFh) not write-protected
285
//ON Boot Block (000000-0001FFh) write-protected
286
#pragma config WRTB = OFF
287
288
//Configuration Register Write Protection bit
289
//OFF Configuration registers (300000-3000FFh) not write-protected
290
//ON Configuration registers (300000-3000FFh) write-protected
291
#pragma config WRTC = OFF
292
293
//Data EEPROM Write Protection bit
294
//OFF Data EEPROM not write-protected
295
//ON Data EEPROM write-protected
296
#pragma config WRTD = OFF
297
298
299
//******************************************************************************
300
// Register: CONFIG7L @ 0x30000C
301
//******************************************************************************
302
303
//Table Read Protection bit
304
//OFF Block 0 (000200-000FFFh) not protected from table reads executed in other blocks
305
//ON Block 0 (000200-000FFFh) protected from table reads executed in other blocks
306
#pragma config EBTR0 = OFF
307
308
//Table Read Protection bit
309
//OFF Block 1 (001000-001FFF) not protected from table reads executed in other blocks
310
//ON Block 1 (001000-001FFF) protected from table reads executed in other blocks
311
#pragma config EBTR1 = OFF
312
313
//Table Read Protection bit
314
//OFF Block 2 (002000-002FFFh) not protected from table reads executed in other blocks
315
//ON Block 2 (002000-002FFFh) protected from table reads executed in other blocks
316
#pragma config EBTR2 = OFF
317
318
//Table Read Protection bit
319
//OFF Block 3 (003000-003FFFh) not protected from table reads executed in other blocks
320
//ON Block 3 (003000-003FFFh) protected from table reads executed in other blocks
321
#pragma config EBTR3 = OFF
322
323
324
//******************************************************************************
325
// Register: CONFIG7H @ 0x30000D
326
//******************************************************************************
327
328
//Boot Block Table Read Protection bit
329
//OFF Boot Block (000000-0001FFh) not protected from table reads executed in other blocks
330
//ON Boot Block (000000-0001FFh) not protected from table reads executed in other blocks
331
#pragma config EBTRB = OFF
332
333
334
#endif
LaurTec_PIC_libraries_v_3.3.1
conf
PIC18F4431_config.h
Generated on Mon Jan 25 2016 20:51:56 for PIC18 LaurTec Library by
1.8.3.1