??? 07/03/04 13:56 Read: times |
#73580 - RE: Ks0108 Graphics LCD read problem Responding to: ???'s previous message |
You cannot be successful with interfacing the KS0108 controller to a microcontroller unless you carefully go through the data sheet and study how the interface signals function. See a data sheet at this link:
http://www.crystalfontz.com/products/...08_V00.pdf I looked at your code sample and noticed that you seem intent on operating the E signal with the wrong polarity. In the above referenced data sheet you will notice that the description of the E signal as follows... ![]() ...is a high active signal. The chip will emit the read data during the time that the E goes from a low to a high level. The scheme you used will lead to nothing but trouble. See the read cycle timing diagram as follows: ![]() ...and notice how the actual read cycle happens as E is set high -> read data appears -> MCU reads data -> E is set low to end the cycle. Here is how I would setup your reading routine. U8 LcdDataRead(void) { U8 DataValue; LCD_DATA = 0xFF; /* set LCD_DATA port in input mode */ LCD_DI = 1; /* Data mode */ LCD_RW = 1; /* Read mode */ LCD_E = 1; /* strobe to start read cycle */ LcdDelay(1); DataValue = LCD_DATA; /* read data from controller */ LCD_E = 0; /* end read cycle */ LcdDelay(1); return(DataValue); /* return the data read */ } I may also suggest that under many circumstances that the delays you are inserting to lengthen the read cycle may not be needed. The cycle time of these controller parts is such that the specified high time of the E pulse is 450 nsec. Only if you are running the very fastest microcontrollers will any significant delay be needed. I would tend to suggest that inserting a NOP type instruction several times can allow you to fine tune the delay so as to make the E high time come as close to the specification as possible. The reason for this is because it takes 100's (if not 1000's) of cycles to operate a graphics LCD module. It is necessary to keep the driver subroutines operating at top notch speed if you expect to attain a screen update speed that does not seem sluggish. You may also be interested in looking at similar work I on my 8052.com project page for graphics LCDs. Michael Karas |
Topic | Author | Date |
Ks0108 Graphics LCD read problem | 01/01/70 00:00 | |
RE: Simulator | 01/01/70 00:00 | |
RE: Ks0108 Graphics LCD read problem | 01/01/70 00:00 | |
Oops! | 01/01/70 00:00 | |
RE: Ks0108 Graphics LCD read problem | 01/01/70 00:00 | |
RE: Ks0108 Graphics LCD read problem![]() | 01/01/70 00:00 |