5

When i run my program in MPLAB. ( Project wizard -> PIC16F877A -> Hi Tech Ansi C Compiler -> RUN ) Error [141] C:\Users\WhyWhy\Desktop\test.c; 1.22 can't open include file "16F877A.h": No such file or directory

Where can i find the header file for the 16F877A?

Gareth Davis
  • 27,701
  • 12
  • 73
  • 106
whywhy
  • 155
  • 1
  • 6
  • 13

3 Answers3

1

Chip-specific header files should not be explicitly included in HITECH-C, the documentation clearly states that. Instead, you include the compiler header, which will take care of including the chip-specific file for you:

#include <htc.h>

All you need for this to work is to configure correct chip in the project settings. The 16F877A.h file exists in the compiler directory, but including it directly will throw a warning.

Rafael Lerm
  • 1,340
  • 7
  • 10
0

C:\Program Files\HI-TECH Software\PICC\9.70\include

In my case , I have installed HITech Compiler In C:\ Program Files. You have to know, where have you installed the files of the compiler.

0

This file is from the compiler, so in your case the Hi Tech you can find here:

C:\Program Files\HI‐TECH Software\PICC\\include\

Before you have found the file you have to add in the Header Files folder in the Project window on MPLAB.

And in your code you have to include it

#include <16F877A.h>
Butzke
  • 561
  • 1
  • 14
  • 30