blakes7
Newbie level 6
- Joined
- Sep 16, 2010
- Messages
- 11
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Activity points
- 1,405
I have complied a single file from the HI-TECH C ../samples folder. Here is the source file description.
/* Example code for using timer0 on a 16F84
Just sets up a 1 second interrupt and increments a variable */
When I went to build this single file project with MPLAB IDE HI-TECH C plug in I got an error saying that OPTION is not defined. I looked in the pic16f84.h and pic16f84a.h files in the compiler include directories and found OPTION_REG defined and not OPTION. Is there a header file in HI-TECH C that has OPTION defined ?
Also the compiler manual says that you need to include the file htc.h in every C program so that the program will have access to the SFRs for the particular PIC.
I looked in the htc.h file but I cannot see how my pic's header file is included through this file. Can someone please explain how htc.h works ?
HTC.H header contents
#ifndef _HTC_H_
#define _HTC_H_
/* Definitions for _HTC_EDITION_ values */
#define __LITE__ 0
#define __STD__ 1
#define __PRO__ 2
/* common definitions */
#define ___mkstr1(x) #x
#define ___mkstr(x) ___mkstr1(x)
/* HI-TECH PICC / PICC-Lite compiler */
#if defined(__PICC__) || defined(__PICCLITE__)
#include <pic.h>
#endif
/* HI-TECH PICC-18 compiler */
#if defined(__PICC18__)
#include <pic18.h>
#endif
/* HI-TECH dsPICC compiler */
#if defined(__DSPICC__)
#include <dspic.h>
#endif
/* HI-TECH C for PIC32 */
#if defined(__PICC32__)
#include <pic32.h>
#endif
#endif
Thanks.
/* Example code for using timer0 on a 16F84
Just sets up a 1 second interrupt and increments a variable */
When I went to build this single file project with MPLAB IDE HI-TECH C plug in I got an error saying that OPTION is not defined. I looked in the pic16f84.h and pic16f84a.h files in the compiler include directories and found OPTION_REG defined and not OPTION. Is there a header file in HI-TECH C that has OPTION defined ?
Also the compiler manual says that you need to include the file htc.h in every C program so that the program will have access to the SFRs for the particular PIC.
I looked in the htc.h file but I cannot see how my pic's header file is included through this file. Can someone please explain how htc.h works ?
HTC.H header contents
#ifndef _HTC_H_
#define _HTC_H_
/* Definitions for _HTC_EDITION_ values */
#define __LITE__ 0
#define __STD__ 1
#define __PRO__ 2
/* common definitions */
#define ___mkstr1(x) #x
#define ___mkstr(x) ___mkstr1(x)
/* HI-TECH PICC / PICC-Lite compiler */
#if defined(__PICC__) || defined(__PICCLITE__)
#include <pic.h>
#endif
/* HI-TECH PICC-18 compiler */
#if defined(__PICC18__)
#include <pic18.h>
#endif
/* HI-TECH dsPICC compiler */
#if defined(__DSPICC__)
#include <dspic.h>
#endif
/* HI-TECH C for PIC32 */
#if defined(__PICC32__)
#include <pic32.h>
#endif
#endif
Thanks.