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

Unable to draw line on glcd (T6963 controller)

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



Joined: 08 Sep 2003
Posts: 492
Location: India

View user's profile Send private message Send e-mail

Unable to draw line on glcd (T6963 controller)
PostPosted: Wed Oct 21, 2009 7:08 am     Reply with quote

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

View user's profile Send private message Visit poster's website

PostPosted: Wed Oct 21, 2009 8:27 am     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Wed Oct 21, 2009 11:14 am     Reply with quote

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

View user's profile Send private message Send e-mail

RE
PostPosted: Thu Oct 22, 2009 4:27 am     Reply with quote

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

View user's profile Send private message Send e-mail

Solved...I found the problem
PostPosted: Thu Oct 22, 2009 5:17 am     Reply with quote

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
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