Hello,
I´m trying to create a code using custom character method (LCD Custom Character Tool) in MikroC but it is not working with Winstar OLED 16x2 display, which uses WS0010 controller. Is there any incompatibility between the code generation and this controller that I´m not aware of? By the way, the hardware is EasyPic Pro V7, everything works fine except the custom character.
Example code I am using to put the custom character in row 2, column 2:
const char bat1[] = {31,16,16,16,16,16,31,0};
void CustomBat1(char pos_row, char pos_char) {
char i;
Lcd_Cmd(64);
for (i = 0; i<=7; i++) Lcd_Chr_CP(bat1);
Lcd_Cmd(_LCD_RETURN_HOME);
Lcd_Chr(pos_row, pos_char, 0);
}
void main()
{
CustomBat1(2, 2);
while(1){}
}
Thanks.
Winstar WS0010 Custom Character Problem
- marina.petrovic
- Posts: 2986
- Joined: 18 Apr 2013 08:11
Re: Winstar WS0010 Custom Character Problem
Hi,
If I understand you properly, the LCD example from compiler works without problem?
...\mikroC PRO for PIC\Examples\Development Systems\EasyPICPRO7\Lcd
The mikroC PRO for PIC provides a library for communication with LCDs with HD44780 compliant controllers.
Did you try to add this part of the code into some working project?
Best regards,
Marina
If I understand you properly, the LCD example from compiler works without problem?
...\mikroC PRO for PIC\Examples\Development Systems\EasyPICPRO7\Lcd
The mikroC PRO for PIC provides a library for communication with LCDs with HD44780 compliant controllers.
Did you try to add this part of the code into some working project?
Best regards,
Marina
Re: Winstar WS0010 Custom Character Problem
Hi,
MikroC library for LCD doesn't work properly if you try to use Custom Character, I was wondering if it is a matter of incompatibility with WS0010 LCD controller. Do you have any information about that?
MikroC library for LCD doesn't work properly if you try to use Custom Character, I was wondering if it is a matter of incompatibility with WS0010 LCD controller. Do you have any information about that?
- marina.petrovic
- Posts: 2986
- Joined: 18 Apr 2013 08:11
Re: Winstar WS0010 Custom Character Problem
Hi,
Our LCD Custom Character tool uses the first 8 character places to put generated custom characters.
Please, take a look at WS0010 Datasheet, if the first 8 places are taken,
that can be the reason why LCD Custom Character tool doesn't work on your LCD.
Best regards,
Marina
Our LCD Custom Character tool uses the first 8 character places to put generated custom characters.
Please, take a look at WS0010 Datasheet, if the first 8 places are taken,
that can be the reason why LCD Custom Character tool doesn't work on your LCD.
Best regards,
Marina
Re: Winstar WS0010 Custom Character Problem
Problem solved. After some struggling, it seemed to be a problem with the correct CGRAM increment and the return of the DDRAM address at the end of the function. Here is the working code I found out for the custom character function using WS0010 controller:
const char character[] = {30,2,1,1,1,2,30,0}; //Example
void CustomChar(char pos_row, char pos_char)
{
char i;
for (i=0; i<=7; i++)
{
Lcd_Cmd(i+64);
Lcd_Chr_CP(character);
}
Lcd_Cmd(_LCD_RETURN_HOME);
Lcd_Chr(pos_row, pos_char, 0);
Lcd_Cmd(128);
}
Thanks Marina.
const char character[] = {30,2,1,1,1,2,30,0}; //Example
void CustomChar(char pos_row, char pos_char)
{
char i;
for (i=0; i<=7; i++)
{
Lcd_Cmd(i+64);
Lcd_Chr_CP(character);
}
Lcd_Cmd(_LCD_RETURN_HOME);
Lcd_Chr(pos_row, pos_char, 0);
Lcd_Cmd(128);
}
Thanks Marina.