I was initially having problems getting LCD show proper characters when connected to 28-pin ECIO port A. Somewhere on this forum I found a working solution that was to adjust A/D conversion using, for instance,
Code: Select all
adcon0 = 0x3D; //Analog channel select bits: unimplemented
It does indeed make the LCD work. I'd still like to understand why.
Reading the PIC18F2455 manual, I get the idea that setting
Code: Select all
adcon1=0x0F; // Configure ports as digital I/O
trisa = 0x0; // Configure pins as outputs
What I don't get is why changing input A/D converter settings makes LCD, driven by digital (right?) output, work as intended. Besides, looking at a functional C code, I can't even see trisa register being set to zero anywhere. According to the manual, the reset state for trisa is 0x7F, "all inputs".
This is really bugging me. I'd really appreciate if someone could explain it to me.