KS0713 GLCD module - doesn't support 128x64 screens?

Coding and general discussion relating to user created compiler modules

Moderators: David Barker, Jerry Messina

Post Reply
Russ1
Posts: 4
Joined: Mon Apr 07, 2008 9:19 am
Location: California

KS0713 GLCD module - doesn't support 128x64 screens?

Post by Russ1 » Mon Apr 07, 2008 9:32 am

I'm using a KS0713 controlled glcd with 128x64 resolution. I'm assuming it has two on-board chips, because it has two chip select lines - CS1B and CS2. But the KS0713 module only has one chip select option.

What do I do?
Last edited by Russ1 on Mon Apr 07, 2008 9:51 am, edited 1 time in total.

Russ1
Posts: 4
Joined: Mon Apr 07, 2008 9:19 am
Location: California

Post by Russ1 » Mon Apr 07, 2008 9:49 am

Here's the datasheet for the glcd I'm using:

http://www.crystalfontz.com/products/12 ... AP1TFH.pdf


The two chip select lines have me confused :oops:. The KS0713 module only accounts for one select line:

Code: Select all

Module KS0713

// import the graphics module...
#DEFINE GLCD_PIXEL_01
#DEFINE GLCD_COLOR_01
#DEFINE GLCD_XY_08
Include "Graphics.bas"
Include "system.bas"  

// default module options - user options can override these values...
#option GLCD_DATA = PORTD        // Data port
#option GLCD_RS = PORTE.2        'modified for KS0713, Data Or command
#option GLCD_EN = PORTE.0        // EN pin
#option GLCD_RW = PORTC.0        // RW pin
#option GLCD_CS1 = PORTE.1       // chip Select
#option GLCD_RST = PORTC.1       // reset
#option GLCD_ASPECT_RATIO = 100  'modified For KS0713, aspect ratio, smaller number will squeeze y For GLCD circles And Box
#option GLCD_INIT_DELAY = 100    // initialisation delay (ms)
#option GLCD_FLIP_DISPLAY=False  'normal display mode(not upsidedown)

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Post by David Barker » Mon Apr 07, 2008 10:10 am


Russ1
Posts: 4
Joined: Mon Apr 07, 2008 9:19 am
Location: California

Post by Russ1 » Mon Apr 07, 2008 8:29 pm

That's what I'm using! That's were I copied the above code from. But the single CS line is confusing me. How can it support 128x64 with one chip? I thought each chip controlled 128x32, so you need to use two in union to create 128x64 screens.

Doj
Posts: 362
Joined: Wed Apr 11, 2007 10:18 pm
Location: East Sussex

Post by Doj » Tue Apr 08, 2008 1:47 am

Hello Russ, I wrote the KS0713 module but only used it with the display mentioned in my article on the WiKi.
What you will need to do is what I did and study the datasheet very carefully and look at all the other GLCD driver modules for inspiration as to how you can swich the two lines and when to do it.

It sounds pretty simple, if its got 2 chips and each one has a select line it seems logical that one will do the top half of the screen and the other does the bottom, or left and right halves I do not know.
If you print to it using just one CS connected it will give you a clue where to go next.

This module was the first code I ever wrote in SF to see if I could get on with it and it was a great learning curve after a few stumbling blocks, I now use SF exclusively on all 18 series PICs.

Good luck.

Russ1
Posts: 4
Joined: Mon Apr 07, 2008 9:19 am
Location: California

Post by Russ1 » Tue Apr 08, 2008 5:13 am

Thanks! I have been studying all the GLCD modules, and I've converted everything except the "strobe enable pin" sub. I don't know what that does or how to deal with it.

Here is what it looks like with the KS0108 (which has 2 CS lines):

Code: Select all

Inline Sub StrobeEN()
   EN = 1
   DelayUS(1)
   EN = 0 
End Sub
And here it is for the KSO713 (which has the 1 CS line):

Code: Select all

Inline Sub StrobeEN()
   CS1 = 0
   EN = 1
   DelayUS(1)
   EN = 0 
   CS1 = 1
End Sub

What do I do? I don't know what "strobing" is. Sorry if it's a noob question - I just downloaded SF and thought I'd give it a whirl. I've never ventured outside of Proton before.

Doj
Posts: 362
Joined: Wed Apr 11, 2007 10:18 pm
Location: East Sussex

Post by Doj » Tue Apr 08, 2008 10:42 am

Hello Russ, I am also a long time PDS user and forum user(2002) so know how sometimes things make no sense at all.

A strobe is a quick change of state like toggle but it goes back to its original state after the strobe(opposite state to default)period.

The strobe period here seems to be 1uS.
The pseudo code for the code you show seems to me to be:-
>select the chip with CS1=0
>make ENable pin high
>wait 1uS
>make ENable pin low
>de-select chip with CS1=1

I expect it would work without the CS lines but they are there for completeness.

Perhaps the reason the dual chip display does not use the CS is because it is unnecessary(and will slow down refresh a tiny bit) due to the chip selection being carried out before this subroutine it called.

I think the reason the strobe is used is so the data can be loaded on the port, but will not be read into memory, until the EN pin is strobed for the required period(which on your chip may be less than 1us so you could speed it up by reducing this delay)

Mark

Post Reply