hemnath
Advanced Member level 3
- Joined
- Jun 24, 2012
- Messages
- 702
- Helped
- 61
- Reputation
- 120
- Reaction score
- 57
- Trophy points
- 1,308
- Location
- Chennai
- Activity points
- 6,589
Hi Friends,
I'm interfacing KS0108 GLCD with PIC18F4520 controller. Compiler: CCS C. I have read the datasheet of KS0108 GLCD. But still i feel difficult in writing the code. I want to display "Hellow" in GLCD.
As a newbie in Graphic LCD, i tried CCS example and it was working good.
All i want to do is, making my font size as flexible. In CCS C compiler, there are only 2 font sizes which are 5x7 and 10x14. There are some instances where i will display some big size characters than 10x14. Also in CCS, there are inbuilt commands to use the X and Y addresses.
Now I'm writing the code as mentioned in datasheet. I want to display a character 'H' in the display. Please check initialization is correct? how to define hex values for character 'H'? Please help.
Thanks in advance.
I'm interfacing KS0108 GLCD with PIC18F4520 controller. Compiler: CCS C. I have read the datasheet of KS0108 GLCD. But still i feel difficult in writing the code. I want to display "Hellow" in GLCD.
As a newbie in Graphic LCD, i tried CCS example and it was working good.
All i want to do is, making my font size as flexible. In CCS C compiler, there are only 2 font sizes which are 5x7 and 10x14. There are some instances where i will display some big size characters than 10x14. Also in CCS, there are inbuilt commands to use the X and Y addresses.
Now I'm writing the code as mentioned in datasheet. I want to display a character 'H' in the display. Please check initialization is correct? how to define hex values for character 'H'? Please help.
HTML:
unsigned char data[] = {127,127,8,8,127,127,0,0}; // H, 8x8
void GRAPHIC_LCD_INIT()
{
output_high(RESET); // RST connected to PIN_C0
output_high(CS1); // CS1 connected to PIN_B0
output_high(CS2); // CS2 connected to PIN_B1
glcd_cmd(0x3F); // Display ON
glcd_cmd(0xB8); // Page selection - Page 1
glcd_cmd(0x40); // Column selection
}
void glcd_cmd(unsigned char c)
{
output_d(c);
output_low(RS);
output_low(RW);
output_high(EN);
delay_ms(15);
output_low(EN);
}
void glcd_data(unsigned char z)
{
output_d(z);
output_high(RS);
output_high(RW);
output_high(EN);
delay_ms(15);
output_low(EN);
}
void main()
{
GRAPHIC_LCD_INIT();
while(1)
{
glcd_cmd(0xC0); // display start line
glcd_data(data);
}
}
Thanks in advance.