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

Discussion in 'Programmer's Corner' started by olvine, May 4, 2014.

  1. olvine

    Thread Starter Member

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

    compiler XC16 and software MPLAB X.

    should i post the code ?
     
  2. MrChips

    Moderator

    Oct 2, 2009
    12,439
    3,360
    Please do.
     
  3. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    Only if you want an answer.
     
  4. MrChips

    Moderator

    Oct 2, 2009
    12,439
    3,360
    It's like saying "Doctor, it hurts when I do this".

    The most likely response would be "Then stop doing it."
     
  5. olvine

    Thread Starter Member

    Mar 10, 2014
    99
    0
    Attached are the files..Please check why it's giving error..
     
  6. olvine

    Thread Starter Member

    Mar 10, 2014
    99
    0
    I was waiting for someone to get online...that's all :)
     
  7. SneakSZ

    New Member

    Sep 19, 2012
    10
    1
    At which line in the code does the compiler refer to?
     
  8. olvine

    Thread Starter Member

    Mar 10, 2014
    99
    0
    wherever '.' operator is used...
     
  9. olvine

    Thread Starter Member

    Mar 10, 2014
    99
    0
    ...in glcd.txt
     
  10. nerdegutta

    Moderator

    Dec 15, 2009
    2,515
    785
    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?

    Code ( (Unknown Language)):
    1.  
    2. /*******************************************************************************
    3. * Function Name  : LCD_ReadData
    4. * Description    : LCD read data
    5. * Input          : None
    6. * Output         : None
    7. * Return         : return data
    8. * Attention  : None
    9. *******************************************************************************/
    10. unsigned short LCD_ReadData(void)
    11. {
    12.     unsigned short value;
    13.  
    14.         PORTCBITS.RC1=1;    //Set_Rs;  /* RS high */
    15.     PORTCBITS.RC2=1;        //Set_nWr; /* Wr high */
    16.     PORTCBITS.RC3=0;        //Clr_nRd; /* Rd low */
    17.  
    18.     TRISB=1;
    19.  
    20.    
    21.     value=PORTB;
    22.     value=PORTB;  
    23.  
    24.     TRISB=0;
    25.  
    26.         PORTCBITS.RC3=1;    //Set_nRd;   /* Rd high */
    27.  
    28.     return value;  /* return data */
    29. }
    30.  
     
  11. MrChips

    Moderator

    Oct 2, 2009
    12,439
    3,360
    There is always someone online.
     
    olvine likes this.
  12. olvine

    Thread Starter Member

    Mar 10, 2014
    99
    0
    attached is the output
     
  13. olvine

    Thread Starter Member

    Mar 10, 2014
    99
    0
    To ensure correct data
     
  14. MrChips

    Moderator

    Oct 2, 2009
    12,439
    3,360
    You don't trust your compiler or the MCU?
     
  15. olvine

    Thread Starter Member

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

    please check the relevant error and give me some solution.
     
  16. olvine

    Thread Starter Member

    Mar 10, 2014
    99
    0
    no one can sort it out ? :eek:
     
  17. MrChips

    Moderator

    Oct 2, 2009
    12,439
    3,360
    Of course we can sort it out. We are here to help you communicate, be patient and learning to help yourself.
     
  18. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Code ( (Unknown Language)):
    1. TRISCBITS.TRISC1=0;
    Are you sure this is correct. Should it not be like this
    Code ( (Unknown Language)):
    1. TRISCbits.TRISC0;
    TRISCbits.TRISC0 with bits in lower case (marked red)
     
  19. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    I'm sure it is not correct and needs to be cleaned up before any further debugging can occur.
     
  20. DerStrom8

    Well-Known Member

    Feb 20, 2011
    2,428
    1,328
    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:
     
Loading...