this is my 2nd project to diaplay data in 2x16 character lcd. i have interface with 8051. it worked fine but with PIC 16f877a only LCD backlight is coming but data is not displayed. when i checked with development board for the same program it works fine but in Proteus i cant.
Please help me
Microcontroller -PIC16f877a
LCD pins- 1-gnd,2-vcc,3-10k pot,4-RB0,5-GND,6-RB1, 11 to 14- RB2 to RB5
4Mhz crystal with 22pf capacitors i have connected
for 1st pin i have connected VDD with 10k series resistor
below is my code which works fine with hardware
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
| 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;
// Pin direction
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;
void main()
{
ADCON1=0x07;//disable ADC
CMCON=0;//Disable comparators
Lcd_Init();
Lcd_Cmd(_LCD_CLEAR); // CLEAR display
Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off
Lcd_Out(1,1,"LCD Ready");
delay_ms(100);
} |
---------- Post added at 08:06 ---------- Previous post was at 07:35 ----------
LCd working fine now.I removed the oscillator circuit and rest circuit then i got the result
But i am confused whether they are in built in Proteus or what?