Alberto Dan
Junior Member level 3
Hy i have a problem and and don't uderstand why is not work.i connect a pic 16f628A on LCD 16x2 1602A,I use microK to write the code and pickit3 to send code on pic.After i upload the code on PIC the LCD just stay open,the message not apear on it.What i can do?The code is below:
Please i need help!
Please i need help!
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 sbit LCD_RS at RA0_bit; sbit LCD_EN at RA1_bit; sbit LCD_D4 at RB4_bit; sbit LCD_D5 at RB5_bit; sbit LCD_D6 at RB6_bit; sbit LCD_D7 at RB7_bit; sbit LCD_RS_Direction at TRISA0_bit; sbit LCD_EN_Direction at TRISA1_bit; sbit LCD_D4_Direction at TRISB4_bit; sbit LCD_D5_Direction at TRISB5_bit; sbit LCD_D6_Direction at TRISB6_bit; sbit LCD_D7_Direction at TRISB7_bit; // End LCD module connection definition // Define Messages char message1[] = "Welcome to"; char message2[] = "My world"; void main() { //ANSEL = 0b00000000; //All I/O pins are configured as digital CMCON = 0x07 ; // Disbale comparators TRISB = 0b00000000; // PORTC All Outputs TRISA = 0b00000000; // PORTA All Outputs, Except RA3 Lcd_Init(); // Initialize LCD do { Lcd_Cmd(_LCD_CLEAR); // CLEAR display Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off Lcd_Out(1,4,message1); // Write message1 in 1st row Lcd_Out(2,1,message2); // Write message2 in 2nd row Delay_ms(1000); // Wait for 1 sec Lcd_Cmd(_LCD_CLEAR); // Clear display Delay_ms(1000); // Wait for 1 sec } while(1); // Infinite Loop }
Last edited by a moderator: