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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/03/07 16:00
Read: times


 
#131952 - normal?
Responding to: ???'s previous message
Are you sure the contrast is fading?

When an LCD is first on, you should see the first line (or 1/2 a line if it is a 1-line display) as a set of black squares. In a 16-character 2-line display, you should see 16 black squares in the first row, and 16 faint squares in the second row. Adjust the potentiometer until the faint squares appear.

Someone earlier thought you didn't attempt to initialize the LCD. Your code makes me think that (s)he is wrong.

I agree with another poster that timing is a huge issue with LCD's.

According to several datasheets, it takes from 37us to 1.64ms for a command to be processed.

First, determine what the speed of the oscillator (or crystal) you are using with the microcontroller. If it is a crystal, the packaging that came with it will indicate it.

Next, use the datasheet for your microcontroller to determine how many clock cycles it takes to process one instruction.

In most cases, the answer is 12.

Now, take your crystal frequency, and divide that by the number you got from the datasheet.

now divide 1 by your result (not result divided by one).

this will indicate how long it takes for the microprocessor to process most single instructions.

You may need to look at a datasheet that shows you how many clock cycles it takes for each instruction to execute.

Many take one, some take 2, and a few take 4.

Now write your code so that at least 2ms passes before an LCD is written to.

The easiest way to do this is to create a delay.

Here's some code. Please note that I am not making this code for any specific assembler. All values are in hex.

mov R2,FF
loop2
mov R3,FF
loop1
djnz R3,loop1
djnz R2,loop2

Basically, this code counts from 0 to about (255 * 255), where the delay between each count is about (crystal frequency/(cycles per instruction)).

so there is nothing wrong with your LCD.

If it was actually fading and you were using batteries, replace them.

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