1602a lcd is not working with pic16f877

Post your requests and ideas for the mikroElektronika website & forums.
Post Reply
Author
Message
madhav
Posts: 3
Joined: 18 Mar 2014 15:28

1602a lcd is not working with pic16f877

#1 Post by madhav » 18 Mar 2014 16:10

hello, i am new to mcu's i have tried some simple examples that were in the net such as using LED, PWM signals, IR sensors... . Now i want to use a IR sensor and get the readings in a 16X2 LCD. I have done the circuit connection as show in example LCD of MikroC Pro. The LCD has some square brackets on it ( i think its the place where the alphabets should be shown ) but i cannot see any characters after i downloaded the program to mcu. i searched in the net somewhere i found out this " make sure that MikroC library supports your LCD ".
Can you please help me figure out what the issue is ?. Best regards :)
used this code:

Code: Select all


sbit LCD_RS at RB0_bit;
sbit LCD_EN at RB1_bit;
sbit LCD_D4 at RB2_bit;
sbit LCD_D5 at RB3_bit;
sbit LCD_D6 at RB4_bit;
sbit LCD_D7 at RB5_bit;

sbit LCD_RS_Direction at TRISB0_bit;
sbit LCD_EN_Direction at TRISB1_bit;
sbit LCD_D4_Direction at TRISB2_bit;
sbit LCD_D5_Direction at TRISB3_bit;
sbit LCD_D6_Direction at TRISB4_bit;
sbit LCD_D7_Direction at TRISB5_bit;
// End LCD module connections

void main(){

TRISB = 0;
  Lcd_Init();                        // Initialize LCD
  Lcd_Cmd(_LCD_CLEAR);               // Clear display
  Lcd_Cmd(_LCD_CURSOR_OFF);
  Lcd_Out(1,1,"HELLO WORLD");          // Cursor off
}


User avatar
petar.timotijevic
mikroElektronika team
Posts: 1739
Joined: 19 Feb 2014 13:46
Location: Serbia
Contact:

Re: 1602a lcd is not working with pic16f877

#2 Post by petar.timotijevic » 18 Mar 2014 20:24

Hello MatHav and welcome to the MikroE forum,

The mikroC PRO for PIC provides a library for communication with Lcds (with HD44780 compliant controllers) through the 4-bit interface. An example of Lcd connections is given on the schematic at the bottom of this page.


Please see LCD library description:

MikroC Pro for PIC - LCD Library
http://www.mikroe.com/download/eng/docu ... ibrary.htm


- Check what LCD controller you have.

- Check LCD connections with MCU.


Best regards,
Peter

madhav
Posts: 3
Joined: 18 Mar 2014 15:28

Re: 1602a lcd is not working with pic16f877

#3 Post by madhav » 19 Mar 2014 06:09

sir, i found out that my LCD module uses SPLC780D controller according to the link below.
http://www.icstation.com/product_info.p ... ykdCWQ9SQk

User avatar
petar.timotijevic
mikroElektronika team
Posts: 1739
Joined: 19 Feb 2014 13:46
Location: Serbia
Contact:

Re: 1602a lcd is not working with pic16f877

#4 Post by petar.timotijevic » 19 Mar 2014 09:31

Hello,

Yes, your LCD is compatible with HD44780.

Please check LCD connections with MCU and pin assigments in segment of LCD initialization.

Try to add this before LCD_Init()

Code: Select all

  
  ADCON1  = 0;                       // Configure AN pins as digital I/O
  CMCON = 0;                         // Disable comparators
Best regards,
Peter

madhav
Posts: 3
Joined: 18 Mar 2014 15:28

Re: 1602a lcd is not working with pic16f877

#5 Post by madhav » 19 Mar 2014 18:50

sir my LCD pins are connected to mcu PIC16F877 port B0~B7 i dont think setting ADCON bits would make difference and i tried doing that too but there wasn't any change.
Also in the description of the link i posted above says that the controller IC is SPLC780D or equal, does it equal to 1602A HD44780?
I am trying to write a library according to that datasheet, can you recommend me some materials that would help me in writing the library file. Thank you

User avatar
petar.timotijevic
mikroElektronika team
Posts: 1739
Joined: 19 Feb 2014 13:46
Location: Serbia
Contact:

Re: 1602a lcd is not working with pic16f877

#6 Post by petar.timotijevic » 20 Mar 2014 12:05

madhav wrote:sir my LCD pins are connected to mcu PIC16F877 port B0~B7 i dont think setting ADCON bits would make difference and i tried doing that too but there wasn't any change.
Also in the description of the link i posted above says that the controller IC is SPLC780D or equal, does it equal to 1602A HD44780?
I am trying to write a library according to that datasheet, can you recommend me some materials that would help me in writing the library file. Thank you
Hello,

In your link for LCD they mention HD44780:
Product Name: 1602A HD44780 Character LCD Display Module LCM Blue Backlight
Try to find display datasheet and check compatibility with HD44780 controller.


Best regards,
Peter

Post Reply

Return to “Website & Forums Wishlist”