summerof69.kunal
Newbie level 6
hi..
i m working with pic16f877a and lcd to display the variation of sensor voltage on lcd..
i m able to dsplay anything on lcd..but unable to interface the sensor with adc..can anybody send me the ccs coding and circuit diagram..here is my program to display an lcd..
#device adc=10
#FUSES NOWDT //No Watch Dog Timer
#FUSES HS //High speed Osc (> 4mhz)
#FUSES NOPUT //No Power Up Timer
#FUSES NOPROTECT //Code not protected from reading
#FUSES NODEBUG //No Debug mode for ICD
#FUSES BROWNOUT //Reset when brownout detected
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOCPD //No EE protection
#FUSES NOWRT //Program memory not write protected
#use delay(clock=20000000)
cmdwr()
{
output_low(PIN_d6); // Selecting command reg
output_low(PIN_d5); // LCD write
output_high(PIN_d4);
delay_ms(500);
output_low(PIN_d4);
}
datawr()
{
output_high(PIN_d6); // Selecting command reg
output_low(PIN_d5); // LCD write
output_high(PIN_d4);
delay_ms(500);
output_low(PIN_d4);
}
main()
{
while(1)
{
output_b(56); //initialisation 2 lines 5X7 matrix
cmdwr();
delay_ms(500);
output_b(56); //initialisation 2 lines 5X7 matrix
cmdwr();
delay_ms(500);
output_b(56); //initialisation 2 lines 5X7 matrix
cmdwr();
delay_ms(500);
output_b(56); //initialisation 2 lines 5X7 matrix
cmdwr();
output_b(15);//display on cursor on
cmdwr();
delay_ms(500);
output_b(1);// clear LCD
cmdwr();
delay_ms(500);
output_b(6);// shift cursor right
cmdwr();
delay_ms(500);
output_b(128);
cmdwr();
delay_ms(500);
output_b('S');// line 1 position 1
datawr();
delay_ms(500);
output_b('1');// line 1 position 2
datawr();
delay_ms(500);
output_b('=');// line 1 position 3
datawr();
delay_ms(500);
}
}
plz tell me how to interface the adc..i want to send the voltage of sensor to display the variatiom on lcd..
i m working with pic16f877a and lcd to display the variation of sensor voltage on lcd..
i m able to dsplay anything on lcd..but unable to interface the sensor with adc..can anybody send me the ccs coding and circuit diagram..here is my program to display an lcd..
#device adc=10
#FUSES NOWDT //No Watch Dog Timer
#FUSES HS //High speed Osc (> 4mhz)
#FUSES NOPUT //No Power Up Timer
#FUSES NOPROTECT //Code not protected from reading
#FUSES NODEBUG //No Debug mode for ICD
#FUSES BROWNOUT //Reset when brownout detected
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOCPD //No EE protection
#FUSES NOWRT //Program memory not write protected
#use delay(clock=20000000)
cmdwr()
{
output_low(PIN_d6); // Selecting command reg
output_low(PIN_d5); // LCD write
output_high(PIN_d4);
delay_ms(500);
output_low(PIN_d4);
}
datawr()
{
output_high(PIN_d6); // Selecting command reg
output_low(PIN_d5); // LCD write
output_high(PIN_d4);
delay_ms(500);
output_low(PIN_d4);
}
main()
{
while(1)
{
output_b(56); //initialisation 2 lines 5X7 matrix
cmdwr();
delay_ms(500);
output_b(56); //initialisation 2 lines 5X7 matrix
cmdwr();
delay_ms(500);
output_b(56); //initialisation 2 lines 5X7 matrix
cmdwr();
delay_ms(500);
output_b(56); //initialisation 2 lines 5X7 matrix
cmdwr();
output_b(15);//display on cursor on
cmdwr();
delay_ms(500);
output_b(1);// clear LCD
cmdwr();
delay_ms(500);
output_b(6);// shift cursor right
cmdwr();
delay_ms(500);
output_b(128);
cmdwr();
delay_ms(500);
output_b('S');// line 1 position 1
datawr();
delay_ms(500);
output_b('1');// line 1 position 2
datawr();
delay_ms(500);
output_b('=');// line 1 position 3
datawr();
delay_ms(500);
}
}
plz tell me how to interface the adc..i want to send the voltage of sensor to display the variatiom on lcd..