Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Thread Tools Display Modes
Old 14th April 2008, 06:09 AM   (permalink)
Experienced Member
sachin.kolkar is infamous around these parts
Post Lcd Problem

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..........
__________________
sachin.kolkar is offline   Reply With Quote
Old 14th April 2008, 08:08 AM   (permalink)
Experienced Member
Pommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to behold
Default

Try adding a delay of 100ms after you write to the TRIS registers.

Mike.
Pommie is offline   Reply With Quote
Old 16th April 2008, 05:18 AM   (permalink)
Experienced Member
sachin.kolkar is infamous around these parts
Red face

Quote:
Originally Posted by Pommie
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.
__________________
sachin.kolkar is offline   Reply With Quote
Old 16th April 2008, 02:56 PM   (permalink)
Experienced Member
 
LabRat has a spectacular aura about
Default

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 ??
LabRat is offline   Reply With Quote
Old 16th April 2008, 11:56 PM   (permalink)
Experienced Member
mister_e is on a distinguished road
Default

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
__________________
Steve
______________________
info@mister-e.org
www.mister-e.org
mister_e is offline   Reply With Quote
Old 17th April 2008, 12:24 AM   (permalink)
Experienced Member
Pommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to behold
Default

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.
Pommie is offline   Reply With Quote
Old 17th April 2008, 04:18 AM   (permalink)
Experienced Member
sachin.kolkar is infamous around these parts
Post

Quote:
Originally Posted by LabRat

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....
__________________
sachin.kolkar is offline   Reply With Quote
Old 17th April 2008, 04:24 AM   (permalink)
Experienced Member
sachin.kolkar is infamous around these parts
Question

Quote:
Originally Posted by Pommie
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..
__________________
sachin.kolkar is offline   Reply With Quote
Old 17th April 2008, 02:04 PM   (permalink)
Experienced Member
 
Norlin is just really niceNorlin is just really niceNorlin is just really nice
Send a message via ICQ to Norlin Send a message via AIM to Norlin Send a message via MSN to Norlin Send a message via Yahoo to Norlin Send a message via Skype™ to Norlin
Default

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
}
Norlin is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
ICL7106 and LCD problem mabauti General Electronics Chat 14 15th April 2008 04:28 AM
in trouble with LCD (JHD162A) smileguitar Micro Controllers 54 14th April 2008 08:17 AM
Problem of signal for an ECG with INA114 ninjasam Electronic Projects Design/Ideas/Reviews 4 28th January 2008 03:29 PM
16x2 LCD module problem Futterama Electronic Projects Design/Ideas/Reviews 7 11th January 2008 09:00 PM
strange color camera problem schrodingerscat Electronic Projects Design/Ideas/Reviews 5 4th October 2003 07:25 PM



All times are GMT. The time now is 06:10 AM.


Electronic Circuits  |  Radio Controlled
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.