20 x 4 line LCD

07 Aug 2009 . Edited: 07 Aug 2009

Hi guys,

I had a 20 character x 4 line display waiting around for a project and it had the same instruction set as the TextLCD example in the WiKi Cookbook, so I wired it up and ran the example program.  It worked rather nicely, except it wraps my lines after 16 characters so I need to modify your library code a bit. 

Should I start a new Wiki project page for this, or just add to the one that's already there?

Scott

I just tried to edit my earlier post, but it didn't update and gave me an error message.

Anyway, I just saw the post from Bhaveet Shah about the new TextLCD code, so I'll try that with my display next.

Scott

07 Aug 2009 . Edited: 07 Aug 2009

Hi Scott,

Before Bhaveet did his good work, I already did some experiments with the 4x20 displays, and got it working.

I have checked in my stuff at http://mbed.co.uk/projects/cookbook/svn/TextLCD4x20/trunk

Feel free to to have a a play with it... Merge it with Bhaveets work if you have the inclination :-)

Thanks,
Chris 

Hey Chris,

I'll do that, thanks.

Scott

09 Aug 2009 . Edited: 09 Aug 2009

Set JP1 on 1&2 and JP2 on 2&3 for USB power, switch them both for external 5V power.

09 Aug 2009

HI Scott,


Think the links to the pics are a bit broken...

I;d fix 'em but o dont know what they should be :-)

Cheers,
Chris

They're obsolete now, I just added a network connection.  I'll update and repost later.

Btw, you're 4x20 code is still set for 2x16 as the default.

Scott

Latest project update:

Development Board Photo:

pcb

Today's Schematic:

schematic

HTML for RPC screen capture:

screen capture

I need an example of the new HTTPServer initialization sequence to get my server code working again sinced Rolf updated the libraries - the old example code doesn't work anymore.

 

Scott

16 Aug 2009

Good point, I have to update the example too.

I will soon.

The interface changed to be more like the HTTPClient. It will be not needed to call the NetServer object directly. If you not want to change the MAC address or want to give a static IP.

 

#include "mbed.h"
#include "HTTPServer.h"
#include "HTTPRPC.h"
#include "HTTPFS.h"

using namespace std;

/* Create some objects and make them available in /rpc space */
DigitalOut led1(LED1, "led1");
DigitalOut led2(LED2, "led2");
DigitalOut led3(LED3, "led3");
DigitalOut led4(LED4, "led4");

LocalFileSystem local("local");
int main(void) {
  /* Create a HTTPServer on default Port */
  HTTPServer *http = new HTTPServer();
  /* Register RPC in /rpc space */
  http->addHandler(new HTTPRPC());
  /* Register local filesystem to all places which are not in /rpc */
  http->addHandler(new HTTPFileSystemHandler("/", "/local/"));

  printf("Waiting for the Interface comming up...\n");
  http->bind();

  while(1) {
    http->poll();
  }
}

To change the IP address or give a hostname to the device do:

#include "util.h"

int main(void) {
  NetServer *net = NetServer::create(ipv4addr(192,168,0,2), ipv4addr(255,255,255,0), ipv4addr(192,168,0,1));
  net->hostname("joe");

  /* Create a HTTPServer on default Port */
  HTTPServer *http = new HTTPServer();

 

Rolf

 

28 Oct 2009

If one is using a standard HD44780 LCD controller then all the above code commands should work.

I have not be able to find the code lines to modify to change the pixel dimensions of the display. Can we call these out in the main code file and set the number of columns and rows to the required number?  This would make integration of just about any parrallel LCD painless as they are almost all based upon teh HD44780 controller

I have a 2x20 LCD working but only showing the first 16 columns.  btw, I moved all my pin outs to p21-26,30 to free up the serial connection on p27,28.

 

30 Oct 2009 . Edited: 30 Oct 2009

Hey james, I also have a 20X2 display and it is working perfectly with all the lines working.

The code you need to use to change the size of the pixels is here:

 

TextLCD lcd(p21, p25, p26, p27, p28, p29, p30,20,2); // rs, rw, e, d0, d1, d2, d3

Assuming you are using the TextLCD library the last two integers are the size of your screen. If you have a 20X2 the last numbers would be 20 and 2,.

Just a question how did you get the IP address, what code is it?

30 Oct 2009

Vlad,  Thank you for the tip.  This would be good information to put in the documentation page.  I just commented it in my code.