View previous topic :: View next topic |
Author |
Message |
Sam_40
Joined: 07 Jan 2015 Posts: 127
|
Fuses and Peripheral? [SOLVED] |
Posted: Sun Nov 22, 2015 10:27 am |
|
|
Hello guys,
I have a general question/questions regarding the fuses and peripherals. I am working on PIC18F2685 but I would like to use this as an example to know the other ones!
The MPLAB and MPLAB X IDE shows the configuration bits (fuses). The datasheet shows the configuration bits, however their name is deferent than the ccs header file for the target processor and this raise few questions if you please help me understand them:
1- The header file has a list of the available fuses for the target processor. How can I know what they mean? I know PUT, INTRC_IO, NOWDT, NOBROWNOUT meaning but some of the other ones I could not find them in the datasheet! The ccs manual partially explain this under #FUSE.
2- How can I know what is the default fuses for the target processor? If for example I do Code: | #fuses INTRC_IO, NOWDT, NOBROWNOUT |
is all the other fuses will be off? Or what?
3- I know all the available peripherals for the processor is found in the datasheet. Which one is enable or disable by default when compiled?
4- How can I find out if certain FUSE is affecting certain peripheral. For example using INTRC_IO will effect the osc and allow the use of RA6 and RA7 as IO for the 18f2685. Where can I find the list of that?
Thanks in advance,
Last edited by Sam_40 on Sun Nov 22, 2015 6:25 pm; edited 1 time in total |
|
|
newguy
Joined: 24 Jun 2004 Posts: 1908
|
|
Posted: Sun Nov 22, 2015 10:58 am |
|
|
In all honesty, that information is contained in the processor's data sheet. There's no shortcut - you really have to read the data sheet (at the very least skim through it). Also bear in mind that the processor's errata is also a 'must read'. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Nov 22, 2015 12:32 pm |
|
|
1. See fuses.txt for a list of fuses and their meaning. Look here:
Quote: | C:\Program Files\PICC\fuses.txt |
You only get this file with the full CCS IDE compilers (PCWHD, etc).
If you can't find it, then do a web search for this: ccs "fuses.txt" todopic
2. For default fuses, look at the end of the .LST file. The .LST file will
be in your project directory after a successful build. The ones that you
set in your #fuses statement will of course be there, but all the other
ones are the default settings. Be aware that if compiled in Debug mode
in MPLAB, or if the Debug fuse is present (or #device ICD=TRUE) then the
fuses will be changed (overriding settings), so the PIC will run properly in
debug mode.
3. Look at the .LST file. Look at the code inserted by the compiler at
the start of main(). This assembly language code will enable any
peripherals for which you are using CCS #use libraries. This start-up
code will do other things, such as set PortA (or sometimes other ports)
as all digital. Set the .LST file to be in Symbolic mode. Then the startup
code will show you the PIC's register names. Consult the PIC data sheet
to see what the compiler's settings will do.
4. Look at the Configuration Bits section in your PIC data sheet. It will
tell you. |
|
|
Sam_40
Joined: 07 Jan 2015 Posts: 127
|
|
Posted: Sun Nov 22, 2015 6:25 pm |
|
|
newguy,
Thanks for your input.
PCM programmer,
Thanks a lot for the very helpful detailed information. I appreciate your time and help.
Best regards, |
|
|
|