Searching \ for '[PIC] Pic18f13k50 and C' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/languages.htm?key=c
Search entire site for: 'Pic18f13k50 and C'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] Pic18f13k50 and C'
2011\03\16@123225 by RG

picon face
I try to use C language for the first time and I have a Pic18f13k50.
I regulary get an error message: "Error   [141] D:\xxxxx 1.22 can't
open include file "p18f13k50.h": No such file ", using Hi-Tech
Universal Tolsuite light or Microchip C18, also using a simple program
like this below.
I move the include file p18f13k50.h to the project directory but the
result is the same.

Any suggestion?

#include <p18f13k50.h>

void main (void)
{

}


Thanks
Renz

2011\03\16@124527 by Jan-Erik Soderholm

face picon face
I think the £include directive is case-sensitive.
Check if the file is called "P18f13k50.h" or something...



RG wrote 2011-03-16 17:32:
{Quote hidden}

> Renz

2011\03\16@130018 by Bob Blick

face
flavicon
face
Hi Renzo,

I don't think you need to include that file, just pic.h, like this:

#include <pic.h>

That's the way HiTech used to do it, probably the same today, I don't
know about C18. The correct device .h file is usually automatically used
because you select the device elsewhere.

Cheerful regards,

Bob

On Wed, 16 Mar 2011 17:32 +0100, "RG" wrote:
{Quote hidden}

-- http://www.fastmail.fm - Same, same, but different...

2011\03\16@130219 by Michael Rigby-Jones

flavicon
face


> -----Original Message-----
> From: spam_OUTpiclist-bouncesTakeThisOuTspammit.edu [.....piclist-bouncesKILLspamspam@spam@mit.edu] On
Behalf
{Quote hidden}

Check the compiler manual, but you shouldn't normally include the target
header directly in your source code.  You should #include <htc.h>, and
this header will automatically include the correct target header
according to the device you define on the compiler command line.

It looks like you may have spaces in your path as well ("D:\xxxxx
1.22"), so check that all paths passed to the compiler are wrapped in
quotes.  In general I try to avoid using spaces in paths.

Regards

Mike

=======================================================================
This e-mail is intended for the person it is addressed to only. The
information contained in it may be confidential and/or protected by
law. If you are not the intended recipient of this message, you must
not make any use of this information, or copy or show it to any
person. Please contact us immediately to tell us that you have
received this e-mail, and return the original to us. Any use,
forwarding, printing or copying of this message is strictly prohibited.
No part of this message can be considered a request for goods or
services.
=======================================================================

2011\03\16@132343 by RG

picon face
I tries also with "htc.c" in this case the error is: Error   [195]
d:\Programmi\HI-TECH Software\PICC-18\PRO\9.65\include\pic18f1xk50.h;
16.42 expression syntax

but if I configure another chip e.g. Pic18f4550 or Pic18f1220 all runs Ok

Sincerely
Renzo

2011/3/16 Michael Rigby-Jones <.....Michael.Rigby-JonesKILLspamspam.....oclaro.com>:
>
>
>> {Original Message removed}

2011\03\16@141944 by Kerry Wentworth

flavicon
face
Change

#include <p18f13k50.h>

to

#include "p18f13k50.h"

Kerry




RG wrote:
{Quote hidden}

-- Internal Virus Database is out-of-date.
Checked by AVG Anti-Virus.
Version: 7.0.289 / Virus Database: 267.11.13 - Release Date: 10/6/05

2011\03\16@142537 by Oli Glaser

flavicon
face
On 16/03/2011 17:23, RG wrote:
> I tries also with "htc.c" in this case the error is: Error   [195]
> d:\Programmi\HI-TECH Software\PICC-18\PRO\9.65\include\pic18f1xk50.h;
> 16.42 expression syntax
>
> but if I configure another chip e.g. Pic18f4550 or Pic18f1220 all runs Ok
>
> Sincerely
> Renzo
>

With Hi-Tech as mentioned you should be able to just put <htc.h> (not htc.c)
If you use includes in the project folder use "xxxx.h" (rather than angle brackets which search in the default path specified)
IIRC the 18F13K50.h will be included in pic18.h which in turn is included in htc.h. I just checked in my Hi-Tech inculed folder and FWIW the correct file name is pic18f1xk50.h
You can check in your Hi-Tech directory under /include to make sure it is there - you need to make sure that MPLAB is pointing to the correct path for the include files; under Build Options->Directories (set drop down list to include directory and add the correct path) or Set Language Tool Locations.

2011\03\16@154230 by RG

picon face
Eureka, the micro program at last is compiled.

But a lot of warnings like this "Warning [335]
D:\PIC\Pic18F13xxxx\Prove_per_18\p18f13k50.h; 1263.1 unknown pragma
"varlocate".
Now I'll try a more seriuos program.

Thanks
Renzo




2011/3/16 Kerry Wentworth <EraseMEkwentworthspam_OUTspamTakeThisOuTskunkworksnh.com>:
{Quote hidden}

>

2011\03\16@180209 by Jan-Erik Soderholm

face picon face
What was the "fix" ??



RG wrote 2011-03-16 20:42:
{Quote hidden}

>> -

2011\03\17@042731 by RG

picon face
I followed the suggestion of   Kerry Wentworth<@spam@kwentworthKILLspamspamskunkworksnh.com>:
Change
>>>
>>> #include<p18f13k50.h>
>>>
>>> to
>>>
>>> #include "p18f13k50.h"

But using #include "htc.c" instead there is always an error: Error
[730] d:\Programmi\HI-TECH
Software\PICC-18\PRO\9.65\include\pic18f1xk50.h; 16. bad op "]".

Problably there are something wrong in code for this processor.

Bye
Renzo


2011/3/16 Jan-Erik Soderholm <KILLspamjan-erik.soderholmKILLspamspamtelia.com>:
{Quote hidden}

>>> --

2011\03\17@075651 by Oli Glaser

flavicon
face
On 17/03/2011 08:27, RG wrote:
> I followed the suggestion of   Kerry Wentworth<RemoveMEkwentworthTakeThisOuTspamskunkworksnh.com>:
>   Change
>>>> >>>
>>>> >>>  #include<p18f13k50.h>
>>>> >>>
>>>> >>>  to
>>>> >>>
>>>> >>>  #include "p18f13k50.h"
> But using #include "htc.c" instead there is always an error: Error
> [730] d:\Programmi\HI-TECH
> Software\PICC-18\PRO\9.65\include\pic18f1xk50.h; 16. bad op "]".
>
> Problably there are something wrong in code for this processor.

It should be htc.h not htc.c
Something does not quite add up here - out of curiosity I just tried compiling  here using 18F13K50 and Hi-Tech v9.63, and it works fine with <htc.h>. My code was literally:
#include <htc.h>
void main()
{
}

Alternatively for C18:

#include <p18cxxx.h>
void main()
{
}

Are you sure you have the Language Toolsuite set correctly when you try the different headers?
For Hi-Tech you can use <htc.h> for all
For C18 you can use <p18cxxx.h> for all

I would try starting with a blank project, and rather than copying any missing headers into your project directory, set the project search directories (include, linker etc) correctly.
If it still does not work, then maybe try reinstalling Hi-Tech.

2011\03\17@113228 by RG

picon face
I installed again Hi-Tech C and now all is ok, thanks
Renzo

2011/3/17 Oli Glaser <spamBeGoneoli.glaserspamBeGonespamtalktalk.net>:
{Quote hidden}

>

More... (looser matching)
- Last day of these posts
- In 2011 , 2012 only
- Today
- New search...