📬❄️📦Adafruit Holiday Shipping Deadlines 2019: Please place all UPS 3 Day orders by 11am ET Friday December 13 📬❄️📦
0

please help, GDM12864, KS0108 LCD
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

please help, GDM12864, KS0108 LCD

by qu13tk1d on Sun Oct 26, 2008 7:21 pm

I have been trying to get an lcd i have ordered from sparkfun electronics to work. I have read and reread the data sheet and for some reason i believe it to be a timing issue in my code i'm having, but i cannot see anything i am trying to draw to the lcd.

If some one could check my code maybe i am using a function wrong or something but i am almost willing to bet that the timing of the pins high low states are correct, then again they may not be but i'll keep testing it to see. I had to use the nop() function for speed reasons and i had to set the pins i/o using PORTs.

Another question is has anyone ever used this and if so do i have to use the instruction "set display on/off", do i have to initially set the y address? Or should all i have to do is send data and it draws a line?

Yes i know there's a library for this for the arduino how ever i want to actually create the software instead of using some one else's and i have a hard time reading header files people make so that's why i am not using the lib as reference but it looks like i may have to, to see what that person did to get the lcd to work.
Code: Select all | TOGGLE FULL SIZE
void setup(){
  delay(3000);
  DDRD = DDRD | B11111100;//pins 0-7
  PORTD = B10101100;
  DDRB = DDRB | B00011111;//pins 8-13 and crystal
  PORTB = B00000000;
  funcdatw();

}

void funcdatw(){
    PORTD = B01101100;//after setup set e low
    __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t");//delay 310 ns
    PORTD = B01011000;//set rw, cs1 low rs high
    __asm__("nop\n\t""nop\n\t""nop\n\t");//delay 140 ns
    PORTD = B11011000;//set  e high
    PORTB = B00111111;//set the dat pins
    __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t");//delay tdsu 200
    PORTD = B01011000;//set e low
    __asm__("nop\n\t");//delay tdhw 10 ns for address and data hold time
    PORTD = B01101100;//set everything back to setup standards except e
    PORTB = B00000000;//^
    __asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t""nop\n\t");//delay before e goes high
    PORTD = B11101100;
}

void loop(){
}
qu13tk1d
 
Posts: 6
Joined: Wed Sep 03, 2008 8:39 pm

Re: please help, GDM12864, KS0108 LCD

by westfw on Sun Oct 26, 2008 7:50 pm

Post a link to the LCD datasheet?
Are you sure the delays you need are nanoseconds and not (say) microseconds? I recall some LCDs as being really slow by modern standards. The delays you have (approx 200ns) would be pretty short for an on-board pure memory device (of somewhat oldish vintage), much less a signal that has to go out over actual wire...
westfw
 
Posts: 1583
Joined: Fri Apr 27, 2007 1:01 pm
Location: SF Bay area

Re: please help, GDM12864, KS0108 LCD

by qu13tk1d on Sun Oct 26, 2008 8:42 pm

http://www.sparkfun.com/datasheets/LCD/GDM12864H.pdf <- url to data sheet.
In the table labled write or read cyble on page 7, the units are in ns so i do beleive they're in nano seconds. I will try it in microseconds too though.
qu13tk1d
 
Posts: 6
Joined: Wed Sep 03, 2008 8:39 pm

Re: please help, GDM12864, KS0108 LCD

by qu13tk1d on Wed Oct 29, 2008 3:27 pm

I think i know what's wrong but i am very confused on how to go about fixing it.
In the datasheet the E cycle has to be at least 1000 ns how ever the low and high hold times for the E cycle are 450 ns each = 900. Even if you include the max translation from high to low and low to high for the E pin which is 25 ns each that only comes to 950 ns i think that this is causing problems. Could some one clear this up for me, I've looked at several datasheets and their E cycle is still weird.

Also is there an initialization i have to do for the lcd? Do i have to set every pin low and set the RST pin high? Thats just what i found off of some one elses source code I'm just wondering if that just resets the two chips.
qu13tk1d
 
Posts: 6
Joined: Wed Sep 03, 2008 8:39 pm

Re: please help, GDM12864, KS0108 LCD

by adafruit on Wed Oct 29, 2008 8:40 pm

sparkfun has their own forum, i suggest posting there for help with their products...

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

Please be positive and constructive with your questions and comments.