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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/05/05 14:57
Read: times


 
#93004 - LCD initialisation is wrong
Responding to: ???'s previous message
Hi Vignesh,

Your initialisation sequence is wrong and busy signal is valid or available only after few initialisation steps. In your code WAIT_LCD is called at the first command itself. You can go through the code given in the datasheets to understand how it is done.

Moreover, unless you want to read the RW pin can be grounded permanently ie., always in write mode. Instead of checking for the busy signal a constant delay is given between the writes.

Get hold of a LCD datasheet from a good manufacturer like Optrex. The JM162D datasheet is not detailed enough.

I have pasted a modified 'C' code snippet. It is given for you to understand the sequence.

start of init_LCD

delay(200); // Wait 20ms
LCD_E = 0;
LCD_RS = CTRL_REG; // Switch to inruction register

LCD_DATA = 0x30;
LCD_E = 1; LCD_E = 0; // Write data to display
delay(50); // Wait 5ms

LCD_E = 1; LCD_E = 0; // Write data to display again (SW Reset)
delay(50); // Wait 5ms

LCD_E = 1; LCD_E = 0; // Write data to display again (SW Reset)
delay(50); // Wait 5ms

// Set LCD_DATA to Function Set : 8 bit, 2 lines, 5*7 font
LCD_DATA = Function Set;
LCD_E = 1; LCD_E = 0; // Write data to display
delay(4); // Wait 400µs

// Set LCD_DATA to Display On/Off Control : display off, cursor off, don´t blink
LCD_DATA = Display On/Off Control ;
LCD_E = 1; LCD_E = 0; // Write data to display
delay(4); // Wait 400µs

// Set LCD_DATA to Clear Display
LCD_DATA = Clear Display;
LCD_E = 1; LCD_E = 0; // Write data to display
delay(50); // Wait 5ms

// Set LCD_DATA to Entry Mode Set : increment DD-RAM address, move cursor
LCD_DATA = Entry Mode Set ;
LCD_E = 1; LCD_E = 0; // Write data to display
delay(4); // Wait 400µs

end of init_LCD


List of 25 messages in thread
TopicAuthorDate
datasheet for lcd            01/01/70 00:00      
   datasheet            01/01/70 00:00      
   To Marjan!            01/01/70 00:00      
      is it Mehdi?            01/01/70 00:00      
         Contrast Control.            01/01/70 00:00      
            Code for the LCD            01/01/70 00:00      
               please read as:            01/01/70 00:00      
               LCD initialisation is wrong            01/01/70 00:00      
                  I have got it, but..            01/01/70 00:00      
                     READ / WRITE sequence            01/01/70 00:00      
                        thanks Leo            01/01/70 00:00      
         One more hint.            01/01/70 00:00      
            to Prahalad            01/01/70 00:00      
               LCD Contrast - Vignesh            01/01/70 00:00      
                  oh, fine..            01/01/70 00:00      
                     Oriole LCD Modules            01/01/70 00:00      
                        Re: Oriole ODM.            01/01/70 00:00      
         quick check at the shop before buying            01/01/70 00:00      
         Yes,it is!            01/01/70 00:00      
            Testing : Passed            01/01/70 00:00      
            to Mehdi with love            01/01/70 00:00      
               Thanks Vignesh !            01/01/70 00:00      
                  Oh with pleasure..            01/01/70 00:00      
   The original datasheet            01/01/70 00:00      
   damaged LCD            01/01/70 00:00      

Back to Subject List