kichapi
Junior Member level 2
lcd display
hai some problam in my pic 16f877a lcd interface program. i used PORTA (RA0,RA1,RA5) analog pins .i connect RA5 pin battery voltage through the resister devider voltage 5v(the battery is fully charged condition ie 14Vdc) .This adc reading is correct and display the RA0 adc reading 1023v.i want to display the lcd direct battery voltage.how display the battery voltage ie (full charge condition display 14v)
how do this program please help me? iam waiting for your replay
this my adc reading program
ADCON1=0x82; //RA0,RA1,RA2,RA3,RA5, all analog pins
while(1)
{
ADCON0=0xA1; //RA5 analog input
delay();delay(); // ANALOG AQUISITATION TIME
ADGO=1;
while(ADGO==1) //WAIT TILL THE CONVERSION IS OVER
// SET ADC CHANNEL TRISA2//ADC_VALUE3//BATTERY VOLT
adc_value3=ADRESH<<8;
adc_value3=adc_value3+ADRESL;
//END OF ADC CONVERSION
command(0xC3);
for (i=1;i<=4;i++)
{
adc3=adc_value3%10;
adc_value3 =adc_value3/10;
}
for(i=4;i>=1;i--)
{
data1(adc3+'0');
}
}
}
hai some problam in my pic 16f877a lcd interface program. i used PORTA (RA0,RA1,RA5) analog pins .i connect RA5 pin battery voltage through the resister devider voltage 5v(the battery is fully charged condition ie 14Vdc) .This adc reading is correct and display the RA0 adc reading 1023v.i want to display the lcd direct battery voltage.how display the battery voltage ie (full charge condition display 14v)
how do this program please help me? iam waiting for your replay
this my adc reading program
ADCON1=0x82; //RA0,RA1,RA2,RA3,RA5, all analog pins
while(1)
{
ADCON0=0xA1; //RA5 analog input
delay();delay(); // ANALOG AQUISITATION TIME
ADGO=1;
while(ADGO==1) //WAIT TILL THE CONVERSION IS OVER
// SET ADC CHANNEL TRISA2//ADC_VALUE3//BATTERY VOLT
adc_value3=ADRESH<<8;
adc_value3=adc_value3+ADRESL;
//END OF ADC CONVERSION
command(0xC3);
for (i=1;i<=4;i++)
{
adc3=adc_value3%10;
adc_value3 =adc_value3/10;
}
for(i=4;i>=1;i--)
{
data1(adc3+'0');
}
}
}