Hello
Are you also changing the TRIS register? eg.
#define MX_CONTROL_PORT portb
#define MX_CONTROL_TRIS trisb
GLCDs
- 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
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 258
- Joined: Wed Nov 29, 2006 6:32 pm
- Location: Finland
- Has thanked: 7 times
- Been thanked: 36 times
- Contact:
Re: GLCDs
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
//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
- 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
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 258
- Joined: Wed Nov 29, 2006 6:32 pm
- Location: Finland
- Has thanked: 7 times
- Been thanked: 36 times
- Contact:
Re: GLCDs
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...
So the code runs fine in portb...