Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/29/07 16:17
Read: times


 
#131637 - try this...
Responding to: ???'s previous message
First, I don't know which compiler you are using, so I don't know if your computer can properly process that code.

Secondly, I would remove LJMP MAIN, or else the equates might not apply.

Assuming your LCD is HD47780 compatible, you need to connect pin 1 to ground, Pin 2 to +5V, Pin 3 to a resistor of at least 300 ohms. The other end of the resistor is grounded.

Pin 4 connects to the connection point in your circuit controlling the RS line. According to your code, It is P3.7 of the micro.

Pin 5 connects to P3.5 if you use your code.
Pin 6 connects to P3.4 if you use your code.

What I personally do is forget about pin 5 and tie it to ground, and then let the 8051 software (that you provided in code) do all the timing. When pin 5 is grounded, you will be writing data to the LCD.

Now the Enable line is crazy, because this is what made my LCD experience horrible until I discovered it. Let's ignore the data sheet for the moment. The idea to send stuff to the LCD is to get the RS set to what mode you want, the data set to what you want, and then (lets say 100 us later), turn the enable line on (P3.4 is high)
keep it high for lets say 400 ns.

At this point, P3.4 needs to be set to low.

Now you need to observe data sheets. According to one of mine, it takes between 40us and 2ms for an LCD to process an instruction. Any write instructions sent to it during this time will be ignored.

Keep that delay subroutine of yours. If you are using a fast crystal, then your delay might not be long enough, and you will need to add to it.

Now I do NOT recommend grounding pin 3 of the LCD, because the display could get so dark, it could screw up. Maybe you need to replace the LCD.

Also, make sure your data lines are connected correctly.
According to your code, you need to make the following connections:

P1.0 to LCD Pin 7
P1.1 to LCD Pin 8
P1.2 to LCD Pin 9
P1.3 to LCD Pin 10
P1.4 to LCD Pin 11
P1.5 to LCD Pin 12
P1.6 to LCD Pin 13
P1.7 to LCD Pin 14

If any of the above connections are different, you will either need to reconnect the LCD to the connections above, or you need to adjust your code.

You will need to consider the microcontroller. Is IT feeding the data correctly. To test it, connect a bunch of LED's to each port output and convert the binary output to hexadecimal.

The rest of your code seems to be OK.

So check your hardware.

Also, check that you are programming the microcontroller properly. Remember, the data bits must be connected properly, and they need to be proper throughout all microcontroller related circuits.

List of 70 messages in thread
TopicAuthorDate
LCD Help needed            01/01/70 00:00      
   as replied in parallel thread            01/01/70 00:00      
   try this...            01/01/70 00:00      
      Not this bit            01/01/70 00:00      
         I do both software and hardware.            01/01/70 00:00      
            diffference            01/01/70 00:00      
   What assembler??            01/01/70 00:00      
   No Initializatoin            01/01/70 00:00      
      Wait There it is.            01/01/70 00:00      
   Ah lcd problems!            01/01/70 00:00      
   Hardware problem?            01/01/70 00:00      
      Well i think its the Hardware + Software problem            01/01/70 00:00      
         Half of display            01/01/70 00:00      
            8 bit initialization            01/01/70 00:00      
               This is New Program            01/01/70 00:00      
                  nothing new            01/01/70 00:00      
                     Well sir Erik there is my code commented            01/01/70 00:00      
                        sparsely and nit using <pre> and </pre>            01/01/70 00:00      
                           It's not that difficult            01/01/70 00:00      
                              Well its not being good            01/01/70 00:00      
                                 OK, down to brass tacks and babysteps            01/01/70 00:00      
            Right Sid of LCD is Fading            01/01/70 00:00      
         normal?            01/01/70 00:00      
      LCD's vary, and contrast voltage is NEGATIVE!            01/01/70 00:00      
         sometimes            01/01/70 00:00      
            I heard that once ...            01/01/70 00:00      
         HUH?            01/01/70 00:00      
            guilty as charged            01/01/70 00:00      
               two            01/01/70 00:00      
                  I reuse mine            01/01/70 00:00      
   try this one            01/01/70 00:00      
      why try something that can not be unbderstood            01/01/70 00:00      
   Solve            01/01/70 00:00      
      Nothing is happining with New LCD also            01/01/70 00:00      
         Sorry guys...            01/01/70 00:00      
         Try            01/01/70 00:00      
            Well sir I am using HD44780            01/01/70 00:00      
               sloooow down coders            01/01/70 00:00      
   TESTED code for LCD            01/01/70 00:00      
      It may be tested..            01/01/70 00:00      
         blame            01/01/70 00:00      
            Circuit configuration for LCD interfacing            01/01/70 00:00      
               P1.x control?            01/01/70 00:00      
                  No problem with pin configuration            01/01/70 00:00      
                     Well i have changed Pin configuration back            01/01/70 00:00      
                        Pullups on P1.0,1            01/01/70 00:00      
                           about P1.0 and P1.1            01/01/70 00:00      
                        Does your micro work at all?            01/01/70 00:00      
                           to be specific...            01/01/70 00:00      
                        my issue            01/01/70 00:00      
      debugging            01/01/70 00:00      
   Finally i have did it.....            01/01/70 00:00      
      go high            01/01/70 00:00      
   Code for 8-Bit LCD (HD44780)            01/01/70 00:00      
      perfect            01/01/70 00:00      
         Perfect for some...            01/01/70 00:00      
            it is important with the at89c2051            01/01/70 00:00      
               i am noob, so dont worry about pins :-)            01/01/70 00:00      
                  no encryption required            01/01/70 00:00      
               Real world            01/01/70 00:00      
                  answer            01/01/70 00:00      
                     Is this true?            01/01/70 00:00      
                        To some people it seems            01/01/70 00:00      
                           kindof            01/01/70 00:00      
                              You can get by with this some of the time            01/01/70 00:00      
                              Point missed            01/01/70 00:00      
                                 check this            01/01/70 00:00      
                                    You didn't take the challenge            01/01/70 00:00      
   why should you            01/01/70 00:00      
   Help on LCD code            01/01/70 00:00      

Back to Subject List