Hi Robert, I have tried this code. Use 16x2 character LCD, 4 bit mode, use RA3-0 to LCD. It is success. Note : Be carefull for the delay. It uses maximum delay, because it does not read the flag (read mode). ;/////////////////////////////////////////////////////////// ;*********************************************************** ; LCD Initialization ;*********************************************************** LCD_initialization call Dlay5 ; Wait 20 msecs before Reset call Dlay5 call Dlay5 call Dlay5 ;----------------------- once 4 bit --------------------- bcf STATUS,C movlw 0x03 ; Reset Command (data was in 'W') call NybbleOut ; Send the Nybble call Dlay5 ; Wait 5 msecs before Sending Again bcf STATUS,C movlw 0x03 call NybbleOut ; Send the Nybble call Dlay160 ; Wait 160 usecs before Sending the Third Time bcf STATUS,C movlw 0x03 call NybbleOut ; Send the Nybble call Dlay160 ; Wait 160 usecs before Sending the Third Time bcf STATUS, C movlw 0x02 ; Set 4 Bit Mode call NybbleOut call Dlay160 ;----------------------- twice 4 bits -------------------- movlw 0x028 ; Note that it is a 2 Line Display call SendINS movlw 0x008 ; Turn off the Display call SendINS movlw 0x001 ; Clear the Display RAM call SendINS call Dlay5 movlw 0x006 ; Enable Cursor Move Direction call SendINS movlw 0x00C ; Turn the LCD Back On call SendINS return Regards, Harry Febianto "Robert A. LaBudde" wrote: > I have to admit I'm confused about how to interface to a Hitachi 44780 > controlled LCD via 4-bits. > > I've got a number of sample programs from books and websites, and there > doesn't appear to be a unanimity on how to accomplish initialization of the > LCD. > > The most common initialization sequence is (after 15 ms startup delay): > > 1. Send 0x'3' (8-bit interface, 1/2 of command) > 2. Wait > 4.1 ms > 3. Send 0x'3' > 4. Wait 100 us > 5. Send 0x'3' > 6. Wait 100 us > 7. Send 0x'2' (4-bit interface) > 8. Wait 40 us > 9. Send 0x'28 (4-bit interface, 2-line) > 10. Wait 40 us. > > When I try this sequence with my 20 x 4 display, it doesn't reliably > initialize. So I went to the 44780 controller specification from the > Hitachi website, and I found that they recommended the following sequence > (after the 15 ms startup delay): > > 1. Send 0x'2'. (4-bit interface, 1/2 of command) > 2. Wait 40 us. > 3. Send 0x'28' (4-bit, 2-line) > 4. Wait 40 us. > > This sequence initializes the LCD reliably. It also makes sense, since the > 0x'2' command would be logically interpreted by the controller as a switch > to 4-bit mode. Then the 0x'28' would be executed completely. > > My question is: What's with the extraneous three 0x'3' commands recommended > and used by others? Why are these even hypothetically necessary, since the > controller comes up in 8-bit mode by default anyway? > > ================================================================ > Robert A. LaBudde, PhD, PAS, Dpl. ACAFS e-mail: ral@lcfltd.com > Least Cost Formulations, Ltd. URL: http://lcfltd.com/ > 824 Timberlake Drive Tel: 757-467-0954 > Virginia Beach, VA 23464-3239 Fax: 757-467-2947 > > "Vere scire est per causae scire" > ================================================================