View previous topic :: View next topic |
Author |
Message |
bwhiten
Joined: 26 Nov 2003 Posts: 151 Location: Grayson, GA
|
LC7981 and Crystalfontz display |
Posted: Thu Jan 31, 2008 9:54 am |
|
|
I'll start a new post because the old post mentions Atmel in the title
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
|
|
Posted: Thu Jan 31, 2008 12:14 pm |
|
|
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
|
|
Posted: Thu Jan 31, 2008 1:36 pm |
|
|
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
|
|
Posted: Thu Jan 31, 2008 1:45 pm |
|
|
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
|
|
Posted: Thu Jan 31, 2008 2:19 pm |
|
|
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 |
Posted: Wed May 28, 2008 3:44 pm |
|
|
bwhiten, could you please post your source code for the LC7981 display driver? |
|
|
bwhiten
Joined: 26 Nov 2003 Posts: 151 Location: Grayson, GA
|
Re: Source |
Posted: Wed May 28, 2008 3:59 pm |
|
|
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
|
Done. |
Posted: Thu May 29, 2008 9:55 am |
|
|
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 |
|
|
Lazarus Guest
|
Thanks |
Posted: Fri May 30, 2008 6:30 am |
|
|
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
|
Probably, but not tested |
Posted: Fri May 30, 2008 9:10 am |
|
|
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. |
|
|
|