Page 1 of 1

Connecting an LCD on PORTA

Posted: Thu Jan 18, 2007 5:39 pm
by PINTO
Hi Benj,
I've tried to connect a LCD display on PORTA of Pic877 and didn't work.
It simulated ok on FC3 but when I loaded into Proteus didn't work.
I tried on other ports and worked ok.
I'm not sure if there's something else that as to be set on PortA.
I looked into the 877 data sheet but I'm nor sure how to set the bits.

Appreciated.

Pinto

Posted: Fri Jan 19, 2007 11:21 am
by Benj
Hello Pinto

Try using this code in a C Code block.

Code: Select all

adcon1 = 0x07;
adcon0 = 0x80;
It should disable the analogue function of the PORT A pins.
Have you tested with hardware or just via the proteus simulation tool.

LCD on PortA

Posted: Fri Jan 19, 2007 1:42 pm
by PINTO
Hi Benj,
I tried your code and still didn't work. The problem was that RA4 is an open source and wasn't pulled it up to the Vdd.
I connected an 100k between RA4 and the Vdd and the LCD worked.
I than removed the C code box from FC3 and re-compiled the program loaded on the simulator and worked as well.
It appear that FC3 automactically changes the configuration from analog to digital I/O when it sees an I/O macro connected to it. Am I Right?

Thanks


Pinto

Posted: Fri Jan 19, 2007 3:21 pm
by Steve
Yes, Pinto.

Flowcode automatically sets all i/o to be digital at the start of each program.