Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Lcd Problem

Status
Not open for further replies.

sachin.kolkar

New Member
hello friends,
i have problem with lcd display problem,
i m using mikroC software and 16x1 LCD,some times it displays the correct and some times it skips one bit while switch on and off the power supply......
here is my code

Code:
char*text="HELLO WORLD";
main(viod)
{
TRISB=0x00;
TRISC=0x00;
Lcd8_Init(&PORTC,&PORTB);
Lcd8_Cmd(LCD_CLEAR);
Lcd8_Cmd(LCD_SECOND_ROW);
Lcd8_Out(1,1,text);
}

PLZ help me guys..........
 
Try adding a delay of 100ms after you write to the TRIS registers.

Mike.
 
Pommie said:
Try adding a delay of 100ms after you write to the TRIS registers.

Mike.

hi Pommie ,
when i introduce the delay in the programme as u suggested ,
but same problem occuring....
here is my new code
Code:
char*text="HELLO";
char*texe1="world";
void main();
{TRISB=0x00;
Delay_ms(100);
TRISC=0x00;
Delay_ms(100);
Lcd8_Init(&PORTC,&PORTB);
Lcd8_cmd(LCD_TURN_ON);
Lcd8_cmd(LCD_RETURN_HOME);
Lcd8_cmd(LCD_SECOND_ROW);
Lcd8_cmd(LCD_CLEAR):
Delay_ms(100);
Lcd8_Out(1,1,text);
Delay_ms(100);
Lcd8_Out(2,1,text1);
Delay_ms(100);
Lcd8_cmd(LCD_CURSOR_OFF);
}


when i run this program ,some characters are missing in between a word.
 
Wouldn't the library be based on a particular clock speed? Does your PIC match the expected speed?

(Just a guess without having reviewed the source of the library)

Also.. if you have a 16x1 display.. why are you calling LCD_SECOND_ROW ??
 
16X1 display are actually 8X2... but on one line.

It's always handy to know the PIC#, the OSC speed AND the config fuses settings though :eek:
 
Without having access to the compiler and knowing what the various library calls do, it is not easy to suggest a possible solution. The intermittent nature of the problem suggested timing, not so it seems. My only other suggestion is hardware, lack of decoupling capacitors, dry joints, intermittent connections etc.

Do MicroC have a forum where you can ask for help?

Mike.
 
LabRat said:
Also.. if you have a 16x1 display.. why are you calling LCD_SECOND_ROW ??

if i don't call LCD_SECOND_ROW,
it displaying only first 8characters only....
also its starts displaying from 2nd character when i give Lcd8_Out(1,1,text) this instruction....
 
Pommie said:
Without having access to the compiler and knowing what the various library calls do, it is not easy to suggest a possible solution. The intermittent nature of the problem suggested timing, not so it seems. My only other suggestion is hardware, lack of decoupling capacitors, dry joints, intermittent connections etc.

Do MicroC have a forum where you can ask for help?

Mike.
it displays but when i swicth on & switch off the power supply for some times in between this process once it displays the required character..
 
what PIC are you using, what ferquency crystal, doing this on an EasyPIC board? Looking at their Lcd8 example, it seems you're doing it right:
Code:
char *text = "mikroElektronika";

void main() {
  TRISB = 0;                  // PORTB is output
  TRISC = 0;                  // PORTC is output
  Lcd8_Init(&PORTB, &PORTC);  // Initialize LCD at PORTB and PORTC
  Lcd8_Cmd(LCD_CURSOR_OFF);   // Turn off cursor
  Lcd8_Out(1, 1, text);       // Print text on LCD
}
 
Status
Not open for further replies.

Latest threads

Back
Top