PDA

View Full Version : Fuses Again



jcleaver
- 22nd February 2007, 00:02
as it seems i have to go beyond pbp to get certain programs to work

damm fuses again

i am trying something very simple to start the training

chip 16f627a
assembler mpasm

trying to set chip for external osc because most people say this is required to run serial communications

tried the following statements
@ device xt_osc

@device pic16f627a,xt_osc

@_config_xt_osc

_config_xt_osc

all commands generate error messages in a simple 4 line program which assembles fine without the commands

wish pbp would include these setups as part of the compileing

mister_e
- 22nd February 2007, 00:05
Have a look to the following. Everything should be covered.

Presetting Configuration Fuses (PIC Defines) into your Program
http://www.picbasic.co.uk/forum/showthread.php?t=543

jcleaver
- 22nd February 2007, 00:54
mister e
thats where i went to get started seemed simple enough
however all the commands shown see above
generate a error

mister_e
- 22nd February 2007, 01:00
errors or warning.. that's the question!

tell me
the error number your program return e.g. Error[118]c:\... Overwriting previous address content (2007)
MPASM version
PBP version
your config line
the modified .INC file in your PBP folder.

Here, PBP 2.47, MPASM 5.06

@ __CONFIG _INTRC_OSC_NOCLKOUT & _MCLRE_ON & _LVP_OFF & _WDT_OFF & _PWRTE_ON & _BODEN_ON

and the 16F627A.INC file

;************************************************* ***************
;* 16F627A.INC *
;* *
;* By : Leonard Zerman, Jeff Schmoyer *
;* Notice : Copyright (c) 2003 microEngineering Labs, Inc. *
;* All Rights Reserved *
;* Date : 11/06/03 *
;* Version : 2.45 *
;* Notes : *
;************************************************* ***************
NOLIST
ifdef PM_USED
LIST
include 'M16F62xA.INC' ; PM header
;device pic16F627A, xt_osc, wdt_on, mclr_on, lvp_off, protect_off
XALL
NOLIST
else
LIST
LIST p = 16F627A, r = dec, w = -302
INCLUDE "P16F627A.INC" ; MPASM Header
;__config _XT_OSC & _WDT_ON & _MCLRE_ON & _LVP_OFF & _CP_OFF
NOLIST
endif
LIST

Archangel
- 22nd February 2007, 01:56
as it seems i have to go beyond pbp to get certain programs to work

damm fuses again

i am trying something very simple to start the training

chip 16f627a
assembler mpasm

trying to set chip for external osc because most people say this is required to run serial communications

tried the following statements
@ device xt_osc

@device pic16f627a,xt_osc

@_config_xt_osc

_config_xt_osc

all commands generate error messages in a simple 4 line program which assembles fine without the commands

wish pbp would include these setups as part of the compileing
Computers are stupid, PICs are stupid, they are not however, sloppy. So when they want some piece of code they will not accept a peace of kode, because they are stupid.
Now look at mister_e's code, the word config is preceded by __ not _ , that's two little Hyphen slash thingies, not one.
I hope this helps.
JS

jcleaver
- 22nd February 2007, 01:59
pbp 2.46 mpsam 5.


errors 113 and 118 are listed when i try the first line above


this is warning with the second part above

WARNING: Unable to open INCLUDE file P16F627A.INC.
ERROR Line 25: Syntax error. (mistre.pbp)
ERROR Line 26: Bad parameter to LIST command. (mistre.pbp)
ERROR Line 27: Syntax error. (mistre.pbp)
ERROR Line 31: ELSE without a matching IF..THEN. (mistre.pbp)
ERROR Line 32: Bad parameter to LIST command. (mistre.pbp)
ERROR Line 33: Bad parameter to LIST command. (mistre.pbp)
ERROR Line 37: ENDIF without a matching IF..THEN. (mistre.pbp)
ERROR Line 38: Bad parameter to LIST command. (mistre.pbp)

mister_e
- 22nd February 2007, 02:03
post your whole code... and make sure your MPASM PATH is right and MPASM is checked in the Compile and Program Option> assembler tab of MicroCode Studio.

jcleaver
- 22nd February 2007, 20:59
only getting overwriteing previous address error now is that ok


also your first line did not give xt-osc which is all i really am trying to start with

attached file

mpsam is working perfectly expect when i try fuses

mister_e
- 22nd February 2007, 21:15
sorry, i misread your first post. Anyways, you'll need this one

@ __CONFIG _XT_OSC & _MCLRE_ON & _LVP_OFF & _WDT_OFF & _PWRTE_ON & _BODEN_ON

jcleaver
- 22nd February 2007, 22:22
thanks that seems to work except for the overwrite error
is that a problem??

Archangel
- 24th February 2007, 06:43
thanks that seems to work except for the overwrite error
is that a problem??
Hi Jack,
Look at post #4 in this thread. Mr E. explained what to do to eliminate the last error of which you speak. The compiler sees the config default settings in the INC file and then sees the config setting in your code, and guess what it does?
It ignores the setting in your code and goes with the default. So just add a semicolon ahead of the two statements he showed you and the compiler will forevermore do what you tell it for this chip. You will have to edit each individual inc file as needed. So why is that statement even in there? Did you ever compile a program without setting the configs? Did it work? Yes it probably did if you used a 4mhz chrystal, because of the default configs.

keithdoxey
- 24th February 2007, 10:42
Just a thought....


...now that we mostly work with Flash devices rather than OTP, shouldnt we be referring to "Configuration Circuit Breakers" rather than "Configuration Fuses" because we can reset them.

:D :D

jcleaver
- 24th February 2007, 15:05
joe thanks for the info i guess what you are saying is i need to find the
inc file for this chip and rem out the config statement so it writes it according to my programs

the problem, which i had earlier and never really found a answer is i am not sure where it is looking for these files as i have many inc files for this chip
got installed with some programmers and mpsam so really dont know which file to use.
if i try the first part besides getting the error of overwriteing it will not go out to the programmer

also if i try to use the second part of posting #4 i get huge errrors see my later listing
so basically niether statement works for me
must be a simpler way

thanks

jack

mister_e
- 24th February 2007, 15:08
http://www.picbasic.co.uk/forum/showpost.php?p=6775&postcount=5

We talk about commenting the PBP default ones. THE .INC file is located in the PBP folder.

Archangel
- 24th February 2007, 21:34
Hi Jack,
Look at post #4 in this thread. Mr E. explained what to do to eliminate the last error of which you speak. The compiler sees the config default settings in the INC file and then sees the config setting in your code, and guess what it does?
It ignores the setting in your code and goes with the default. So just add a semicolon ahead of the two statements he showed you and the compiler will forevermore do what you tell it for this chip. You will have to edit each individual inc file as needed. So why is that statement even in there? Did you ever compile a program without setting the configs? Did it work? Yes it probably did if you used a 4mhz chrystal, because of the default configs.
What I am really saying is despite my inability to spell crystal properly, follow mister_e's instructions and you will be right 99.9999999062 % of the time, He will never intentionaly lead you astray! Same with most all of the other " BIG GUNS" in this forum same applies to BIG 'UNS too :) . I wish he was an investment counselor !

jcleaver
- 27th February 2007, 23:33
might want to take a look at mikroelekronika there assembler and programer
make duck soup out of working with fuses just check off like a list
looks very simple