- This topic has 1 reply, 2 voices, and was last updated 12 years, 5 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
|
Microcontroller › PIC › lcd interface with pic 16f877a
hey! …im trying to display a string on 16×2 lcd using pic16f877a but nothing is being displayed…m using a pic dev board (20mhz) …n using mikroC compiler…..pls help…
my code:
sbit LCD_RS at RD4_bit;
sbit LCD_EN at RD5_bit;
sbit LCD_D0 at RB0_bit;
sbit LCD_D1 at RB1_bit;
sbit LCD_D2 at RB2_bit;
sbit LCD_D3 at RB3_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 TRISD4_bit;
sbit LCD_EN_Direction at TRISD5_bit;
sbit LCD_D0_Direction at TRISB0_bit;
sbit LCD_D1_Direction at TRISB1_bit;
sbit LCD_D2_Direction at TRISB2_bit;
sbit LCD_D3_Direction at TRISB3_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 connections
char *text = “Hello World!”;
void main()
{
CMCON = 0x07;
TRISB = 0; // PORTB is output
delay_us(100);
Lcd_Init(&PORTB); // Initialize LCD connected to PORTB
delay_us(100);
Lcd_Cmd(Lcd_CLEAR); // Clear display
Lcd_Cmd(Lcd_CURSOR_OFF); // Turn cursor off
Lcd_Out(1, 1, text); // Print text to LCD
}
You please give the clear, cursor and dispaly functions also.