Discussion in "PIC Microcontroller Discussion" started by    kingrosekhan123    May 12, 2013.
Sun May 12 2013, 05:32 pm
#1
Hello,
can anyone tell me that how to config PIC18f controller.???

i google it,but not get reasonable answer.its just say search for pic18f458.inc or pic18fxxx.cfg, but i have no idea because it contain too many lines..

http://flashforth.sourceforge.net/p18fxxxx.cfg

as given in link .can anyone tell me that how i config my ocntroller any easy way..

Thanks..
Mon May 13 2013, 05:38 am
#2
It depends what you want to configure.
Most low level bits are set by your complier/assembler or programmer software.
What software are you using ?.
Mon May 13 2013, 10:53 am
#3
I am assuming you're asking about PIC configuration bits? am I right? If yes then in MPLAB (I suppose you're using this) In top navigation panel, go to device -> configure -> configuration bits. Configure your PIC as you like. There is complete information given next to each bit you are going to change.
Mon May 13 2013, 05:47 pm
#4
i am using MPLAB 8.89 and Hitech compiler and XC8. working with PIC18f458.
as i new i dont know about configuration .but i think its important i see in many codes.

like this

__CONFIG(HS & WDTDIS & PWRTDIS & BORDIS & LVPDIS& DUNPROT & WRTEN & DEBUGDIS & UNPROTECT);

but it not for PIC18f458
Mon May 13 2013, 08:54 pm
#5
well names of each config varies from compiler to compiler. in some cases you only have to enter the hex value. In case of MPLAB you can enter both ways (name/hex value). You can setup your configs via configuration bit editor and then store config value in your code. You can even see name of config from config bit window. so its a good tool.
Tue Jul 09 2013, 09:12 am
#6
here the link where you can download the data sheet and several example for that PIC
http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en010301
Thu Jul 11 2013, 10:12 pm
#7
@ kingrosekhan123
these macros vary from compiler to compiler
go to in c drive where the compiler is installed and see the h folder and search the header file of that pic you are using
in header file theses macros are mentioned use that because this may vary compiler version to version
which is infact irritating process that it vary normally in each version

__CONFIG(HS & WDTDIS & PWRTDIS & BORDIS & LVPDIS& DUNPROT & WRTEN & DEBUGDIS & UNPROTECT);



some time WDTDIS is written as WDTOFF
WRTEN as WRTON and so on
 kingrosekhan123 like this.
Sun Sep 22 2013, 10:34 am
#8
For different PIC microcontrollers you have different configuration settings and keywords. IF you are using MPLAB with C18 compiler,
then you can either give configuration settings in the program code ( before main() ) or you can set it under 'Configure' menu.
2 examples for specifying configuration in the program are

#pragma config PLLDIV = 2
#pragma config FOSC = HS
#pragma config PWRT = OFF
#pragma config WDT = OFF
#pragma config DEBUG = OFF,LVP = OFF, STVREN = OFF ------ for xtal 11.0592MHz, PIC 18F4550

and

#pragma config OSC = HS,OSCS = OFF
#pragma config PWRT = OFF
#pragma config WDT = OFF
#pragma config DEBUG = OFF,LVP = OFF ,STVR = OFF--- for xtal 12MHz , PIC 18F452

here is the link containing config settings for most of the PIC ICs........ You must also need to go through data sheets of individual ICs which you have to configure....

http://ww1.microchip.com/downloads/en/DeviceDoc/PIC%20Config%20bit%20Format_Syntax_AndDefinitions.pdf
http://ww1.microchip.com/downloads/en/DeviceDoc/51537a.pdf


[ Edited Tue Sep 24 2013, 06:27 pm ]

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

Bobbyerilar
Thu Mar 28 2024, 08:08 am
pb58
Thu Mar 28 2024, 05:54 am
Clarazkafup
Thu Mar 28 2024, 02:24 am
Walterkic
Thu Mar 28 2024, 01:19 am
Davidusawn
Wed Mar 27 2024, 08:30 pm
Richardsop
Tue Mar 26 2024, 10:33 pm
Stevencog
Tue Mar 26 2024, 04:26 pm
Bernardwarge
Tue Mar 26 2024, 11:15 am