HI, i'm designing a telemetry to measure temperature and resistivity from a remote station using sensor LM35, PIC16F877A and LCD, but after connection and running my code i'm not getting any display on my LCD, I have attached my remote code please advice.
my remote code
#include "include.h"
// Configuration word for PIC16F877
//__CONFIG( FOSC_HS & WDTE_OFF & PWRTE_ON & CP_OFF & BOREN_ON
// & LVP_OFF & CPD_OFF & WRT_ON & DEBUG_OFF);
unsigned int voltage=0;
unsigned long int temperature=0;
unsigned long int resistivity=0;
unsigned int temp=0;
// Main Function
void main(void)
{
TRISB=0;
InitUART(9600);
ADC_Init();
//InitLCD();
Lcd4_Init();
// Intialize UART
// SendStringSerially("TELEMETRY"); // Send string on UART
//SendByteSerially('$');
GIE = 1; // Enable global interrupts
PEIE = 1; // Enable Peripheral Interrupts
while(1)
{
// Do nothing, as Received character is echoed back in the ISR
// If you decide to disable interrupts, then you can
// echo back characters by uncommenting the line below
// SendByteSerially(ReceiveByteSerially()); //Echo Back
temperature=ADC_Read(AN1);
Lcd4_Clear();
//ClearLCDScreen();
Lcd4_Set_Cursor(0,0);
Lcd4_Write_String("temp=");
//WriteStringToLCD("TEMP=");
__delay_ms(2);
SendByteSerially('$');
temperature= (temperature*500)>>10;
resistivity=( temperature+100)*3;
temp = temperature / 100;
SendByteSerially(temp+48);
Lcd4_Write_Char(temp+48);
//WriteDataToLCD(temp+48);
__delay_ms(5);
temp = (temperature / 10) % 10;
SendByteSerially(temp+48);
//WriteDataToLCD(temp+48);
Lcd4_Write_Char(temp+48);
__delay_ms(5);
temp = temperature % 10;
SendByteSerially(temp+48);
//WriteDataToLCD(temp+48);
Lcd4_Write_Char(temp+48);
Lcd4_Write_String("*C");
SendByteSerially(',');
__delay_ms(5);
////////////////////////////////////////////////////////////
Lcd4_Set_Cursor(2,0);
Lcd4_Write_String("Res=");
//SendByteSerially(',');
temp = resistivity / 1000;
SendByteSerially(temp+48);
Lcd4_Write_Char(temp+48);
__delay_ms(10);
temp = (resistivity / 100) % 100;
SendByteSerially(temp+48);
Lcd4_Write_Char(temp+48);
__delay_ms(10);
temp = (resistivity / 10) % 10;
SendByteSerially(temp+48);
Lcd4_Write_Char(temp+48);
__delay_ms(10);
temp = resistivity % 10;
SendByteSerially(temp+48);
Lcd4_Write_Char(temp+48);
Lcd4_Write_String(" U OHM");
//////////////////////////////////////////////////////////////////
SendByteSerially('#');
SendByteSerially('\r');
SendByteSerially('\n');
__delay_ms(5);
}
}