I just checked the .txt file. I didn't download the .rar file.
PORTA is set a output but RA0 is used for ADC and so TRISA should be 0x01.
In LCD strobe define add 500 us delay between
Code C - [expand] |
1
| LCD_EN = 1 and LCD_EN = 0 |
I didn't check ADCON0 and 1 configuration as you have not mentioned the PIC and Fosc you are using.
If only RA0/AN0 is used for ADC then you have to choose ADCON1 option such that all other PORTA pins are digital I/O type because you are using other pins for LCD (RS, RW, EN).
Your code executes only once and stucks in empty for(;
loop and so ADC value is read only once and displayed once. ADC read and LCD display related codes should be inside for(;
loop.
Also the CONFIG words are not set in code and it is set in IDE and I am sure WDT is enabled which is resetting the microcontroller and hence the display flickers and it is also the reason you are able to read the ADC value if it changes (when you change ADC input the MCU resets due to WDT and then new ADC value is being read otherwise the ADC value would never change after stucking at empty for(;
loop). In IDE disable WDT and see - your ADC value will not change after reading once.