??? 02/11/08 12:09 Read: times |
#150554 - I work in 4 bit mode Responding to: ???'s previous message |
I use LCD working with 4 bits mode. It works well with dsPIC microcontroller (dsPIC30F3014, programmed in C Language) and still works well with ATMEL microcontroller (AT89C51-ed2, programmed in Assembly Language)
Your steps to initialize the LCD are not equal to the ones I do. The codes I send to LCD initialization are (in Hexadecimal): 0x03, 0x03, 0x03, 0x02, 0x28, 0x0C . My code in assembly is : (p0.0 from ATMEL linked with D7 from LCD,..., p0.3 linked with D4 from LCD. D3, D2, D1 and D0 of the LCD are put to ground! ) ////// ini_lcd: clr rs clr en ;;;;;;;;;;;;;; clr p0.0 clr p0.1 clr p0.2 clr p0.3 setb en acall delay_5ms clr en clr p0.0 clr p0.1 setb p0.2 setb p0.3 setb en acall delay_5ms clr en ;;;;;;;;;;;;;; ;;;;;;;;;;;;;; clr p0.0 clr p0.1 clr p0.2 clr p0.3 setb en acall delay_5ms clr en clr p0.0 clr p0.1 setb p0.2 setb p0.3 setb en acall delay_5ms clr en ;;;;;;;;;;;;;; ;;;;;;;;;;;;;; clr p0.0 clr p0.1 clr p0.2 clr p0.3 setb en acall delay_5ms clr en clr p0.0 clr p0.1 setb p0.2 setb p0.3 setb en acall delay_5ms clr en ;;;;;;;;;;;;;; ;;;;;;;;;;;;;; clr p0.0 clr p0.1 clr p0.2 clr p0.3 setb en acall delay_5ms clr en clr p0.0 clr p0.1 setb p0.2 clr p0.3 setb en acall delay_5ms clr en ;;;;;;;;;;;;;; ;;;;;;;;;;;;;; clr p0.0 clr p0.1 setb p0.2 clr p0.3 setb en acall delay_5ms clr en setb p0.0 clr p0.1 clr p0.2 clr p0.3 setb en acall delay_5ms clr en ;;;;;;;;;;;;;; ;;;;;;;;;;;;;; clr p0.0 clr p0.1 clr p0.2 clr p0.3 setb en acall delay_5ms clr en setb p0.0 setb p0.1 clr p0.2 clr p0.3 setb en acall delay_5ms clr en ;;;;;;;;;;;;;; ;;;;;;;;;;;;;; clr p0.0 clr p0.1 clr p0.2 clr p0.3 setb en acall delay_5ms clr en clr p0.0 setb p0.1 setb p0.2 clr p0.3 setb en acall delay_5ms clr en ;;;;;;;;;;;;;; ;;;;;;;;;;;;;; clr p0.0 clr p0.1 clr p0.2 clr p0.3 setb en acall delay_5ms clr en clr p0.0 setb p0.1 setb p0.2 clr p0.3 setb en acall delay_5ms clr en ;;;;;;;;;;;;;; ;;;;;;;;;;;;;; clr p0.0 clr p0.1 clr p0.2 clr p0.3 setb en acall delay_5ms clr en clr p0.0 clr p0.1 clr p0.2 setb p0.3 setb en acall delay_5ms clr en ;;;;;;;;;;;;;; ret ////// I hope it works for you. carlosjunior@gmail.com |