Код: Выделить всё
/* header file for the MICROCHIP PIC18 microcontroller
PIC18F2525
PIC18F2620
PIC18F4525
PIC18F4620
*/
, а у 9.66 PIC18F2620 выделен отдельно.
Затем для примера смотрим в сами заголовочники. Вот как заданы дефайны для битов регистра TRISC в версии 9.50
Код: Выделить всё
static volatile near unsigned char TRISC @ 0xF94;
и чуть ниже
Код: Выделить всё
/* Definitions for TRISC register */
static volatile near bit TRISC0 @ ((unsigned)&TRISC*8)+0;
static volatile near bit TRISC1 @ ((unsigned)&TRISC*8)+1;
static volatile near bit TRISC2 @ ((unsigned)&TRISC*8)+2;
static volatile near bit TRISC3 @ ((unsigned)&TRISC*8)+3;
static volatile near bit TRISC4 @ ((unsigned)&TRISC*8)+4;
static volatile near bit TRISC5 @ ((unsigned)&TRISC*8)+5;
static volatile near bit TRISC6 @ ((unsigned)&TRISC*8)+6;
static volatile near bit TRISC7 @ ((unsigned)&TRISC*8)+7;
А вот как у 9.66
Код: Выделить всё
// Register: TRISC
extern volatile unsigned char TRISC @ 0xF94;
extern volatile unsigned char DDRC @ 0xF94;
// bit and bitfield definitions
extern volatile bit TRISC0 @ ((unsigned)&TRISC*8)+0;
extern volatile bit TRISC1 @ ((unsigned)&TRISC*8)+1;
extern volatile bit TRISC2 @ ((unsigned)&TRISC*8)+2;
extern volatile bit TRISC3 @ ((unsigned)&TRISC*8)+3;
extern volatile bit TRISC4 @ ((unsigned)&TRISC*8)+4;
extern volatile bit TRISC5 @ ((unsigned)&TRISC*8)+5;
extern volatile bit TRISC6 @ ((unsigned)&TRISC*8)+6;
extern volatile bit TRISC7 @ ((unsigned)&TRISC*8)+7;
//extern volatile bit RC0 @ ((unsigned)&TRISC*8)+0;
//extern volatile bit RC1 @ ((unsigned)&TRISC*8)+1;
//extern volatile bit RC2 @ ((unsigned)&TRISC*8)+2;
//extern volatile bit RC3 @ ((unsigned)&TRISC*8)+3;
//extern volatile bit RC4 @ ((unsigned)&TRISC*8)+4;
//extern volatile bit RC5 @ ((unsigned)&TRISC*8)+5;
//extern volatile bit RC6 @ ((unsigned)&TRISC*8)+6;
//extern volatile bit RC7 @ ((unsigned)&TRISC*8)+7;
extern union {
struct {
volatile unsigned TRISC0 : 1;
volatile unsigned TRISC1 : 1;
volatile unsigned TRISC2 : 1;
volatile unsigned TRISC3 : 1;
volatile unsigned TRISC4 : 1;
volatile unsigned TRISC5 : 1;
volatile unsigned TRISC6 : 1;
volatile unsigned TRISC7 : 1;
};
struct {
volatile unsigned RC0 : 1;
volatile unsigned RC1 : 1;
volatile unsigned RC2 : 1;
volatile unsigned RC3 : 1;
volatile unsigned RC4 : 1;
volatile unsigned RC5 : 1;
volatile unsigned RC6 : 1;
volatile unsigned RC7 : 1;
};
} TRISCbits @ 0xF94;
это меня сначала сильно запутало. Т.к. в примерах чаще всего к отдельному пину обращаются как TRISCbits.RC1 например, а не TRISCbits. TRISC1. Не я конечно понимаю, что могу это все сам сделать, но на фиг тогда такой компилятор с такими библиотеками. Да, жалко мне тех людей которые пишут код под одним компилятором, а потом у них ни фига не работает на другом.
Да кстати, обратили внимание на:
Код: Выделить всё
extern volatile unsigned char TRISC @ 0xF94;
extern volatile unsigned char DDRC @ 0xF94;
Это наверное накарябали когда в 2008 Microchip хотела Atmel под себя подмить. Наверное заранее готовились
