From: Steve B. <st...@de...> - 2006-03-15 21:00:35
|
Hi Raphael, Raphael Neider wrote: > Actually the headers should be changed to declare appropriate > structs for all sfrs... Thanks very much for your help! I've got my f84 nicely measuring resistor values and displaying to a Nokia LCD, so I'm very happy :-) I ended up adding the following to the pic16f84.h in a similar way to the example .h file that comes with the PIC14 port. Many thanks for a great port of a _very_ useful compiler! /***************************************************************************** Ports *****************************************************************************/ typedef struct { unsigned b0 :1; unsigned b1 :1; unsigned b2 :1; unsigned b3 :1; unsigned b4 :1; unsigned b5 :1; unsigned b6 :1; unsigned b7 :1; } bits_t; typedef union { bits_t; unsigned char r; } port_t; typedef union { bits_t; unsigned char r; } tris_t; /* --- PORTA Bits ---------------------------------------------------------- */ static volatile port_t at PORTA_ADDR porta_b; #define RA0 porta_b.b0 #define RA1 porta_b.b1 #define RA2 porta_b.b2 #define RA3 porta_b.b3 #define RA4 porta_b.b4 #define RA5 porta_b.b5 #define RA6 porta_b.b6 #define RA7 porta_b.b7 /* --- PORTB Bits ---------------------------------------------------------- */ static volatile port_t at PORTB_ADDR portb_b; #define RB0 portb_b.b0 #define RB1 portb_b.b1 #define RB2 portb_b.b2 #define RB3 portb_b.b3 #define RB4 portb_b.b4 #define RB5 portb_b.b5 #define RB6 portb_b.b6 #define RB7 portb_b.b7 |