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

User avatar
fotios
Posts: 436
Joined: Mon Feb 08, 2010 10:17 am
Location: Greece
Has thanked: 100 times
Been thanked: 113 times
Contact:

LCD 16X1 problem

Postby fotios » Wed Oct 16, 2013 6:04 pm

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

Postby brandonb » Thu Oct 17, 2013 8:37 am

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 168 times
These users thanked the author brandonb for the post (total 2):
fotios (Thu Oct 17, 2013 10:54 am) • Kenrix2 (Sun Oct 20, 2013 9:47 am)
Rating: 10%
 

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

Postby Spanish_dude » Fri Oct 18, 2013 12:13 am

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

User avatar
fotios
Posts: 436
Joined: Mon Feb 08, 2010 10:17 am
Location: Greece
Has thanked: 100 times
Been thanked: 113 times
Contact:

Re: LCD 16X1 problem

Postby fotios » Fri Oct 18, 2013 6:47 am

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

Postby Spanish_dude » Sun Oct 20, 2013 2:16 am

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.
These users thanked the author Spanish_dude for the post:
fotios (Sun Oct 20, 2013 5:26 pm)
Rating: 5%
 

User avatar
fotios
Posts: 436
Joined: Mon Feb 08, 2010 10:17 am
Location: Greece
Has thanked: 100 times
Been thanked: 113 times
Contact:

Re: LCD 16X1 problem

Postby fotios » Sun Oct 20, 2013 8:59 am

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.27 KiB) Viewed 5315 times
MIDAS LCD 1X16.pdf
(1.29 MiB) Downloaded 155 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

Postby brandonb » Sun Oct 20, 2013 1:42 pm

fotio's post your flowchart and i'll change the code to make it work for you
These users thanked the author brandonb for the post (total 3):
dazz (Sun Oct 20, 2013 4:52 pm) • fotios (Sun Oct 20, 2013 5:25 pm) • medelec35 (Thu Nov 07, 2013 2:12 pm)
Rating: 15%
 

User avatar
fotios
Posts: 436
Joined: Mon Feb 08, 2010 10:17 am
Location: Greece
Has thanked: 100 times
Been thanked: 113 times
Contact:

Re: LCD 16X1 problem

Postby fotios » Sun Oct 20, 2013 5:05 pm

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 149 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

Postby brandonb » Sun Oct 20, 2013 7:37 pm

try this... use it as a 1x16 that is addresses 0-16 for cursor
PILIUM_CONTROL_LCD.fcf
(90.14 KiB) Downloaded 249 times
These users thanked the author brandonb for the post (total 2):
fotios (Thu Nov 07, 2013 1:18 pm) • medelec35 (Thu Nov 07, 2013 2:11 pm)
Rating: 10%
 

User avatar
fotios
Posts: 436
Joined: Mon Feb 08, 2010 10:17 am
Location: Greece
Has thanked: 100 times
Been thanked: 113 times
Contact:

Re: LCD 16X1 problem

Postby fotios » Thu Nov 07, 2013 1:19 pm

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!
These users thanked the author fotios for the post:
brandonb (Fri Nov 08, 2013 1:42 am)
Rating: 5%
 
Best Regards FOTIS ANAGNOSTOU