PDA

View Full Version : Setting Fuses using Microcode Studio Plus



NO2K
- 24th February 2007, 00:32
Does anyone know of a way to set fuses in any PIC supported by Microcode Studio Plus USING Microcode Studio Plus Commands? I tried using an assy line starting with the @ but putting things in like "Device PIC16F870" does not work!? Help!

skimask
- 24th February 2007, 00:41
Does anyone know of a way to set fuses in any PIC supported by Microcode Studio Plus USING Microcode Studio Plus Commands? I tried using an assy line starting with the @ but putting things in like "Device PIC16F870" does not work!? Help!

Search for "setting config fuse", hit the link in the FAQ's from Melanie. Big ol' explanation on how to get everything to work right.

grounded
- 24th February 2007, 05:24
will this help
http://www.picbasic.co.uk/forum/showthread.php?t=5628

NO2K
- 3rd March 2007, 07:58
Thanks to Skimask, and Grounded! The info provided was just what I needed. I also found the same info on www.melab.com i.e.
SETTING FUSES WITH PIC BASIC PRO and MICROCODE STUDIO PLUS

1. The Fuse settings for each PIC are located in the PIC Basic Pro *.INC files. Those files are included in the PBP directory which is placed in the hard drive when PIC Basic Pro is installed

2. These Fuse settings can be placed in your own program in the form of a single line of assembly code. I use the 16F870 PIC, so for that one you will find the following line in the 16F870.INC file:
__config _XT_OSC & _WDT_ON & _PWRTE_ON & _LVP_OFF & _CP_OFF
which is located after the "ELSE" statement. You can put this same line of code in your own program and adjust the statements for your own purposes. In my case, I wanted everything off, but wanted the XT Oscillator since I am using a 4 Mhz Timing Crystal, so my code line looks like:
@ __config _XT_OSC & _WDT_OFF & _PWRTE_OFF & _LVP_OFF & _CP_OFF
This line will override whatever your PIC Programmer has in its own fuse setting section, therefore you don't need to tell the programmer what fuses to set.

If you do put your own fuse setting in your program, then you need to comment out the line in the *.INC file in the "ELSE" statement as follows:
else
LIST
LIST p = 16F870, r = dec, w = -302
INCLUDE "P16F870.INC" ; MPASM Header
;__config _XT_OSC & _WDT_ON & _PWRTE_ON & _LVP_OFF & _CP_OFF
otherwise, PIC Basic Pro tries to process both statements and that generates an error and your program will not compile.

In addition, note this fuse config line is different for different PICs. For example the one for the 16F84A in 16F84.INC is:
__config _XT_OSC & _WDT_ON & _CP_OFF

One last thing, insure the @ sign is in the 1st column of the program line, and make sure it is followed by at least 1 space. Don't forget any of the _ characters or the & characters.

jcleaver
- 4th March 2007, 15:37
watch the above site looks like a ad grabber

read melainies post great for usng pbp but cant follow it for mpsam

Ruben Pena
- 18th May 2007, 22:41
Hi...
I put the following fuses for one application:
@ DEVICE pic16f886 , INTRC_OSC_NOCLKOUT
@ DEVICE pic16f886 , PWRT_OFF
@ DEVICE pic16F886 , PROTECT_OFF
@ DEVICE PIC16F886 , MCLR_OFF
@ DEVICE PIC16F886 , WDT_OFF
@ DEVICE PIC16F886 , BOR21V
@ DEVICE PIC16F886 , LVP_OFF

It compiles ok.. but in the configuration window of the USB programmer always shows LVP enabled and BOR = 4 V.
I have the "Update configuration from file" enabled.
I modify the options in the programmer and I can get the 2.1 BOR ,but the LPV stays enabled even if I change manually the parameter.
The programmed hex do not run.I am working with 3.3 Volts.
Any ideas...?
Thanks in advance...
Ruben de la Pena V.

skimask
- 18th May 2007, 22:49
http://www.picbasic.co.uk/forum/showthread.php?t=5628

http://www.picbasic.co.uk/forum/showthread.php?t=543

Ruben Pena
- 18th May 2007, 23:14
Skymask:
Thanks for the links and fast reply...
I found a upgrade at Melabs for the USB programmer and I think that will clear the problem. I downloaded the beta version,and the LVP was off.
My program is working now...
I wanted to add this comment ,as an adicional option when there are troubles configuring the Pics.
Thanks again...
Ruben de la Pena V.