![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | Thread Tools | Display Modes |
| | (permalink) |
| Experienced 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);
}
__________________ |
| | |
| | (permalink) |
| Experienced Member | Try adding a delay of 100ms after you write to the TRIS registers. Mike. |
| | |
| | (permalink) | |
| Experienced Member | Quote:
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.
__________________ | |
| | |
| | (permalink) |
| Experienced Member | 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 ?? |
| | |
| | (permalink) |
| Experienced Member | 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 |
| | |
| | (permalink) |
| Experienced Member | 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. |
| | |
| | (permalink) | |
| Experienced Member | Quote:
it displaying only first 8characters only.... also its starts displaying from 2nd character when i give Lcd8_Out(1,1,text) this instruction....
__________________ | |
| | |
| | (permalink) | |
| Experienced Member | Quote:
__________________ | |
| | |
| | (permalink) |
| Experienced Member | 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
} |
| | |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| 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 |