problem with hi-tech c compiler

Status
Not open for further replies.

samnang39

Full Member level 2
Joined
Oct 26, 2006
Messages
130
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,296
Location
Cambodia
Activity points
2,246
My code is

but after i bill by use MPLAB the output is
i don't know why the compiler can not know "RCIF" and......
please help me
Thanks in advance
 

Hi;
I never tried to prgram 18F series with picc.
But did you consider to include specific 18F2550 header?
Good luck
 

yes i used to include already but still problem
 

Please have a check the header file content. Maybe these bits are not defined in the header.
ie my 16f877 header has this kind of definition for TXIF;
Code:
static volatile bit	TXIF	@ (unsigned)&PIR1*8+4;

If this kind of defintion is not available, you should read whole register and then mask for necessary bits.
Hope helps
 
Try using

PIR1bits.RCIF
PIR1bits.TXIF
 
Thanks Emresel what is
extern volatile near unsigned char PIR1;
extern volatile near struct {
unsigned TMR1IF:1;
unsigned TMR2IF:1;
unsigned CCP1IF:1;
unsigned SSPIF:1;
unsigned TXIF:1;
unsigned RCIF:1;
unsigned ADIF:1;
} PIR1bits;
mean could you please explain me
 

TXIF and RCIF are defined as variables, one bit wide, in the PIR1 bitfield structure.
The structure is named PIR1bits.

You access the bits in the same way you access variables in a structure.

PIR1bits.RCIF = 1;

Look up 'bitfield' for more information.
 

Thank for your reply yes i understand about this already but i want to know the " extern volatile near " mean?
 

Last edited:
Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…