PDA

View Full Version : Fuses? Switches? Pic settings help!! MCS5 help



wdmagic
- 14th October 2015, 00:35
I have upgraded to PBP3 gold and the PicKit 3, and its a bit different to program chips now. so I need some help in my processes of how to go about making some settings changes. before: using MCS4 I would make my rogram and compile a HEX file, then I would open my software (chinese programmer) load my HEX file, open FUSES, set my OSC, WDT, MCLR, Etc... , then Hit program and thats it. currently: My MCS5 handles my PicKit 3 programmer directly, however I cannot find a location anywhere to set my Fuses/Switches. Is there a way? if not am I going to have to hard code my "defaults" I like in the Chip .inc files, or will I have to do it with code each time :( Usually all I used to do is turn off WDT, MCLR, Brownout, and set my OSC to internal, however there are times I want to use a crystal or ttl clock.

Heckler
- 14th October 2015, 03:05
i'm by no means an expert and I have not tried the pickit3 (I have and love my pickit2)
I also have PBP3

you should be able to set your configuration bits by doing something like the following...


#IF __PROCESSOR__ = "16F1828"
#CONFIG
__CONFIG _CONFIG1, _FOSC_INTOSC & _WDTE_ON & _PWRTE_OFF & _MCLRE_OFF & _CP_OFF & _CPD_OFF & _BOREN_OFF & _CLKOUTEN_OFF & _IESO_OFF & _FCMEN_OFF
__CONFIG _CONFIG2, _WRT_OFF & _PLLEN_OFF & _STVREN_OFF & _BORV_25 & _LVP_OFF
#endconfig
#ELSE
#IF __PROCESSOR__ = "16F690"
#CONFIG
__CONFIG _INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_OFF & _MCLRE_OFF & _CP_OFF & _CPD_OFF & _BOD_OFF & _IESO_OFF & _FCMEN_OFF
#endconfig
#ELSE
#ERROR "Program does not support " + __PROCESSOR__
#ENDIF
#ENDIF

#msg "compiling for target " + __PROCESSOR__


The above allows you to set the configuration bits for more than one processor.

NOTE: some of the configs above begin with just 1 underscore "_" and some have two
and I believe it is important to get that correct.

HenrikOlsson
- 14th October 2015, 06:00
Hi,

Open up the manual and look at the #CONFIG, #ENDCONFIG directives. Then open up the DEVICE_REFERENCE folder in the PBP3 installation directory and look at the file for your particular target device, it will show you exactly what the PBP default configuration for that device IS and all the available options.

The "format" of what goes in between the #CONFIG and #ENDCONFIG directives depends on the device family, PIC16, PIC18 etc so it looks a little bit different.

/Henrik.

AvionicsMaster1
- 14th October 2015, 20:51
As I recollect when MCSPBP installs it creates an INFO folder. In that folder, for at least most of the PICs, there is file showing the format of the configs and what fuses are available but most importantly what they're called. Just copy and paste, delete what you don't need and/or comment out what you don't need.

HenrikOlsson
- 15th October 2015, 06:34
Hi,

Remember that as soon as you place the #CONFIG/"ENDCONFIG block in your program it replaces ALL PBP defaults.
So you need to include ALL configs that you need to change from the whatever is the default when the flash is cleared - which you need to look up in the datasheet. It's usually best to copy the PBP defaults and change/add what you want.

/Henrik.

wdmagic
- 17th October 2015, 00:39
Thanks for the quick reply's! Henrick, I just ordered my cd and manual, I had forgotten to download the PDF manual. Just did that. reading it now, however sometimes its a bit hard to read ebook version. I can't wait to get my paper copy. a few questions, looking at your code " if this processor then.." could I make a bas file with all the processors I use and just do an include to pull it in? if so, can I use REM " ' " to make notes on it also?

HenrikOlsson
- 19th October 2015, 07:42
Hello,


a few questions, looking at your code " if this processor then.." could I make a bas file with all the processors I use and just do an include to pull it in? if so, can I use REM " ' " to make notes on it also?


Well, it wasn't me posting the code but yes you can do all of that if you want.

/Henrik.

wdmagic
- 20th October 2015, 03:43
hehe sorry henrick, i glanced at the name to quick, it was hecklers code. but thanks for the help. ill try it.