Connecting an LCD on PORTA

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
PINTO
Flowcode v5 User
Posts: 71
Joined: Fri Nov 03, 2006 2:28 pm
Location: RSA
Been thanked: 1 time
Contact:

Connecting an LCD on PORTA

Post 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

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Post 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.

PINTO
Flowcode v5 User
Posts: 71
Joined: Fri Nov 03, 2006 2:28 pm
Location: RSA
Been thanked: 1 time
Contact:

LCD on PortA

Post 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

User avatar
Steve
Matrix Staff
Posts: 3422
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times
Contact:

Post by Steve »

Yes, Pinto.

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

Post Reply