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 support@ccsinfo.com

LC7981 and Crystalfontz display

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



Joined: 26 Nov 2003
Posts: 151
Location: Grayson, GA

View user's profile Send private message

LC7981 and Crystalfontz display
PostPosted: Thu Jan 31, 2008 9:54 am     Reply with quote

I'll start a new post because the old post mentions Atmel in the title Smile
I am using a PIC 16F887 and a 160 x 80 Crystalfontz display. I have the LC7981 spec. but just checking to see if any one here has converted one of the drivers from the library to match the LC7981 signal polarities and such for sanity check. I am doing a compare to the Extended GLD now but any jump start of say the init function would help greatly.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Jan 31, 2008 12:14 pm     Reply with quote

The CrystalFontz forum has a lot of help on this.
See this thread:
http://www.crystalfontz.com/forum/showthread.php?t=3466
Download the zip file that he recommends.

Then look for the OnInitialize function in this file:
Quote:
cfag_wintestdlg.cpp


It has the full list of registers and values that you need to program
in order to initialize the LCD. You have to convert it to CCS, but at
least you have the init values.
bwhiten



Joined: 26 Nov 2003
Posts: 151
Location: Grayson, GA

View user's profile Send private message

PostPosted: Thu Jan 31, 2008 1:36 pm     Reply with quote

Thanks PCM. As you say, that does give me a sequence and register values. The timing looks simple enough and I don't think I will need to monitor the Busy Flag since my bit banging will be quite slower than the minimum/maximum timing parameters given.

Probably an old question but what basic driver functions are needed to be able to use the graphics.c and other files found on the forum?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Jan 31, 2008 1:45 pm     Reply with quote

If you need another example, here's some source code:
http://www.frozeneskimo.com/samsunglcd/avr-lc7981-v1/lc7981.c
This could be translated to CCS. Or at least, you could use it as
a guide, while modifying the glcd.c driver. That might be the best
way to do it.


I looked at glcd.c and graphics.c, and it looks like glcd.c has all the
routines that are in graphics.c. If you're going to use glcd.c or a
slightly modified version of it, then you probably don't need graphics.c.
Code:

glcd_pixel(x,y,color)                                       
glcd_line(x1,y1,x2,y2,color)                                   
glcd_rect(x1,y1,x2,y2,fill,color)                             
glcd_bar(x1,y1,x2,y2,width,color)                             
glcd_circle(x,y,radius,fill,color)     

All of these higher level routines call the basic glcd_pixel() routine.
So if you did want to use graphics.c, then you need to implement
the glcd_pixel() routine.
bwhiten



Joined: 26 Nov 2003
Posts: 151
Location: Grayson, GA

View user's profile Send private message

PostPosted: Thu Jan 31, 2008 2:19 pm     Reply with quote

That code link looks excellent and directly applicable. I should be able to recreate the GLCD.c driver pretty easily with this for the LC7981 and CCS. I'll post it to the Code Library if it works out.
Thanks again.
Lazarus
Guest







Source
PostPosted: Wed May 28, 2008 3:44 pm     Reply with quote

bwhiten, could you please post your source code for the LC7981 display driver?
bwhiten



Joined: 26 Nov 2003
Posts: 151
Location: Grayson, GA

View user's profile Send private message

Re: Source
PostPosted: Wed May 28, 2008 3:59 pm     Reply with quote

Lazarus wrote:
bwhiten, could you please post your source code for the LC7981 display driver?


I'll try and get it into the Code Library today.
bwhiten



Joined: 26 Nov 2003
Posts: 151
Location: Grayson, GA

View user's profile Send private message

Done.
PostPosted: Thu May 29, 2008 9:55 am     Reply with quote

Hopefully it will help you. There are some functions there that are included but not documented well, for using the internal character ROM of the display. There are not documented well but I will try to edit that post to clean up the crap Exclamation
Lazarus
Guest







Thanks
PostPosted: Fri May 30, 2008 6:30 am     Reply with quote

Thanks for the code! Is it limited to 160x80 or can i use i with my 240x128 display too?
bwhiten



Joined: 26 Nov 2003
Posts: 151
Location: Grayson, GA

View user's profile Send private message

Probably, but not tested
PostPosted: Fri May 30, 2008 9:10 am     Reply with quote

I would think with simple adjustments to the parameters for LCD width and LCD height it should be fine. As far as I can tell your bigger display still only uses one chip set.
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