20x4 LCD Display

Forum for problems or queries regarding the Flowcode application and compiler usage.

Moderators: Benj, Mods

Post Reply
Nick355
Posts: 3
Joined: Sat Feb 07, 2009 4:36 pm
Contact:

20x4 LCD Display

Post by Nick355 »

Hi, I seem to behaving problems with the cursor positioning on a 20x4 LCD display. So I have made a simple program to test this and it seems to the version of flowcode which makes the difference. If I compile the project with code version 3.4 it is all ok but if I compile the same project with version 3.6 the characters move to a different part of the screen which is not the cursor positions I have asked for? I have attached the two versions for you to look at. I look forward to your reply. Many thanks Nick
Attachments
LCD_Test_3_6.zip
(52.16 KiB) Downloaded 371 times
LCD_Test_3_4.zip
(50.17 KiB) Downloaded 338 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: 20x4 LCD Display

Post by Benj »

Hello Nick

Both seem to be working fine for me. Basically your program uses the bottom line at position 18.

Where abouts are your characters ending up in the two different versions?

Nick355
Posts: 3
Joined: Sat Feb 07, 2009 4:36 pm
Contact:

Re: 20x4 LCD Display

Post by Nick355 »

Hi Ben,

The version 3.4 is fine but in 3.6 ends up on bottom row position 14. To get to the bottom corner for example I have to put 23,3 for the possition, which obviously should be off the screen. It is fine in the simulation but goes wrong when I program the chip and it's on the real screen.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: 20x4 LCD Display

Post by Benj »

Hello

Ok you could try the following and see if that makes any improvements for your code. Inside the Flowcode V3/Components directory is a file named LCDDisplay_Code.c

Open this file into notepad and then find the following section of code.

Code: Select all

  #if (%j == 4)
	if (y==0)
		y=0x80;
	else if (y==1)
		y=0xc0;
	else if (y==2)
		y=0x90;
	else
		y=0xd0;
  #endif
Change to

Code: Select all

  #if (%j == 4)
	if (y==0)
		y=0x80;
	else if (y==1)
		y=0xc0;
	else if (y==2)
		y=0x90;
	else
		y=0xd4;
  #endif
Restart Flowcode and hopefully your LCD should now behaive on the chip as well as in simulation.

Its possible that line 2 may also exibit the same problem. If so then change 0x90 to 0x94.

Let me know how you get on and if you spot any further inconsistencies.

Nick355
Posts: 3
Joined: Sat Feb 07, 2009 4:36 pm
Contact:

Re: 20x4 LCD Display

Post by Nick355 »

That's fixed it, I did have to change the other line to fix line 2.

Many thanks for your help

Nick

Post Reply