我用的是picc 9.81,当我编译pic12f508a时候发现头文件配置无TRIS,那怎么办呢?
#ifndef _HTC_H_
#warning Header file pic12c508a.h included directly. Use #include <htc.h> instead.
#endif
/* header file for the MICROCHIP PIC microcontroller
* 12C508A
*/
#ifndef __PIC12C508A_H
#define __PIC12C508A_H
//
// Configuration mask definitions
//
// Config Register: CONFIG
#define CONFIG 0x0FFF
// Oscillator selection bits
// external RC oscillator
#define OSC_ExtRC 0xFFFF
// LP oscillator
#define OSC_LP 0xFFFC
// XT oscillator
#define OSC_XT 0xFFFD
// internal RC oscillator
#define OSC_IntRC 0xFFFE
// Watchdog timer enable bit
// WDT enabled
#define WDT_ON 0xFFFF
// WDT disabled
#define WDT_OFF 0xFFFB
// Code protection bit
// Code protection off
#define CP_OFF 0xFFFF
// Code protection on
#define CP_ON 0xFFF7
// MCLR enable bit
// MCLR pin enabled
#define MCLRE_ON 0xFFFF
// MCLR tied to VDD, (Internally)
#define MCLRE_OFF 0xFFEF
//
// Special function register definitions
//
volatile control unsigned char OPTION @ 0x000;
// Register: INDF
volatile unsigned char INDF @ 0x000;
// bit and bitfield definitions
// Register: TMR0
volatile unsigned char TMR0 @ 0x001;
// bit and bitfield definitions
// Register: PCL
volatile unsigned char PCL @ 0x002;
// bit and bitfield definitions
// Register: STATUS
volatile unsigned char STATUS @ 0x003;
// bit and bitfield definitions
volatile bit CARRY @ ((unsigned)&STATUS*8)+0;
volatile bit DC @ ((unsigned)&STATUS*8)+1;
volatile bit ZERO @ ((unsigned)&STATUS*8)+2;
volatile bit nPD @ ((unsigned)&STATUS*8)+3;
volatile bit nTO @ ((unsigned)&STATUS*8)+4;
volatile bit PA0 @ ((unsigned)&STATUS*8)+5;
volatile bit GPWUF @ ((unsigned)&STATUS*8)+7;
#ifndef _LIB_BUILD
volatile union {
struct {
unsigned C : 1;
unsigned DC : 1;
unsigned Z : 1;
unsigned nPD : 1;
unsigned nTO : 1;
unsigned PA0 : 1;
unsigned : 1;
unsigned GPWUF : 1;
};
} STATUSbits @ 0x003;
#endif
// Register: FSR
volatile unsigned char FSR @ 0x004;
// bit and bitfield definitions
// Register: OSCCAL
volatile unsigned char OSCCAL @ 0x005;
// bit and bitfield definitions
volatile bit CAL0 @ ((unsigned)&OSCCAL*8)+2;
volatile bit CAL1 @ ((unsigned)&OSCCAL*8)+3;
volatile bit CAL2 @ ((unsigned)&OSCCAL*8)+4;
volatile bit CAL3 @ ((unsigned)&OSCCAL*8)+5;
volatile bit CAL4 @ ((unsigned)&OSCCAL*8)+6;
volatile bit CAL5 @ ((unsigned)&OSCCAL*8)+7;
volatile bit OSCSLW @ ((unsigned)&OSCCAL*8)+2;
volatile bit OSCFST @ ((unsigned)&OSCCAL*8)+3;
#ifndef _LIB_BUILD
volatile union {
struct {
unsigned : 2;
unsigned CAL : 6;
};
struct {
unsigned : 2;
unsigned CAL0 : 1;
unsigned CAL1 : 1;
unsigned CAL2 : 1;
unsigned CAL3 : 1;
unsigned CAL4 : 1;
unsigned CAL5 : 1;
};
struct {
unsigned : 2;
unsigned OSCSLW : 1;
unsigned OSCFST : 1;
};
} OSCCALbits @ 0x005;
#endif
// Register: GPIO
volatile unsigned char GPIO @ 0x006;
// bit and bitfield definitions
volatile bit GP0 @ ((unsigned)&GPIO*8)+0;
volatile bit GP1 @ ((unsigned)&GPIO*8)+1;
volatile bit GP2 @ ((unsigned)&GPIO*8)+2;
volatile bit GP3 @ ((unsigned)&GPIO*8)+3;
volatile bit GP4 @ ((unsigned)&GPIO*8)+4;
volatile bit GP5 @ ((unsigned)&GPIO*8)+5;
#ifndef _LIB_BUILD
volatile union {
struct {
unsigned GP0 : 1;
unsigned GP1 : 1;
unsigned GP2 : 1;
unsigned GP3 : 1;
unsigned GP4 : 1;
unsigned GP5 : 1;
};
} GPIObits @ 0x006;
#endif
#endif
|