LCDInfo.com

http://www.lcdinfo.com
It is currently Sun Nov 24, 2024 15:15

All times are UTC + 2 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Thu Mar 06, 2003 1:40 
Offline

Joined: Wed Feb 26, 2003 19:36
Posts: 4
Location: Vancouver, Canada
Hello,

I am trying to read display data from the CrystalFontz CFAG12864B graphical LCD (which uses the KS0108B chip).

I think the procedure is as follows:
SetPage;
SetColumn;

write sequence:
LCD_CTRL_REG: RESET = 1, D/I = 1, E = 1, R/W = 1, select( CSx )
LCD_CTRL_REG: RESET = 1, D/I = 1, E = 0, R/W = 1, select( CSx )
read LCD_DATA_REG;
LCD_CTRL_REG: RESET = 1, D/I = 1, E = 1, R/W = 1, select( CSx )

However, I am not reading back the 8bit data that I expect at that location.
What am I doing wrong ?


Thx.
Cheers,
Albert


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 07, 2003 22:49 
Offline

Joined: Sun May 05, 2002 22:05
Posts: 2063
Location: Lappeenranta, Finland
Finally got to write something here as I've been quite busy the last few days.

Any progress on this ?

I quickly looked at the datasheet and it said that the data can be read when E = HIGH. I haven't personally ever read from KS0108 so I can only tell what the datasheet says.

edit:
Also noticed this in the datasheet:
Quote:
To read the contents of display data RAM, twice access of read instruction is needed. In first access, data in display data RAM
is latched into output register. In second access, MPU can read data which is latched. That is, to read the data in display data
RAM, it needs dummy read. But status read is not needed dummy read.


edit2:
I also found some code for Ks0108
Code:
void glcd_WaitIfBusy(void)
{
  outp(0x00, glcd_DataDir);
  sbi(glcd_Control, glcd_RW);
  cbi(glcd_Control, glcd_RS);
  do {
    glcd_Delay(1);
    sbi(glcd_Control, glcd_Enable);
    glcd_Delay(1);
    cbi(glcd_Control, glcd_Enable);
  } while (bit_is_set(glcd_DataIn, glcd_sBUSY));
}

unsigned char glcd_ReadData(void)
{
   glcd_WaitIfBusy();
  outp(0x00, glcd_DataDir);
  sbi(glcd_Control, glcd_RW);
  sbi(glcd_Control, glcd_RS);
  sbi(glcd_Control, glcd_Enable);
  glcd_Delay(1);
  cbi(glcd_Control, glcd_Enable);
  return inp(glcd_DataIn);
}


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 11, 2003 17:14 
Offline

Joined: Mon Jul 07, 2003 15:00
Posts: 12
Location: France or England
you want write to address 1 ( for example ) :

you select the address 1 ( by send command )
you write the data in the address
and now the next address is automaticly set by the KS0108B ( address 2 )

so if you read now , you read the data in address 2 .


I think you have to send the address (the same ) beford read it .


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 23, 2003 21:53 
Offline

Joined: Tue Feb 18, 2003 12:33
Posts: 118
Location: Angers, France
attention to the lpt port: some of the pins are 0V activ, i mean that if you set the bit, it will produce 0 volt and if you clear it, it will produce 5v, it on some of the control pins.

_________________
Shadows move where light should be


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 29, 2003 14:33 
Offline

Joined: Mon Jul 07, 2003 15:00
Posts: 12
Location: France or England
E should be low at all the time .

step by step:

- you set CSx , r/w ,d/i

- you put E =1

( maybe need delay here )

- read the bus D7-D0

- E=0


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC + 2 hours


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group