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.

[PIC] Pic 16f676 1602 lcd module connection problem

Status
Not open for further replies.

khaled01819

Newbie level 6
Newbie level 6
Joined
May 27, 2010
Messages
11
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,283
Location
bangladesh
Visit site
Activity points
1,370
Hi! I m very new here. i m trying to connect 1602 alphanumeric lcd with pic 16f676 for display message. but it is not responding. I have write following example c-code bellow.


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

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

char Message1[]="THIS IS AN";
char Message2[]="Alphanumaric";
char Message3[]="LCD";
char Message4[]="Test Project";

void main() {

ADCON = 0x00;
CMCON = 0x00;
TRISC = 0xFF;
TRISA = 0xFF;

do {
Lcd_Init();
Lcd_Cmd(_LCD_CLEAR);
Lcd_Cmd(_Lcd_Cursor_off);
Lcd_Out(1,1,Message1);
Lcd_Out(2,1,Message2);
delay_ms(5000);

Lcd_Cmd(_LCD_CLEAR);
Lcd_Cmd(_Lcd_Cursor_off);
Lcd_Out(1,1,Message3);
Lcd_Out(2,1,Message4);
delay_ms(5000);

} while(1);

} // End main()


what is the change need for solution
plz anybody help me..........
 

I have not looked at your code, as in my experience many users just get the LCD wiring wrong. Check your wiring is to the correct data pins and also adjust the contrast control over its full range, normally the display only shows characters over a small adjustment range. If you see dark rectangles you are getting close to the correct bias point.

If this doesn't help check the delays used in the routines _Init, _Cmd and _Out, as these must not be too short.
 


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
33
34
35
36
37
38
39
40
41
42
43
44
// LCD module connections
sbit LCD_RS at RC0_bit;
sbit LCD_EN at RC1_bit;
sbit LCD_D4 at RC2_bit;
sbit LCD_D5 at RC3_bit;
sbit LCD_D6 at RC4_bit;
sbit LCD_D7 at RC5_bit;
 
sbit LCD_RS_Direction at TRISC0_bit;
sbit LCD_EN_Direction at TRISC1_bit;
sbit LCD_D4_Direction at TRISC2_bit;
sbit LCD_D5_Direction at TRISC3_bit;
sbit LCD_D6_Direction at TRISC4_bit;
sbit LCD_D7_Direction at TRISC5_bit;
// End LCD module connections
 
char Message1[] = "THIS IS AN      ";
char Message2[] = "Alphanumaric    ";
char Message3[] = "LCD             ";
char Message4[] = "Test Project    ";
 
void main() {
 
    ANSEL = 0x00;
    TRISC = 0x00;
    PORTC = 0x00;
    
    Lcd_Init();
    Lcd_Cmd(_LCD_CLEAR);
    Lcd_Cmd(_Lcd_Cursor_off);
 
    do{
        
        Lcd_Out(1,1,Message1);
        Lcd_Out(2,1,Message2);
        Delay_ms(5000);
    
        Lcd_Out(1,1,Message3);
        Lcd_Out(2,1,Message4);
        Delay_ms(5000);
 
    }while(1);
 
}

 
Last edited:

first of all write your code with purely your requirement . in your code u make porta as a input so i think that is not used and second is oh yes jayanth as mentioned all requirement so try to this code and simulate with Proteus if any error find then post Proteus file.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top