Using LCD on ECIO port A

For E-blocks user to discuss using E-blocks and programming for them.

Moderators: Benj, Mods

Post Reply
kidney
Flowcode V4 User
Posts: 3
Joined: Sun Nov 25, 2012 12:13 am

Using LCD on ECIO port A

Post by kidney »

Hi,

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
in a C block.

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
should be all that's needed to make port A feed LCD. However, this solution fails.

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.

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:

Re: Using LCD on ECIO port A

Post by Benj »

Hello,

I think that even though the pin is in digital mode the analogue sampling cap is connected to one of the port A pins by default and maybe slugging the rise/fall times on the output which in turn may be corrupting the data received by the LCD. Changing the ADC channel disconnects the cap. I will see about adding this extra line in by default in v6 so that others will not have this issue.

Post Reply