GLCDs

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

Moderators: Benj, Mods

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: GLCDs

Post by Benj »

Hello

Are you also changing the TRIS register? eg.

#define MX_CONTROL_PORT portb
#define MX_CONTROL_TRIS trisb

Mikat
Posts: 258
Joined: Wed Nov 29, 2006 6:32 pm
Location: Finland
Has thanked: 7 times
Been thanked: 36 times
Contact:

Re: GLCDs

Post by Mikat »

Yes,there is copy the c code...
//Common defines
#define MX_DATA_PORT portd
#define MX_DATA_TRIS trisd
#define MX_CONTROL_PORT portb
#define MX_CONTROL_TRIS trisb
#define MX_CS1 3
#define MX_CS2 4
#define MX_DAT_INST 7
#define MX_ENABLE 5
#define MX_READ_WRITE 6

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: GLCDs

Post by Benj »

Hello

Just to confirm you are changing the Custom Component LCD driver code and not the C code that comes out of Flowcode as this gets overwritten when you recompile.

Shouldn't be a problem with using portB as the C code is simply setting and clearing bits in the specified register. Eg if PortC is working then there is no reason that PortB should not work.

One thing to look out for is to ensure that you have low voltage programming disabled in the expert chip configuration settings. If LVP is enabled then it consumes one of the PortB pins making it unavailable for I/O purposes.

Also note that the port is numbered from 0 to 7 just incase you are assigning RB0 the value of 1 etc.

Mikat
Posts: 258
Joined: Wed Nov 29, 2006 6:32 pm
Location: Finland
Has thanked: 7 times
Been thanked: 36 times
Contact:

Re: GLCDs

Post by Mikat »

I find the problem,i had 2 control lines in broken traces in my pcb,so that lakes the control pins float,i just didnt see those in bare eyes...
So the code runs fine in portb...

Post Reply