LCD 16X1 problem

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
User avatar
fotios
Posts: 458
Joined: Mon Feb 08, 2010 10:17 am
Location: Greece
Has thanked: 109 times
Been thanked: 117 times
Contact:

LCD 16X1 problem

Post 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
Best Regards FOTIS ANAGNOSTOU

brandonb
Posts: 438
Joined: Mon Aug 29, 2011 12:26 am
Location: arizona
Has thanked: 175 times
Been thanked: 173 times
Contact:

Re: LCD 16X1 problem

Post 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:
Attachments
16x1 temp fix.fcf
(15.86 KiB) Downloaded 348 times

Spanish_dude
Posts: 594
Joined: Thu Sep 17, 2009 7:52 am
Location: Belgium
Has thanked: 63 times
Been thanked: 102 times
Contact:

Re: LCD 16X1 problem

Post by Spanish_dude »

Have you tried just keeping the configuration at 16x2 and only writing on the first line ?

User avatar
fotios
Posts: 458
Joined: Mon Feb 08, 2010 10:17 am
Location: Greece
Has thanked: 109 times
Been thanked: 117 times
Contact:

Re: LCD 16X1 problem

Post 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.
Best Regards FOTIS ANAGNOSTOU

Spanish_dude
Posts: 594
Joined: Thu Sep 17, 2009 7:52 am
Location: Belgium
Has thanked: 63 times
Been thanked: 102 times
Contact:

Re: LCD 16X1 problem

Post 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.

User avatar
fotios
Posts: 458
Joined: Mon Feb 08, 2010 10:17 am
Location: Greece
Has thanked: 109 times
Been thanked: 117 times
Contact:

Re: LCD 16X1 problem

Post by fotios »

My LCD is 16X1. Here a picture how it prints in 8X2 configuration. Attached is the datasheet.
Attachments
Pilium LCD1.jpg
Pilium LCD1.jpg (120.26 KiB) Viewed 9636 times
MIDAS LCD 1X16.pdf
(1.29 MiB) Downloaded 341 times
Best Regards FOTIS ANAGNOSTOU

brandonb
Posts: 438
Joined: Mon Aug 29, 2011 12:26 am
Location: arizona
Has thanked: 175 times
Been thanked: 173 times
Contact:

Re: LCD 16X1 problem

Post by brandonb »

fotio's post your flowchart and i'll change the code to make it work for you

User avatar
fotios
Posts: 458
Joined: Mon Feb 08, 2010 10:17 am
Location: Greece
Has thanked: 109 times
Been thanked: 117 times
Contact:

Re: LCD 16X1 problem

Post 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.
Attachments
PILIUM_CONTROL_LCD.fcf
(85.84 KiB) Downloaded 321 times
Best Regards FOTIS ANAGNOSTOU

brandonb
Posts: 438
Joined: Mon Aug 29, 2011 12:26 am
Location: arizona
Has thanked: 175 times
Been thanked: 173 times
Contact:

Re: LCD 16X1 problem

Post by brandonb »

try this... use it as a 1x16 that is addresses 0-16 for cursor
PILIUM_CONTROL_LCD.fcf
(90.14 KiB) Downloaded 508 times

User avatar
fotios
Posts: 458
Joined: Mon Feb 08, 2010 10:17 am
Location: Greece
Has thanked: 109 times
Been thanked: 117 times
Contact:

Re: LCD 16X1 problem

Post 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!
Best Regards FOTIS ANAGNOSTOU

Post Reply