CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

I need Flexible Graphic lcd driver for 128x64

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
extreme



Joined: 21 Feb 2013
Posts: 3

View user's profile Send private message

I need Flexible Graphic lcd driver for 128x64
PostPosted: Sat Apr 20, 2013 4:30 am     Reply with quote

I need Flexible Graphic lcd driver for 128x64 glcd.
ezflyr



Joined: 25 Oct 2010
Posts: 1019
Location: Tewksbury, MA

View user's profile Send private message

PostPosted: Sat Apr 20, 2013 4:38 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Apr 22, 2013 12:34 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Apr 22, 2013 1:47 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Apr 22, 2013 4:04 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Feb 04, 2015 11:55 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Feb 04, 2015 12:00 pm     Reply with quote

Post your PIC, and post the new port that you want to use for GLCD data.
zamzam23



Joined: 25 Aug 2010
Posts: 47

View user's profile Send private message

PostPosted: Wed Feb 04, 2015 12:15 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Feb 04, 2015 1:00 pm     Reply with quote

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:
Code:
   data = input_d();         

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

View user's profile Send private message

PostPosted: Wed Feb 04, 2015 1:14 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Feb 04, 2015 3:33 pm     Reply with quote

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.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group