Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

KS108 Problems?

Status
Not open for further replies.
Hey there,

I've recently purchased some GLCDs which use the KS108 controllers, purchased from Sure Electronics.

However, I have a problem there - there is no output on the screen. I have double checked the wirings and the microcontroller - there is no problems with it. On times I've seen garbled random stuff on the GLCD screen. Or something I have overlooked.

I used a longer delay (like 0.02 secs) for the strobe.

Here's the code. Right now I'm trying to light up a small row of dots inside first - the starting point is Y = 0 and the X is in the 0th page.

Code:
#pragma config FOSC = HS, BOREN = OFF, WDTEN = OFF, MCLRE = OFF, LVP = OFF

#include <P18F45K20.h>
#include <delays.h>

#define RS PORTAbits.RA0
#define RW PORTAbits.RA1
#define E  PORTAbits.RA2
#define CS1 PORTAbits.RA3
#define CS2 PORTAbits.RA4
#define RST PORTAbits.RA5

void main()
{
    TRISD = 0x00;
    TRISA = 0x00;
    PORTD = 0x00;
    PORTA = 0x00;
    
    CM1CON0 = 0x00;
    CM2CON0 = 0x00;    

    ADCON0 = 0x00;

    ANSEL = 0x00;
    ANSELH = 0x00;

    RST = 1;

    CS1 = 1;
    CS2 = 1;
    RS = 0;
    RW = 0;
    PORTD = 0b00111111;

    E = 1;
    Delay10KTCYx(10);
    E = 0;

    PORTD = 0xc0;
    E = 1;
    Delay10KTCYx(10);
    E = 0;

    PORTD = 0b01000000;
    E = 1;
    Delay10KTCYx(10);
    E = 0;

    PORTD = 0b10111000;
    E = 1;
    Delay10KTCYx(10);
    E = 0;

    CS1 = 1;
    CS2 = 0;
    RS = 1;
    RW = 0;
    PORTD = 0b10111000;
    E = 1;
    Delay10KTCYx(10);
    E = 0;
    
    while(1);
}
 
It looks like the initialization is O.K. I never tried to shorten up my code, and turned on each controller separately, overly cautious no doubt.

My read from some old code has the set of events for writing to the KS108 as:
1) Initialize by turning on CS1 and CS2
Set Y address starting point
2) Enable left or right side of display (i.e. CS1 or CS2)
3) Write page select register of 0-7
4) Write Y_addr register start point
Write the data
5) Write X_addr register value

So it looks like things are slightly out of order.

A little different take on enable and delay

Code:
		Enable = 1
		GLCD_delay
		PortD = (B'10111000' | Write_Page)		'set X_page
		GLCD_delay
		Enable = 0
 
I posted some code for this a while ago. See this thread. For the actual code see this post. It may be worth reading the whole thread as various posters had problems with differing pinouts and CS1/2 being inverted.

Mike.
 
I posted some code for this a while ago. See this thread. For the actual code see this post. It may be worth reading the whole thread as various posters had problems with differing pinouts and CS1/2 being inverted.

Mike.

Thanks Mike, I've downloaded your sample code. It worked - but I have to pull out the reset wire (the wire goes to the reset) once I turn on the system. It results in a readable display, but with a few pixels missing or some lines formed on it. The missing pixels are random everytime I do the same thing - "turn on and pull out reset wire" so I might rule out the damaged pixel inside.

I'm not sure whether it's the screen's fault, or it's the microcontroller. I hope it's my microcontroller and the program anyway.**broken link removed**
 
I've typed up another driver program for the GLCD KS108, but I can't get the "Check for Busy" function to work properly. I have to remove the "Busy Check" function in order for the display to come up as usual. If not, it'll be slow and laggy.

Are these "busy check" functions neccessary?
 
Personally, I didn't use a busy check routine for the KS108. The busy check delay situation had come up in conversation in a previous forum posting. With an AVR, internal 8 Mhz osc, a simple jump to an empty sub was enough delay. Running flat out, an animated .bmp would looked a bit ghosty and"smeared", so adding some small delay was necessary.
 
Status
Not open for further replies.

Latest threads

Back
Top