littletransistor
New Member
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.
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);
}