Reply To: Retrieving UART data on LCD using PIC16F877A

Home Forums Microcontrollers PIC Microcontroller Retrieving UART data on LCD using PIC16F877A Reply To: Retrieving UART data on LCD using PIC16F877A

#10710

sandeep
Participant

I have disabled the echo feature using ATE0 command and have put the gsm module permanently on the text mode using AT+CMGF=1;&W , and now i get the garbage character on the lcd display, when i tried the code with the hyperterminal, i got the same garbage value but once i create an interrupt by pressing a key on keyboard that gets printed on lcd, but when i interface the controller with the gsm module, the same garbage value is printed repeatedly… i have done a code to receive a one character first… so here is the code…and i tried with the electrosome ‘s udf’s this time

do
{
  UART_Write_Text("AT");
  UART_Write(0x0D);   //CR.
  UART_Write(0x0A);   //NEW LINE.
  
  delay(2000);

  if(UART_Data_Ready())
  {
    /*if(OERR)
    {
      CREN = 0;
      CREN = 1;
    }*/
    x[0]=UART_Read();
    RCREG=0;
  }
  Lcd4_Clear();
  Lcd4_Set_Cursor(1,4);
  lcd4_putch(x[0]);
  delay(500);
  Lcd4_Clear();
}while(1);
/*UDF*/
char UART_Data_Ready()
{
  return RCIF;
}

char UART_Read()
{
  while(!RCIF);
  return RCREG;
}
string(7) "9898001"