Jump to content
Sign in to follow this  
djl

Lcd Plugin Enhancements

Recommended Posts

1) Add support for 4x20 display. Logically, these are identical to the 2x40 display, so we just need to display the output in 4 lines, rather than in 2.

 

2) Allow for a physically smaller display of the LCD on the screen. Current size won't show all 40 columns of a 2x40 display on a 1280x1024 screen. Adding a mode that is 50-75% the size of the current one would allow that.

Share this post


Link to post
Share on other sites

djl,

 

1) Add support for 4x20 display. Logically, these are identical to the 2x40 display, so we just need to display the output in 4 lines, rather than in 2.
This is currently under test, so should be in the next release.

 

Regards

Dave

Share this post


Link to post
Share on other sites
2) Allow for a physically smaller display of the LCD on the screen. Current size won't show all 40 columns of a 2x40 display on a 1280x1024 screen. Adding a mode that is 50-75% the size of the current one would allow that.
And now this is done <_< , display supports three fonts that mean the display gets resized. Currently under test will be, in the next release.

 

Regards

Dave

Share this post


Link to post
Share on other sites

Beta version of the LCD plugin is available for testing from here (this link will expire once new IDE release 6.16 or lates is out). It now supports 4 lines mode and different font sizes. Note that you need to have a valid extra plugins license to be able to use this plugin.

 

Regards,

Pavel

Share this post


Link to post
Share on other sites
Beta version of the LCD plugin is available for testing from here (this link will expire once new IDE release 6.16 or lates is out).
What is the memory map of the new 4x20 mode?

 

In the display that I am using in my project (Truly MTC-C204DPLY-1N), line 1 is 0x0-0x13, line 3 is 0x14-0x27, line 2 is 0x40 - 0x53, and line four is 0x54-0x67. So logiclaly, lines 1 and 3 are the same line (0x0 - 0x27) and lines 2 and 4 are the same line (0x40 - 0x67).

 

I have modified lcd_driver.h to support that map, but that doesn't appear to be the map that this plugin uses (based on my initial tests :-)

 

***dan

Share this post


Link to post
Share on other sites

Dan,

 

As I don't have this display hardware, I couldn't test it to see if its the same as the real world.

 

Based on this feedback:

Could you please add LCD size 20x4? Lines are crossed like this:

 

line 1 first byte 0x0h

line 2 first byte 0x40h

line 3 first byte 0x14h

line 4 first byte 0x54h

 

Everything else is same as now.

The LCD works just fine.  Something that was not obvious to me, but perhaps

to the rest of you is that this display acts like a 2x40 display, instead of

a 4x20, ie. to get to the start of line 3, you use lcd_gotxy(20,0)... ust

something I found interesting.

void main()
{		
trisa = 0x00; // port a output

while( 1 )
{
	LCD_Setup();
	char i = 0;

	LCD_FunctionMode();
	LCD_Write( set_dd_ram + 0x00 );
	LCD_DataMode();
	lprintf( "1" );

	LCD_FunctionMode();
	LCD_Write( set_dd_ram + 0x40 );
	LCD_DataMode();
	lprintf( "2" );

	LCD_FunctionMode();
	LCD_Write( set_dd_ram + 0x14 );
	LCD_DataMode();
	lprintf( "3" );

	LCD_FunctionMode();
	LCD_Write( set_dd_ram + 0x54 );
	LCD_DataMode();
	lprintf( "4" );
}
}

 

So I beleive it to be correct.

 

Regards

Dave

Share this post


Link to post
Share on other sites

Not sure if you want feedback by email or here...

 

In my testing, if I explicitly set the location that I want to write to, e.g.

for (row = 0; row < 4; row++)
  for (col = 0; col < 20; col++)
  {
      lcdgoto_xy(col, row);
      lprintf("%1d", col);
  }

 

Then the plugin works fine.

 

However, if I rely on the auto-increment function of the LCD, e.g.

for (row = 0; row < 4; row++)
   {
      lcdgoto_xy(0, row);
      for (col = 0; col < 20; col++)
         lprintf("%1d", col);
   }

 

then it works fine for all of rows 1-3, and for the first column of row 4, but when I try to write to the second column of row 4 I write to row 1 column 0 instead, and then it autoincrements to 2,0 then 3,0 etc. So to be clear, the autoincrement jumps from 0,3 to 1,0 - when it should go from 0,3 to 1,3.

 

***dan

Share this post


Link to post
Share on other sites

I should not that the easiest way to see this "bug" is to do

lcdgoto_xy(0,3);
lprintf("Print Anything");

The "Print" will be split between rows 3 and 0.

Share this post


Link to post
Share on other sites

Dan,

I should not that the easiest way to see this "bug" is to doCODElcdgoto_xy(0,3);

lprintf("Print Anything");

The "Print" will be split between rows 3 and 0.

OK, but what happens on an actual 20x4 (or 4x20) display ?

 

Regards

Dave

Share this post


Link to post
Share on other sites
OK, but what happens on an actual 20x4 (or 4x20) display ?

I will check tonight if I have time - but I'm quite certain that it won't jump like the plugin does :-) If

lcdgoto_xy(0,3);
lprintf("T");
lcdgoto_xy(1,3);
lprintf("e");
lcdgoto_xy(2,3);
lprintf("s");
lcdgoto_xy(3,3);
lprintf("t");

writes "Test" to the first four columns on the bottom row, then

lcdgoto_xy(0,3); 
lprintf("Test");

should also write "Test" from locations 0,3 to 3,3 and it doesn't...

 

BTW this works as expected (correctly) on the new plugin in 2x40 mode- which is logically identical to the 4x20 mode.

 

***dan

Share this post


Link to post
Share on other sites
OK, but what happens on an actual 20x4 (or 4x20) display ?

I verified tonight that my code works correctly on the actual Truly 4x20 display, and incorrectly in the new 4x20 plugin. The bug is exactly as I described, and can be reproduced as I described using the code fragments provided.

 

***dan

Share this post


Link to post
Share on other sites
In my testing, if I explicitly set the location that I want to write to, e.g.

 

for (row = 0; row < 4; row++)
 for (col = 0; col < 20; col++)
 {
     lcdgoto_xy(col, row);
     lprintf("%1d", col);
 }

Then the plugin works fine.

I don't recognise the lcdgoto_xy() function, the one in the lcd_driver file is lcd_gotoxy().

 

For me this code ( using lcd_gotoxy() ) only works fine for the first to lines.

Can you clarify what you are doing.

 

Please zip up and send a sample project to support@picant.com, that works with an actual display.

 

Please also add tests in for display scolling, as this is another thing that may be incorrect.

 

Regards

Dave

Share this post


Link to post
Share on other sites

I worked out what was wrong - finally.

Hopefully this functions as per the real display (as mentioned before I don't have one of these displays to compare against).

 

The corrected version will be included in the next plugin release (due to happen soon).

 

Regards

Dave

Share this post


Link to post
Share on other sites

Your content will need to be approved by a moderator

Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×