LCDInfo.com http://forum.lcdinfo.com/ |
|
NanYa 128x64 with KS0108 - 8052 Assembly programming http://forum.lcdinfo.com/viewtopic.php?f=9&t=1074 |
Page 1 of 1 |
Author: | Serenity [ Thu Feb 24, 2005 13:47 ] |
Post subject: | NanYa 128x64 with KS0108 - 8052 Assembly programming |
I have a self-built development and test board for the 8052 and connected the display with normal wires The problem is that it fails to initalize. All I get is a black line at the very top Here is the important code (the delay is 0.5ms now): clr P2.5 DSP_INIT: call DLY clr P2.0 ;Reset call DLY setb P2.0 call DLY call CHECK1 ;Controller Status ;next is supposed to be CHECK2 + Display 1/2 ON TEST: jmp TEST ENABLE: setb P2.5 call DLY clr P2.5 call DLY call DLY ret CHECK1: mov P0, #0FFh mov P2, #0FFh clr P2.3 ;D/-I = 0 + R/-W = 1 --> Read Data clr P2.2 ;Chip Select 1 CHK1_L: call ENABLE jb P0.7, CHK1_L ;Busy Flag jb P0.4, CHK1_L ;Reset Flag ret When I probe the Enable Strobe and Busy with 2-channel osciloscope I get continious Enable strobes. So I think it hangs in the Check 1 loop. Now the weird thing is that the Busy signal is the Enable one excactly inverted. When I pull enable high, busy goes low, and returns to high at the falling edge (this is when the status output is supposed to appear). This leads me to believe that the microcontroller always detects busy and is thus in an endless loop. In my opinion it doesn't make much sense that the two signals are just inverted. There should be some delay Is this a timing issue? What are the recommended timings here? |
Author: | Serenity [ Fri Feb 25, 2005 11:37 ] |
Post subject: | |
Well, I found out why the waveforms are inverted. I didn't really consider that the enable falling edge latches the busy bit. Internally it can of course be something else I also saw that the display and the controller manufacturer technical details are somewhat conflicting. Once it says that data can be read after the falling edge of enable, and once that it can be read in the high state. Still doesn't work |
Author: | Henri [ Fri Feb 25, 2005 14:28 ] |
Post subject: | |
Is it necessary for you to do the busy reading ? Maybe you could just try putting a first delay first and when you have the display otherwise working you could try with the busy functionality again if needed. |
Author: | Serenity [ Fri Feb 25, 2005 16:20 ] |
Post subject: | |
Yeah I suppose I could do a delay of a few milliseconds. The manual of the display just recommend the busy routine before any sort of writing and reading from the display Since the controller datasheet said that the busy bit can be read during a highphase, I gave a pulse to latch the bit, and then pulled enable high again to read it Thus I managed get the processor to do a loop of write data cycles and it still only displays that one line at the top. This leads me to believe that the controller wasn't initialized correctly. But I'm pretty much out of ideas |
Page 1 of 1 | All times are UTC + 2 hours |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |