View previous topic :: View next topic |
Author |
Message |
extreme
Joined: 21 Feb 2013 Posts: 3
|
I need Flexible Graphic lcd driver for 128x64 |
Posted: Sat Apr 20, 2013 4:30 am |
|
|
I need Flexible Graphic lcd driver for 128x64 glcd. |
|
|
ezflyr
Joined: 25 Oct 2010 Posts: 1019 Location: Tewksbury, MA
|
|
Posted: Sat Apr 20, 2013 4:38 pm |
|
|
Hi,
That's not enough information. Post a link to the specific GLCD you are planning to use, or at least tell us which GLCD driver chip it uses (eg. KS0108)
John |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Apr 22, 2013 12:34 pm |
|
|
Assuming you're using a GLCD that is compatible with the CCS glcd.c
driver, then you basically already have a "flex" type driver.
In glcd.c, it uses PortD for the data, but all the control pins are "flex" pins.
You can edit the pin definition statements below and change them to
any suitable i/o pin.
Code: |
#define GLCD_CS1 PIN_B0 // Chip Selection 1
#define GLCD_CS2 PIN_B1 // Chip Selection 2
#define GLCD_DI PIN_B2 // Data or Instruction input
#define GLCD_RW PIN_B4 // Read/Write
#define GLCD_E PIN_B5 // Enable
#define GLCD_RST PIN_C0 // Reset
|
You really don't want to change the data port (currently hard-coded to
PortD) to be mixed pins instead of a complete port, because it would
be too slow to update it. |
|
|
extreme
Joined: 21 Feb 2013 Posts: 3
|
|
Posted: Mon Apr 22, 2013 1:47 pm |
|
|
thank you.
Last edited by extreme on Thu Apr 25, 2013 5:01 am; edited 1 time in total |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1934 Location: Norman, OK
|
|
Posted: Mon Apr 22, 2013 4:04 pm |
|
|
You are not supposed to post CCS drivers in the forum. _________________ Google and Forum Search are some of your best tools!!!! |
|
|
zamzam23
Joined: 25 Aug 2010 Posts: 47
|
|
Posted: Wed Feb 04, 2015 11:55 am |
|
|
I want to change data pins too.
On the D port, I have to use i2c and spi mods. so I have to change glcd data pins.
How can find this driver for my project?
thanks. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Feb 04, 2015 12:00 pm |
|
|
Post your PIC, and post the new port that you want to use for GLCD data. |
|
|
zamzam23
Joined: 25 Aug 2010 Posts: 47
|
|
Posted: Wed Feb 04, 2015 12:15 pm |
|
|
I am using 18f46k22 and I want to use these pins:
DATA 0: RB0
DATA 1: RB1
DATA 2: RB2
DATA 3: RB3
DATA 4: RE0
DATA 5: RE1
DATA 6: RE2
DATA 7: RA1 |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Feb 04, 2015 1:00 pm |
|
|
In this routine, in GLCD.c, you need to replace the output_d(data) line
with a new routine that will write data to the pins given in your post.
Quote: | void glcd_writeByte(char chip, BYTE data)
{
.
.
.
output_d(data); // Put the data on the port
.
.
.
} |
Replace it with this new routine:
Code: | void output_data(int8 data)
{
if(bit_test(data, 0))
output_high(PIN_B0);
else
output_low(PIN_B0);
.
.
.
} |
You also have to modify the glcd_readByte() routine.
It has a line that reads a byte:
You will need to substitute a new routine for that.
Code: | int8 input_data(void)
{
int8 data;
.
// Read each i/o pin and set a bit in data to the
// value read on the pin.
.
.
return(data);
} |
But don't expect this modified driver to be very fast. |
|
|
zamzam23
Joined: 25 Aug 2010 Posts: 47
|
|
Posted: Wed Feb 04, 2015 1:14 pm |
|
|
if I use portB instead of portD, which changes to be need?
Means:
DATA 0: RB0
DATA 1: RB1
DATA 2: RB2
DATA 3: RB3
DATA 4: RB4
DATA 5: RB5
DATA 6: RB6
DATA 7: RB7 |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Feb 04, 2015 3:33 pm |
|
|
In the glcd_writeByte() routine, change it from output_d() to output_b().
In the glcd_readByte() routine, there are two places where you need to
change it from input_d() to input_b().
In the glcd.c file, five (5) of the command signals are on PortB. For
example, CS1 and CS2, etc. So these command signals will have to
be put on different pins, if you are using PortB for the GLCD data bus. |
|
|
|