Hi, I like to ask how is the procedure like to program a 16x2 LCD (RT1602C) using 4-bits transmission and MCC-18 and PIC18F4520.
I had th"ESE" code which I found from the internet. However, I had tried all of them but still could not show anything on the LCD. There are times where it flashed some black box on the LCD but there are really rare and when I just amend some lines, there are no boxes anymore. Hence I could not find out what is the mistake.
I am using RT1602C. where the pins are as followed:
After initializing the port as output, these are the program:
I had these code from "some" website, but realising the need to set x03 and x02 in the begining. But I am still not know what is wrong with the program.
Pls help. Thanks
I had th"ESE" code which I found from the internet. However, I had tried all of them but still could not show anything on the LCD. There are times where it flashed some black box on the LCD but there are really rare and when I just amend some lines, there are no boxes anymore. Hence I could not find out what is the mistake.
I am using RT1602C. where the pins are as followed:
Code:
1---------------------GND
2---------------------VDD (This is the supply voltage for Logic)
3 ----------------V0 (Contrast) Connect to 1k resistor then to GND [color="#ff0000"]
[/color]4 ----------------RS
5 ----------------R/W
6 ---------------E (Enable)
7 ---------------DB0 (ignore as I am using 4 bits)
8 ---------------DB1 (ignore as I am using 4 bits)
9 ---------------DB2 (ignore as I am using 4 bits)
10 ---------------DB3 (ignore as I am using 4 bits)
11 -------------DB4 (Connected to Microchip RD0)
12 -------------DB5 (Connected to Microchip RD1)
13 -------------DB6 (Connected to Microchip RD2)
14 -------------DB7 (Connected to Microchip RD3)
15 -------------BL1 (connected straight to +5V)
16 -------------BL2 (connected straight to GND)
After initializing the port as output, these are the program:
Code:
Lcd_VEE = 1;
LATD=0b10000000;
Delay10KTCYx(50);
Write_Lcd (0x03,0);
Delay10KTCYx(50);
Write_Lcd (0x03,0);
Delay10KTCYx(50);
Write_Lcd (0x03,0);
Delay10KTCYx(50);
Write_Lcd (0x02,0);
Delay10KTCYx(50);
Write_Lcd (0x02,0);
Delay10KTCYx(50);
Write_Lcd (0x20,0); //B0010 0000
Write_Lcd (0x28,0); //B0010 1000
Write_Lcd (0x06,0); //B0010 1000
Write_Lcd (0x0e,0); //B0000 1100
Write_Lcd (0x01,0); //B0000 0001
Write_Lcd (0x02,0); //B0000 0010
Pls help. Thanks