I have designed a PIC18F877A micro controller project to read temperature from an LM35 using ADC, display it on an LCD and transmit it to a serial port.
When the program starts, sometimes it shows a startup message β sometimes it doesnβt display anything.
Also, the serial port connection is not working. Can anyone help β am I missing something? Are there any ground connections missing?
My code:
#include
#device adc=10
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20000000)
#use rs232 (baud=9600,rcv=PIN_C7, xmit=PIN_C6)
#include
float value;
float temp;
float temp2;
float temp3;
float temp4;
float temp5[14];
float count[14];
int c;
void main(void)
{//setup_adc_ports( ALL_ANALOG );//Initialize and Configure ADC
//setup_adc(ADC_CLOCK_INTERNAL );
while(1)
{
lcd_init();
lcd_gotoxy (1,1);
delay_ms(1000);
printf(lcd_putc,β WELCOME TO\n Micro Tech Sol.β);
delay_ms(3000);
lcd_gotoxy (1,1);
printf(lcd_putc,β Fuel Monitoring \n PROJECT β);
delay_ms(3000);}}
For more detail: PIC16F877A (with LCD) not working