Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 03, 2016, 10:31:31 10:31


Login with username, password and session length


Pages: [1]
Print
Author Topic: simple programe for LCD, but not working.  (Read 2086 times)
0 Members and 1 Guest are viewing this topic.
mrauf57
Guest
« on: May 18, 2010, 05:22:21 05:22 »

Hi every one,

i am using MikroC pro. i m new here. the problem is that i wanna drive my LCD using 18F4550 by MikroC pro. here is the program but not working means not appearing the text i wanna print. Second thing is that just boxes in 1st and 3rd rows are glowing. can any body please help me to find the mistake i m doing here.

sbit LCD_RS at RD2_bit;
sbit LCD_EN at RD3_bit;
sbit LCD_D4 at RD4_bit;
sbit LCD_D5 at RD5_bit;
sbit LCD_D6 at RD6_bit;
sbit LCD_D7 at RD7_bit;
sbit LCD_RS_Direction at TRISD2_bit;
sbit LCD_EN_Direction at TRISD3_bit;
sbit LCD_D4_Direction at TRISD4_bit;
sbit LCD_D5_Direction at TRISD5_bit;
sbit LCD_D6_Direction at TRISD6_bit;
sbit LCD_D7_Direction at TRISD7_bit;
char *text;
 
void main() {
text = "mikroElektronika";
TRISD=0;
Lcd_Init();

Lcd_Cmd(_LCD_CLEAR);
Lcd_Cmd(_LCD_CURSOR_OFF);
Lcd_out(1, 1, text);
Delay_ms(4000);
}
Logged
BharatSujanani
Junior Member
**
Offline Offline

Posts: 42

Thank You
-Given: 24
-Receive: 18

All is Well


« Reply #1 on: May 18, 2010, 08:25:51 08:25 »

As you said boxes in first and third row is glowing means your lcd is not initialized yet. Therefor verify your initialization loop.
And check rs pin while sending the command to your lcd. Check you sending all commands i.e. 4 lines LCD CHAR SIZE 5x7,Disp. on, Cursor off,Blink off,lcd DISP.ON & EIGHT BIT INTERFACE etc..
Logged

Bharat Sujanani
Orcino Borges
Newbie
*
 Muted
Offline Offline

Posts: 23

Thank You
-Given: 13
-Receive: 18


« Reply #2 on: May 18, 2010, 12:38:27 12:38 »

The RW PIN is connected into GND ?
Logged
titi
Active Member
***
Offline Offline

Posts: 192

Thank You
-Given: 1434
-Receive: 705



« Reply #3 on: May 18, 2010, 06:09:57 18:09 »

Hi,

Yes the RW PIN need to be connected to GND.

In most cases, it is not usefull to read LCD status, you only have to wait a short time between commands (that is internaly done by LCD_CMD ou LCD_OUT).

So with RW to GND, LCD is only an output device for PIC.

Best Regards.
Logged
mrauf57
Guest
« Reply #4 on: June 05, 2010, 06:31:28 06:31 »

@BharatSujanani;
brother how can i verify the initialization loop? and u caid "And check rs pin while sending the command to your lcd. Check you sending all commands i.e. 4 lines LCD CHAR SIZE 5x7,Disp. on, Cursor off,Blink off,lcd DISP.ON & EIGHT BIT INTERFACE etc.." how ca i check?? u mean check connection diagram?

another i want to ask from every body that i come to know that in 16x4, u need to initialize the 2nd and 4th row by some commands. and the code m using (which i send above in previous post) is specially for 16x2 so plz guide me regarding the exact LCD cmd for the 2nd and 4th rows since these rows r not glowing..

thank you.
m using HD44780, model: JHD164A SERIES
█CHARACTERISTICS:
DISPLAY CONTENT:16 CHAR x 4ROW
CHAR. DOTS:5 x 8
DRIVING MODE:1/16D
software, MikroC pro for PIC


thank you.

regards

waiting for ur reply.


Logged
BharatSujanani
Junior Member
**
Offline Offline

Posts: 42

Thank You
-Given: 24
-Receive: 18

All is Well


« Reply #5 on: June 05, 2010, 08:44:12 08:44 »

Hi mrauf57
I have done work on 20X4 display module. I am uploading the manual of that module for your lcd initialization reference. on page no 31 they have given the initialization sequence flow dig.

http://rapidshare.com/files/395452995/lcdmanual.pdf
Logged

Bharat Sujanani
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC