Can't get rid of the error !! :@

Thread Starter

olvine

Joined Mar 10, 2014
99
Error:expected identifier or '(' before '.' token

compiler XC16 and software MPLAB X.

should i post the code ?
 

nerdegutta

Joined Dec 15, 2009
2,684
Copy and paste the entire compiler output, or make a screenshot of the error message, and post it here.

If not we're stumbling in the dark.

I saw that in some of the function you had variable assignment 2 times. Any particular reason for that?

Rich (BB code):
/*******************************************************************************
* Function Name  : LCD_ReadData
* Description    : LCD read data
* Input          : None
* Output         : None
* Return         : return data
* Attention	 : None
*******************************************************************************/
unsigned short LCD_ReadData(void)
{
	unsigned short value;

        PORTCBITS.RC1=1;	//Set_Rs;  /* RS high */
	PORTCBITS.RC2=1;        //Set_nWr; /* Wr high */
	PORTCBITS.RC3=0;        //Clr_nRd; /* Rd low */

	TRISB=1;

    
	value=PORTB;
	value=PORTB;  

	TRISB=0;

        PORTCBITS.RC3=1;    //Set_nRd;   /* Rd high */

    return value;  /* return data */
}
 

Thread Starter

olvine

Joined Mar 10, 2014
99
why waste time on on this whether i trust it or not...

please check the relevant error and give me some solution.
 

t06afre

Joined May 11, 2009
5,934
Rich (BB code):
TRISCBITS.TRISC1=0;
Are you sure this is correct. Should it not be like this
Rich (BB code):
TRISCbits.TRISC0;
TRISCbits.TRISC0 with bits in lower case (marked red)
 

ErnieM

Joined Apr 24, 2011
8,377
Rich (BB code):
TRISCBITS.TRISC1=0;
Are you sure this is correct. Should it not be like this
Rich (BB code):
TRISCbits.TRISC0;
TRISCbits.TRISC0 with bits in lower case (marked red)
I'm sure it is not correct and needs to be cleaned up before any further debugging can occur.
 

DerStrom8

Joined Feb 20, 2011
2,390
I am 99% sure it is because you are using PORTCBITS.RC1 instead of PORTCbits.RC1. Watch your capitalization.

EDIT: Also, don't forget to include xc.h

SECOND EDIT: Dangit, I didn't realize there was already a second page with the same answers :eek:
 
Top