|
|
View previous topic :: View next topic |
Author |
Message |
arunb
Joined: 08 Sep 2003 Posts: 492 Location: India
|
Unable to draw line on glcd (T6963 controller) |
Posted: Wed Oct 21, 2009 7:08 am |
|
|
Hi,
PCH: 4.073
I am using a 18F4620 and a 240x128 graphical LCD (type: GDM240128B.....http://www.xmocular.com/upload_img/2007110153232813.pdf), this uses the T6963 toshiba controller.
LCD data port is at portB, the other control pins are connected to portA
I was able to implement Treitmey's driver for the T6963...see http://www.ccsinfo.com/forum/viewtopic.php?t=19957&highlight=graphical+lcd
I also implemented a glcd_pixel() function and was able to do the following
1. set a pixel at each corner of the screen..at (0,0), (239,0), (0,127) and (239,127) etc.
2. Print character at specific locations
3. The example code (drawing a black square) in the driver file also worked
I used the glcd_line() function in the graphic.c file shown below..
Code: |
glcd_line(0,0,239,0,0,1);
this drew a line from o to around 20 pixels
glcd_line(0,0,153,0,0,1);
this drew a line from 0 to 103 pixels (ie: 103,0)
|
strangely the glcd_circle function works very well..also I could set each pixel after 103 to 239 by continously incrementing x position and then calling glcd_pixel()..
Please explain what's wrong...???
thanks
arunb |
|
|
treitmey
Joined: 23 Jan 2004 Posts: 1094 Location: Appleton,WI USA
|
|
Posted: Wed Oct 21, 2009 8:27 am |
|
|
You say glcd_line function doesn't work.
But you don't show what that function is.
It is not in the link.
Will you show me that code? |
|
|
arunb
Joined: 08 Sep 2003 Posts: 492 Location: India
|
|
Posted: Wed Oct 21, 2009 11:14 am |
|
|
Actually now I am not in my workplace now. The glcd line function can be found in the graphics.c file in the picc/drivers folder.
If you still need that function I can post it tomorrow first thing in the morning.
Is the problem due to the fact that the lcd module is 240x125 and not 240x64?
Thanks
arunb |
|
|
arunb
Joined: 08 Sep 2003 Posts: 492 Location: India
|
RE |
Posted: Thu Oct 22, 2009 4:27 am |
|
|
Ok here is the code for the glcd_pixel function...
Code: |
void glcd_pixel(int16 x,int16 y,int1 color)
{
int8 r=0,c=0;
c=color;
r=fmod(x,8);
glcd_cmd16bits(0x24,GraphicsHome+(y*GraphicsArea+(x/8))); //set the location
glcd_cmd0(0xF0|(c<<3)|(7-r));
}
|
I am keeping MD2, CE and FS low.
I found that to draw a 239 pixel long line (horizontal) I need to draw a line from 0 to 127 and then from 127 to 239, ie : Line1= (0,0) to (127,0) and Line2= (127,0) to (239,0)..the code is given below
Code: |
glcd_line(0,0,127,0,1); //Line 1
glcd_line(127,0,239,0,1); //Line2
|
Is the display divided into two screen s of 127 pixels ???
please explain....
thanks
arunb |
|
|
arunb
Joined: 08 Sep 2003 Posts: 492 Location: India
|
Solved...I found the problem |
Posted: Thu Oct 22, 2009 5:17 am |
|
|
Finally I found the problem, I had not defined LARGE_LCD in the graphics.c file.
Thank you treitmey for the help, the driver now works beautifully....
thanks
arunb |
|
|
|
|
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
|