lcd / black vertical bars
Hello, Im building a digital thermometer from a youtube tutorial. The simulation on Proteus 8 instead of showing the value from the temperature sensor it shows some black vertical bars all over the lcd screen. Im using the pic18f2580 and mplab x ide v5.25 and xc8 compiler v1.34 and proteus 8 and for lcd the LM016L. The code compiles normally but the problem is on proteus. The code Im using is:
#include <stdio.h>
#include <stdlib.h>
#include "p1.h"
void Initialize_ADC(void);
void Initialize_LCD(void);
void DelayFor18TCY(void);
void DelayPORXLCD(void);
void DelayXLCD(void);
unsigned int ADCResult=0;
float voltage;
unsigned char ResultString[20];
void main(void)
{
OSCCON= 0x76;
Initialize_ADC();
Initialize_LCD();
while(1)
{
ConvertADC();
while(BusyADC());
ADCResult= ReadADC();
voltage= (ADCResult*5.0)/1024;
putrsXLCD("Temp is: ");
sprintf(ResultString, "%f", voltage );
putrsXLCD(ResultString);
putrsXLCD(223);
putrsXLCD("C");
putrsXLCD(" ");
WriteCmdXLCD(0x02);
}
}
void Initialize_ADC(void)
{
OpenADC(ADC_FOSC_2 & ADC_RIGHT_JUST & ADC_2_TAD , ADC_CH0 & ADC_INT_ON & ADC_REF_VDD_VSS, ADC_1ANA);
}
void Initialize_LCD(void)
{
OpenXLCD(FOUR_BIT & LINES_5X7);
while(BusyXLCD());
WriteCmdXLCD(0x06);
WriteCmdXLCD(0x0C);
putrsXLCD("Digital");
SetDDRamAddr(0x40);
putrsXLCD("Thermometer...");
for(int x=0; x<=20; x++)__delay_ms(50);
WriteCmdXLCD(0x01);
}
void DelayFor18TCY(void)
{
Delay10TCYx(20);
}
void DelayPORXLCD(void)
{
Delay1KTCYx(30);
}
void DelayXLCD(void)
{
Delay1KTCYx(10);
}
THANK YOU IN ADVANCE !!!!