??? 10/26/10 05:37 Modified: 10/26/10 05:44 Read: times Msg Score: -1 -1 Didn't Search First |
#179335 - LCD interfacing Responding to: ???'s previous message |
pl. can you help me in writing any character e.g 'A' on LCD in 'C' lang (SDCC Compiler).
RS= P2.0 R/W=P2.1 E=P2.2 AND PORT DATA IS COMING ON P1.0 TO P1.7....please tell me about the header files that are to be included. i have made simple lcd programs using assembly but i m new to 'C'. i m using 8051 uC. i tried this code but its giving too many errors such as implicit declaration,,,too many parameters etc.how to make delay_ms function. #define rs P2_0 #define rw P2_1 #define enable P2_2 #define lcd_port P1 main() { Lcd_Ini(); lcd_command(0x86); lcd_display(‘V’); lcd_display(‘I’); lcd_display(‘J’); lcd_command(0x0C4); lcd_display(‘A’); lcd_display(‘B’); lcd_display(‘C’); lcd_display(‘D’); lcd_display(‘E’); lcd_display(‘F’); lcd_display(‘G’); lcd_display(‘H’); lcd_display(‘I’); lcd_display(‘J’); while(1) { } } void Lcd_Ini() { lcd_command(0x38); delay_ms(30); lcd_command(0x0c); delay_ms(10); lcd_command(0x06); delay_ms(10); lcd_command(0x01); delay_ms(10); } void lcd_command(unsigned char command) { rw=LOW; rs=LOW; lcd_port=command; enable=HIGH; enable=LOW; delay_ms(5); } void lcd_display(unsigned char display) { rw=LOW; rs=HIGH; lcd_port=display; enable=HIGH; enable=LOW; delay_ms(1); } Thanks... |