Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] no display on 16X2 lcd with pic18f458

Status
Not open for further replies.

nagaraj.m

Newbie level 5
Newbie level 5
Joined
Jul 15, 2011
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
chennai
Activity points
1,370
hi
i hav programmed pic18f458 with a temperature sensor program to display it on lcd....i gave all connections on breadboard...but i can see only square blocks on display which fades out in seconds.i checked the output pin (port c) of pic18f458 with multimeter and it shows some voltage between 2v to 3v.but still i cant see anythng on lcd.how 2 make lcd to diplay constantly....

kindly help me to get out of this problem....thanks in advance
 

// LCD module connections
sbit LCD_RS at RC4_bit;
sbit LCD_EN at RC5_bit;
sbit LCD_D4 at RC0_bit;
sbit LCD_D5 at RC1_bit;
sbit LCD_D6 at RC2_bit;
sbit LCD_D7 at RC3_bit;

sbit LCD_RS_Direction at TRISC4_bit;
sbit LCD_EN_Direction at TRISC5_bit;
sbit LCD_D4_Direction at TRISC0_bit;
sbit LCD_D5_Direction at TRISC1_bit;
sbit LCD_D6_Direction at TRISC2_bit;
sbit LCD_D7_Direction at TRISC3_bit;
// End LCD module connections

void main()
{
unsigned long mV;
char txt1[]= "nanda";
char temperature;
int temp;
char txt[4];
TRISA=0xFF;
TRISC=0x00;
OSCCON=0x72;


ADCON0=0x51;
ADCON1=0x80;
Lcd_Init(); // Initialize LCD

// Clear display
// Cursor off
Lcd_Out(1,1,txt1); // Write text in first row
delay_ms(1000);


while(1)
{
temp = Adc_Read(2); // Read temp
mV = (unsigned long)temp *5000 / 1024; // in mV
temperature= mV/10;
BytetoStr(temperature,txt);
Lcd_Out(2,1,txt);
delay_ms(1000);
}
}

this is my code....

i got the output in proteus isis but not on breadboard...i dont knw wer im gng wrong....sometimes the lcd shows black square boxes and sometimes it is blank...
 

The code seems fine. I think problem is in hardware. How did you connect the LCD contrast pin? That seems to be the problem. This is what you need to do:

56_1292828437.png

https://www.edaboard.com/threads/194246/#post824737
https://www.edaboard.com/threads/194246/

Hope this helps.
Tahmid.
 

The problem is with the breadboard. Even i faced the same problem.

Try soldering the wire. I am sure this will work
 

i exactly connected in the same way as in the image u posted...but i can see only square boxes...is there any way to check tat data is transmitted from output pins i.e.,port C?? i used multimeter and found some voltage between 0.5v to 3v in port c pins wen i giv power supply...is tat means data is transmitted correctly from the pic??

thanks for ur reply

---------- Post added at 19:10 ---------- Previous post was at 19:09 ----------

@agarwal.rishabh20@gmail.com

do u mean tat i can't get output on breadboard for lcd displays?? should i use pcb ?? kindly clarify

thanks for ur reply
 

Yes...since you interfaced it to a controller, which executes its instructions very fast. Any loose contact or slight disconnection on breadboard will lead to execute a different instruction in lcd and which ultimately doesnt initialize the lcd properly and leads to the problem you mentioned.
 

Before calling LCD_init() call a delay(if it is not at the start of this function) . LCDs needs some time before sending data/commands to it.
 

You can use breadboard, there will be no problem, but make sure that the wires connecting the LCD are connected properly. Solder them to the LCD. Then, adjust the pot shown in the diagram slowly. At one point, the squares will disappear and you should see the text.

Hope this helps.
Tahmid.
 

@tahmid ::
i tried wat u said but still cant get anythng on display...can u kindly give me any program using mikroc for lcd display...
 

Hi,
Try this. This is the mikroC LCD library.
 

Attachments

  • LCD Library.pdf
    119.3 KB · Views: 142
  • LCD.PNG
    LCD.PNG
    38.3 KB · Views: 146

hi all and tahmid....


thanks a lot...finally i got my output on LCD for a simple LCD display program and temperature sensor program....the fault was due to the poor bread board only...wen i tried wit a different board ...i got everythng fine..once again thank u ppl :):razz:
 

I have been practicing CODING in a different format (like #define and all), but I have this technique to be easier (using sbit). Am very new to this programming. I would like to know in depth about this programming. Can you be of any help? Thanks in advance. :-? :?:
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top