This is a circuit I incorporated in my major project to drive an LCD. For C1, I used a 2.2nF ceramic disc capacitor and the resistor is 100K which based on a basic RC calculator, works out to be about 220uS, but calculators with more options (like ones requiring source voltage and output voltage as inputs to the calculator including one at http://ladyada.net/library/rccalc.html) throw me off because different voltage values output different delays.

I created this driver because I ran out of free microprocessor GPIO pins. Instead I merged the input pin (LCDCLK) with the input of a shift register, so that when the first rising edge begins, the first byte enters the shift register. Then if I do nothing for the timing window (which is a set amount of time before Q goes low which I thought equals R times C), then the LCD processes the instruction since the shift register outputs will be connected to the LCD.

I have even tried to arrange my code so the bytes get sent to the LCD as quickly as possible (which is under 25uS) then I deliberately added a 220uS delay to make sure the driver times out and makes the E line low (E is the LCD input pin which the output of this driver connects to) then I even added another 50uS delay and when I send instructions, I added a 5mS delay as well.

When I test everything, it seems that the only thing that is executed is the LCD setup instruction (38h). The LCD is a 16x2 display with a backlight.

I'm trying to figure whats wrong. I can think of these things:

  1. The 15 LCD's I ordered online are garbage (even though upon power up with no instruction, they display a bar which is expected).

  2. The timing window in which I send instructions to the display is bad (however, I checked the datasheet and it expects a minimum timing window of 500nS, yet it takes about 1uS to load one bit of data)

  3. I'm using incorrect resistor/capacitor values for other reasons

  4. I should increase delays after the timing window completes

  5. I should add delays in updating the clock (aka use no-operation instructions between lowering the clock value and raising the value and vice-versa)?

I'm not sure the best approach to take. My microcontroller is At89C2051 which controls the above circuit, and the crystal connected to it is 20Mhz which means it takes about 590 or 600nS to execute one instruction.

I just want the LCD to execute as fast as possible. It would be golden if I can see a letter printed on the LCD within 5mS of the LCD starting up and each letter printed 250uS thereafter.

Any ideas what I can do here to make the LCD respond to all the commands instead of just one?


  • 1
    \$\begingroup\$ I'm lost in all of the details without knowing what kind of "LCD" you are trying to drive. Please provide a link to a data sheet or give pertinent specs and description of it. \$\endgroup\$ – FiddyOhm Jan 9 '17 at 7:48
  • 1
    \$\begingroup\$ I'm sorry for going on about your poor performance but if you want help, you should really start considering formally accepting a few more answer. You have accepted about 12 out of the 85 you have asked and I can see some very good answers to your questions languishing without formal acceptance. Let me be a bit tougher - this is the "fee" for all the really good free advice you get. \$\endgroup\$ – Andy aka Jan 9 '17 at 8:25
  • \$\begingroup\$ @Andyaka: Is accepted answer count of a user displayed somewhere? If so, I seem to miss it. Or did you "manually" check? \$\endgroup\$ – Rev1.0 Jan 9 '17 at 8:40
  • \$\begingroup\$ @Rev1.0 I manually checked. \$\endgroup\$ – Andy aka Jan 9 '17 at 8:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy