Page 2 of 2

Re: GLCDs

Posted: Thu Mar 26, 2009 10:17 am
by Benj
Hello

Are you also changing the TRIS register? eg.

#define MX_CONTROL_PORT portb
#define MX_CONTROL_TRIS trisb

Re: GLCDs

Posted: Thu Mar 26, 2009 4:53 pm
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

Re: GLCDs

Posted: Thu Mar 26, 2009 5:09 pm
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.

Re: GLCDs

Posted: Fri Mar 27, 2009 12:30 pm
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...