interfacing pic16f877a to 16x4 LCD. how?

Discussion in 'Embedded Systems and Microcontrollers' started by edski, Sep 23, 2010.

  1. edski

    Thread Starter Member

    Sep 22, 2010
    65
    0
    can anyone help me. using assembly language.. thanks
     
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    There is more to it than some code. The interface is the connection between the PIC and the display. The data sheets for the display will tell you what it needs to see in order to show a message. Then you need to figure out how to do that using I/O pins on the PIC.
     
  3. retched

    AAC Fanatic!

    Dec 5, 2009
    5,201
    312
    Depending on the compiler you are using, once you wire the display to the PIC, there may be functions available that make it as easy as:

    PrintToLCD("Hello");

    or something like that.

    That is entirely compiler dependent, however.
     
  4. Eng_Bandar

    Active Member

    Feb 27, 2010
    50
    1
    I can help you in MikroC Pro Compiler if you want?
     
  5. edski

    Thread Starter Member

    Sep 22, 2010
    65
    0
    @ eng_bandar. yes i appreciate your help. so how will i do that?... thanks
     
  6. Eng_Bandar

    Active Member

    Feb 27, 2010
    50
    1
    I will use Protues to simulate the circuit

    [​IMG]


    and this code

    Code ( (Unknown Language)):
    1.  
    2. // LCD module connections
    3. sbit LCD_RS at RB0_bit;
    4. sbit LCD_EN at RB1_bit;
    5. sbit LCD_D4 at RB2_bit;
    6. sbit LCD_D5 at RB3_bit;
    7. sbit LCD_D6 at RB4_bit;
    8. sbit LCD_D7 at RB5_bit;
    9. sbit LCD_RS_Direction at TRISB0_bit;
    10. sbit LCD_EN_Direction at TRISB1_bit;
    11. sbit LCD_D4_Direction at TRISB2_bit;
    12. sbit LCD_D5_Direction at TRISB3_bit;
    13. sbit LCD_D6_Direction at TRISB4_bit;
    14. sbit LCD_D7_Direction at TRISB5_bit;
    15. // End LCD module connections
    16. void main(){
    17.   Lcd_Init();                        // Initialize LCD
    18.   Lcd_Cmd(_LCD_CURSOR_OFF);          // Cursor off
    19.   Lcd_Out(1,1,"Hi World!");                 // Write text in first row
    20. }
    21.  
    Don't afraid this is simple code the main thing here this

    Code ( (Unknown Language)):
    1. void main(){
    2.   Lcd_Init();                        // Initialize LCD
    3.   Lcd_Cmd(_LCD_CURSOR_OFF);          // Cursor off
    4.   Lcd_Out(1,1,"Hi World!");                 // Write text in first row
    5. }
    6.  
    others, only configuration of LCD pins.
    If you want more explanation tell me.


    whole project in attachment
     
    • LCD.zip
      File size:
      25 KB
      Views:
      150
    Last edited: Sep 23, 2010
Loading...