ECIO40P Port A Problem

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

Moderators: Benj, Mods

Post Reply
adrianxyz
Posts: 9
Joined: Mon May 10, 2010 12:58 pm

ECIO40P Port A Problem

Post by adrianxyz »

I'm using an ECIO40P mounted on an ECIO Base Board with a keypad (EB014) connected to port D and an LCD (EB005) connected to port B. My program displays the ASCII code for any key pressed on the LCD - the program works. When I move the LCD to port A and alter the flowcode connections dialog to reflect the change, the program no longer works. Key presses no longer appear on the LCD. Any ideas what I'm doing wrong ?

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: ECIO40P Port A Problem

Post by Benj »

Hello,

Can you get anything on to the LCD? Eg can you print out some static text or is the LCD not working at all. I'll rig up a ECIO here and see if I can find the problem. Looking at the device datasheet the lower 6 pins of PortA should work fine with the LCD.

adrianxyz
Posts: 9
Joined: Mon May 10, 2010 12:58 pm

Re: ECIO40P Port A Problem

Post by adrianxyz »

Hi
The first thing the program does before it accepts keypad entry is to display an initialisation confirmation message.
This does not appear.
I've also checked all the connexions from the ECIO40P's 40 pin socket to the port A 9 way D socket & they are all OK.
The Ov connection is also OK.
There are no bent pins on the the ECIO40P module & the module is correctly located in its 40 pin socket.
The program simulates OK with the LCD connected to either Port B or port A.

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: ECIO40P Port A Problem

Post by medelec35 »

I must admit i have not used ECIO40P, but if it was me then I would use flowcode to toggle the whole A port at about 1 second, then use a meter and measure voltage to check each pin is toggling at 1 sec interval. Could one of the pins be open drain, hence require a pull up resistor? You could try a pull up resistor on a pin, if does not toggle. I am assuming the internal osc is used? So it wont be an external osc connected to one of the RA pins? Sorry if none of this helps, as I am only guessing.
Martin

adrianxyz
Posts: 9
Joined: Mon May 10, 2010 12:58 pm

Re: ECIO40P Port A Problem

Post by adrianxyz »

Thanks for the input medelec35.
Tried the "oscillating port " trick and all 6 bits of port A work OK without pull ups.
The LCD on port A still doesn't function though.
Question for moderator - as all the hardware appears to work, is flowcode initialsing port A correctly when its connexions dialog defines a connexion to port A ?

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: ECIO40P Port A Problem

Post by Benj »

Hello,

Im a little stumped by this one. I have setup the hardware here and confirmed the problems with PortA on the ECIO40P. As you say all of the I/O is working correctly.

I have checked that both the analogue functionality is switched off as well as the comparitor functionality so it is not this causing the problem.

I have also checked the hardware behind the PortA pins and they all seem to be capable of sourcing enough current so this is not the problem.

I'll have a think on it and get back to you if anything jumps to mind.

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

Re: ECIO40P Port A Problem

Post by Steve »

Could it be the setting of UTRDIS to 1 by the initialisation statements in the FCD file? This might cause the RA4 pin to have the RCV function.

A quick check is to put the following statement into a C icon at the beginning of your flowchart:

Code: Select all

ucfg = 0x00;

adrianxyz
Posts: 9
Joined: Mon May 10, 2010 12:58 pm

Re: ECIO40P Port A Problem

Post by adrianxyz »

Tried the ucfg = 0x00; C block at the top of the flowchart.
Unfortunately this doesn't make any difference.

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

Re: ECIO40P Port A Problem

Post by Steve »

Ok, I believe I've found a workaround to this problem. But I'm still a little unclear as to what causes the problem in the first place.

Firstly, the workaround is to add the following C code at the beginning of the flowchart:

Code: Select all

adcon0 = 0x3c;
This sets the channel of the ADC module to be "unimplemented" rather than AN0 (i.e. bit 0 of PORTA). The ADC module is off and this should not be needed. However, with the default value of adcon0=0x00 pin A0 does not work with the LCD code (although strangely enough, it does work in other circumstances).

Even more strange, I set up some hardware so that PORTA connected to one LCD and PORTB connected to another. Without this "fix", the LCD on PORTA did not work but the one on PORTB did. But if I changed the connection settings in Flowcode so that LCD(A) had DATA0 connected to B0 and LCD(B) had DATA0 connected to A0, then both LCDs worked.

I really don't know what is causing this issue, but at least I have found a workaround.

Post Reply