Page 1 of 1

LCD 16X1 problem

Posted: Wed Oct 16, 2013 6:04 pm
by fotios
Hello
I bought two 16X1 LCDs, one cheap from e-bay and one expensive MIDAS with large characters from Farnell UK, both compatible with Hitachi HD44780 controller. If are configured in FlowCode as 16X1 only the first 8 characters are printed. If are configured as 8X2 then with proper calculation of cursor X/Y coordinates both can print correctly. OK the problem with this trick could be resolved but i have to write a huge code for a very complex project and the use of double component macros is not only time consumming, is also program memory consumming.
Can anyone help me please?
Thanks

Re: LCD 16X1 problem

Posted: Thu Oct 17, 2013 8:37 am
by brandonb
hey fotio's i don't have a 16x1 but i pretended i did with a 16x2... assumming that the address is starting with 0x0 for first char and char 8 is 0x40, give this a try
in supp window i created these variables

Code: Select all

char char_count=0;
char change_line=0;
then i created a new function for lcd called "check_line_status" in customize code section which is here

Code: Select all

if(char_count>7 && change_line==0){
 change_line=1;
 Cursor(0,1);
}
char_count=char_count+1;
also in customize code section delete and replace code in lcd with the code in example for these c code funtions
clear, print_string, print_number, print_ascii, cursor
this should work in the background to make it do what you want :wink:

Re: LCD 16X1 problem

Posted: Fri Oct 18, 2013 12:13 am
by Spanish_dude
Have you tried just keeping the configuration at 16x2 and only writing on the first line ?

Re: LCD 16X1 problem

Posted: Fri Oct 18, 2013 6:47 am
by fotios
Spanish_dude wrote:Have you tried just keeping the configuration at 16x2 and only writing on the first line ?
Yes, i tried the 16X2 configuration but again the same problem, only first 8 characters are printed.
Thanks friend by anyway.

Re: LCD 16X1 problem

Posted: Sun Oct 20, 2013 2:16 am
by Spanish_dude
It must be that the DDRAM on your LCD is re-arranged differently than on the 16x2 LCD from Matrix Multimedia, even though it's compatible with the HD44780 controller.

Maybe it's like Brandonb said. Instead of having a continuous DDRAM line from 0x00 to 0x0F, you have an LCD with a DDRAM going from 0x00 to 0x07 for the first half and 0x40 to 0x47 for the other half.

Re: LCD 16X1 problem

Posted: Sun Oct 20, 2013 8:59 am
by fotios
My LCD is 16X1. Here a picture how it prints in 8X2 configuration. Attached is the datasheet.

Re: LCD 16X1 problem

Posted: Sun Oct 20, 2013 1:42 pm
by brandonb
fotio's post your flowchart and i'll change the code to make it work for you

Re: LCD 16X1 problem

Posted: Sun Oct 20, 2013 5:05 pm
by fotios
brandonb wrote:fotio's post your flowchart and i'll change the code to make it work for you
OK fellow, since you persist on it, here is the - incomplete - fcf till now.

Re: LCD 16X1 problem

Posted: Sun Oct 20, 2013 7:37 pm
by brandonb
try this... use it as a 1x16 that is addresses 0-16 for cursor
PILIUM_CONTROL_LCD.fcf
(90.14 KiB) Downloaded 513 times

Re: LCD 16X1 problem

Posted: Thu Nov 07, 2013 1:19 pm
by fotios
brandonb wrote:try this... use it as a 1x16 that is addresses 0-16 for cursor
PILIUM_CONTROL_LCD.fcf
It works.
Thanks fellow from hot Arizona!