PDA

View Full Version : keep grtting Error[118]



Larryd
- 7th August 2014, 00:35
Has anyone had trouble compiling this project in PBP 2.60C

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

I keep grtting Error[118]. I can remove the config line,

@ __CONFIG _INTRC_IO & _WDT_OFF & _PWRTE_ON & _LVP_OFF & _CP_OFF & _MCLR_OFF 'FOR 819

and it will compile but will not run on my PIC16F819.

I have looked up the codes on this site but do no understand exctally what they do.


Thanks in advance for any help to get me pointed in the right direction.

Thanks
Larry

HenrikOlsson
- 7th August 2014, 08:34
Hi,
With versions prior to PBP3 you need to have the CONFIG directive either in your program OR in the default inc file. You get the error when you're trying to have it both ways at the same time.

All devices have their default CONFIG in their respective .inc file so if you need to change it you have two options:

A) Open the .inc file and comment out the CONFIG directive there, then add it to you your source file containing the needed changes.
B) Open the .inc file and EDIT the CONFIG directive there so that it matches what you need - don't add it to your source.

I don't have 2.6 on this machine but with PBP3 the 16F819 defaults to HS_OSC which is probably why it doesn't work with the defualt CONFIG.

/Henrik.

Larryd
- 7th August 2014, 20:09
Thank you Henrik !


Ok,
I found the file M16F81X.INC
, but do not understand what is active.

Example the include file has both ,

WDT_ON equ 3FFB0004h ; XX XXXX XXXX X1XX
WDT_OFF equ 3FFB0000h ; XX XXXX XXXX X0XX

How do you tell what is on or off?


Is their a Document that tells how to read .inc files ?



@ __CONFIG _INTRC_IO & _WDT_OFF & _PWRTE_ON & _LVP_OFF & _CP_OFF & _MCLR_OFF 'FOR 819


@ __CONFIG
_INTRC_IO
----------------------

& _WDT_OFF

WDT_ON equ 3FFB0004h ; XX XXXX XXXX X1XX
WDT_OFF equ 3FFB0000h ; XX XXXX XXXX X0XX
----------------------

PWRTE_ON
Not in File
----------------------

& _LVP_OFF
LVP_ON equ 3F7F0080h ; XX XXXX 1XXX XXXX
LVP_OFF equ 3F7F0000h ; XX XXXX 0XXX XXXX
----------------------

& _CP_OFF
Not in File
----------------------

& _MCLR_OFF
MCLR_ON equ 3FDF0020h ; XX XXXX XX1X XXXX


MCLR_OFF equ 3FDF0000h ; XX XXXX XX0X XXXX
----------------------


What does _INTRC_IO mean? I cant fing it in the .INC file





Thanks again for your help.

LarryD

Dave
- 8th August 2014, 13:10
LaryD, The statements with "equ" are mearly equate statements used for the compiler and assembler. The tell the appropriate program where the actual bit is located. They do not actually set the bit to true or false. That is what the directive "&_MCLR_OFF" or "&_MCLR_ON" do.

mackrackit
- 8th August 2014, 15:58
You need to be in the *.inc file that is in the PBP directory.

Read this
http://www.picbasic.co.uk/forum/showthread.php?t=543
Post #5 has a good explanation.

Larryd
- 11th August 2014, 22:52
Dave, and
Mackrackit,

Thank you both Very much, This was just what I needed.

after reading http://www.picbasic.co.uk/forum/showthread.php?t=543
I now have a handle on how it all works. I pounded out the 16F819.INC
config for the MPASM and all worked fine.

Thank you so much for All your Help.

Larryd