Couple quick questions. T6963C GLCD related.

Discuss PIC and electronic related things

Moderators: David Barker, Jerry Messina

Post Reply
hgboy
Posts: 25
Joined: Wed Aug 13, 2008 9:35 pm
Location: Dayton, OH

Couple quick questions. T6963C GLCD related.

Post by hgboy » Fri Jan 30, 2009 3:48 am

I have finally gotten around to programming my GLCD, thanks to octal's driver. I have a few questions about it though. First, I see an initialize subprocedure in the code explorer, is this something I have to run in my code, or is it handled automatically?
Second, is there a subroutine for displaying a bitmap image? If not, how could I go about doing this?
And finally, I see the default size screen is 240x128. Is it possible to use an option command or something similar to adjust this for different displays?
Sorry for all the questions, I am still trying to learn BASIC, so bear with me :)

nigle
Registered User
Registered User
Posts: 36
Joined: Tue Aug 12, 2008 3:13 pm
Location: West London

Re: Couple quick questions. T6963C GLCD related.

Post by nigle » Fri Jan 30, 2009 3:08 pm

hgboy wrote:I see an initialize subprocedure in the code explorer, is this something I have to run in my code, or is it handled automatically?
In all the other drivers, this is done automatically, I would expect the T6963 driver to behave the same (I haven't downloaded it to check).
hgboy wrote:Second, is there a subroutine for displaying a bitmap image?
See SetImage in the help file.
hgboy wrote: And finally, I see the default size screen is 240x128. Is it possible to use an option command or something similar to adjust this for different displays?
It is hard coded in the drivers, if your display is of a lower resolution then it shouldn't matter. If you need a higher resolution ( I can't remember if the T6963 even supports this ) then the driver would need to be changed. Note that just changing the declares probably won't work.

hgboy
Posts: 25
Joined: Wed Aug 13, 2008 9:35 pm
Location: Dayton, OH

Post by hgboy » Fri Jan 30, 2009 4:13 pm

It is hard coded in the drivers, if your display is of a lower resolution then it shouldn't matter. If you need a higher resolution ( I can't remember if the T6963 even supports this ) then the driver would need to be changed. Note that just changing the declares probably won't work.
So, if I am using a smaller screen, I just make sure to keep all of my locations in a valid space and everything should work ok?

And also, for SetImage, I understand the basic principles of how it works, my next question is how do I declare a variable to hold the image data to pass to SetImage? Can you recommend any beginner friendly software to convert a bitmap into useful data?

User avatar
octal
Registered User
Registered User
Posts: 586
Joined: Thu Jan 11, 2007 12:49 pm
Location: Paris IDF
Contact:

Post by octal » Fri Jan 30, 2009 4:22 pm

If you open the module you can see that at the end, after the initialize sub there is a line "Initialize()" that calls the sub. this is called automatically when you include the module somewhere in your main prog or in other modules

Code: Select all

  'Command(T6963_DISPLAY_MODE  Or T6963_GRAPHIC_DISPLAY_ON ) 
  Command(T6963_MODE_SET Or 0)
  ClearGraphic()
  ClearText()
End Sub

Initialize()

For the width and height, this is not a religious text, open the sources of the module and change the constants

Code: Select all

Public Const
   GLCDWidth = 240,
   GLCDHeight = 128
You can also add a couple of OPTION statements (as is done in some other modules, see the "Modified KS0108 module that handles 3 CS lines on the modules page)
see

Code: Select all

#option GLCD_SCREEN_WIDTH = 128  // Screen Width in Pixels
#option GLCD_SCREEN_HEIGHT = 64  // Screen Height in Pixels
...
Public Const
   GLCDWidth = GLCD_SCREEN_WIDTH,
   GLCDHeight = GLCD_SCREEN_HEIGHT,

BUT you must be carefull, even if your display has only 32x32 pixels, some T6963c drivers still continue to handle a physical 240x128 sized screen, and your physical display is a simply a sub-window in the whole display. You have to check your datasheet (because changing these constants means also changing pixels address calculations).

For the Imagedrawing, it's a matter or loading the sample provided with Swordfish for Nokia display, change the include for the module, and compile and test !
Last edited by octal on Fri Jan 30, 2009 4:40 pm, edited 1 time in total.

nigle
Registered User
Registered User
Posts: 36
Joined: Tue Aug 12, 2008 3:13 pm
Location: West London

Post by nigle » Fri Jan 30, 2009 4:36 pm

hgboy wrote:So, if I am using a smaller screen, I just make sure to keep all of my locations in a valid space and everything should work ok?
I haven't read the datasheet for that particular controller, but from what I have read in those of other controllers, yes. I would be surprised if the T6963 was any different.
hgboy wrote:And also, for SetImage, I understand the basic principles of how it works, my next question is how do I declare a variable to hold the image data to pass to SetImage? Can you recommend any beginner friendly software to convert a bitmap into useful data?
I haven't looked into that yet, but will be some time next week. There is a plugin for this in the Wiki that was written for the S1D15G00, I have no idea if it can be used for other drivers as it won't run on my machine. If necessary, I will write one!

hgboy
Posts: 25
Joined: Wed Aug 13, 2008 9:35 pm
Location: Dayton, OH

Post by hgboy » Fri Jan 30, 2009 5:08 pm

Thanks for all of the advice. I think I have my code all figured out, and it all compiles ok. I just made a small module that holds one constant array of bytes, and put in the information that a bitmap converter spit out, then included it in my main program. I won't be able to test it for a while, as I still need to make a cable to connect my glcd to a breadboard (it uses the 2x10 pin layout. Not exactly breadboard friendly).

Edit: One thing I forgot to ask about, the pin layout. Can I change this to other port pins without it harming anything? I would like to use port B for my data, and a mix of port C and D for the control lines. Also, how should these pins be configured (inputs or outputs?). I would just use SetAllDigital() but for the fact that I need to use 3 ADC channels for this project as well, and still don't fully understand the configuration required yet.

nigle
Registered User
Registered User
Posts: 36
Joined: Tue Aug 12, 2008 3:13 pm
Location: West London

Post by nigle » Fri Jan 30, 2009 5:31 pm

hgboy wrote:One thing I forgot to ask about, the pin layout. Can I change this to other port pins without it harming anything?
Yes, the driver doesn't care what pins you use as long as they aren't some of the strange input only ones that some PICs have. The relevant #option declarations (and their defaults) are:

Code: Select all

#option GLCD_DATA = PORTD        // data port
#option GLCD_CE  = PORTC.3        // chip Enable
#option GLCD_RD  = PORTC.5        // RD pin
#option GLCD_RW  = PORTC.4        // RW pin 
#option GLCD_CD  = PORTC.6        // Command/Data   High=Cmd , Low=Data
#option GLCD_RST = PORTC.7       // reset pin
hgboy wrote: Also, how should these pins be configured (inputs or outputs?).
The driver will configure that for you.

Post Reply