MobileLCD Library

23 Jul 2009

Dear all,
I noticed the cookbook section on Mobile LCD details a breakout board from Sparkfun. I think the one pointed to by the web link is the wrong type, so this needs to be corrected.

The actual one shown in the pictures in the arcticle on mobile LCDs referes to the Sparkfun breakout board, LCD 08683 - Nokia Olimex LCD, which is based on the Nokia 6610 LCD module.

The one pointed to via the web link is the Sparkfun LCD 08600 which is based on the Nokia 6100 LCD module.

I have purchased the later and it does not seem to work with the provided library, which is no suprise as the library was written for a different LCD. The  characters appear broken although the LCD commands seem to be the same. I'm not sure how different the displays.

As I now have the later of the two, is it possible to have a library for this LCD type (Nokia 6100), or the source code for the old library which i can modify to accomodate the new display?

 

23 Jul 2009

I think perhaps multiple LCD's could be supported with the same top level library command set especially if the drivers used in the LCD are very closely matched. It appears the two LCD's use a very similar setup so perhaps an additional component to the library would be one extra parameter in the function call setup to include a string name of the LCD driver. This way muliple devices can be supported from one library.

I think the two LCDs are so similar it may be even possible to drive then by modifiying some of the commands sent to them. If the actual command value is a #define in the header file, this would be even easier.

Example.

The command send usig the existing library to configure the LCD is

 
25     _rst = 0;
26     _spi.format(9);
27     _spi.frequency(5000000);
28     wait(0.001);
29     _rst = 1;
30     wait(0.001);
31     _select();
32     command(0xCA); // display control 
33     data(0);
34     data(32);
35     data(0);
36     command(0xBB); 
37     data(1);
38    
39     command(0xD1); // oscillator on
40     command(0x94); // sleep out
41     command(0x20); // power control
42     data(0x0F);
43     command(0xA7); // invert display
44
45     command(0x81); // Voltage control
46     data(39);      // contrast setting: 0..63
47     data(3);       // resistance ratio
48     wait(0.001);

The Nokia 6100 will uses different command numbers for Voltage Control, Sleep Out, and Display Control.

Making these #defines in the header file would allow for easy changes for example.

 

26 Nov 2009

Hi,

I'm currently trying to get the spark fun board to work but I can't get it to display correctly. I just get a blue background and white distorted letters that you cannot read. i have compared the commands and they are the same. any ideas?

Thanks

26 Nov 2009 . Edited: 26 Nov 2009

Hi Adam,

Adam Carlile wrote:
I'm currently trying to get the spark fun board to work but I can't get it to display correctly. I just get a blue background and white distorted letters that you cannot read. i have compared the commands and they are the same. any ideas?

Some of these displays use different drivers. There are two versions in the cookbook:

I suspect you are using the first, so try using the second one instead.

As an aside, this code needs some real reworking as it is all a bit messy; we'll try and do a similar thing to my experiments in 16x2 LCD (http://mbed.org/forum/topic/195/?page=1#comment-1068) where we have a unified graphics library interface with multiple implementations. I have the beginnings of one, and might look at this friday afternoon.

But it'd be good to know if the second code is functionally correct and solves your problem.

Simon

26 Nov 2009

Thats great thanks Simon, I have got it to display now!

I just need to get rid of the the blue line at the bottom of the screen!!

 

Cheers,

Adam

26 Nov 2009

Sorted it, Just had to change

command(0xCA); // display control data(0x0); data(0x20); data(0x0);

thanks for your help

Adam

 

27 Nov 2009

Adam,

You say you have sorted it.

You say you changed the command(0xCA) to what data values.

I have just got a Sparkfun board and it doesn't display anything with either library. Only the backlight turns on.

Have checked all the connections.

Any suggestions to getting it going. Board was sealed so don't suspect the unit is faulty at this stage.

Regards

Phil.

27 Nov 2009

Hi Phil,

The main thing with these Nokia clone displays is some have different drivers chips in.

One thing that seems to indicate this is the marking and colouring of the flex LCD connector at the bottom of the screen. Here is one of mine I just loaded a Hello World on to:

MobileLCDHelloWorld

You can see here it says B6, and has a brown flex connector. I think i've seen both other codes and a green flex connector.

What does yours look like?

27 Nov 2009

Hi Simon,

Mine looks the same but has "X3" marked on the connector.

Regards

Phil.

27 Nov 2009

Ok, so that indicates at least that they are different. The SparkFun page suggests there are two drivers; Epson S1D15G10 or Philips PCF8833, and suggests there are even more clones.

So this seems like another excuse for a lineup! We should be able to enumerate all the different LCDs, then determine through some forms of testing what drivers each one supports. I'm not even sure what this one is using. I just hacked together this code one night out of interest, and it just happens to have got used a lot. It needs a total rewrite, so this is a good excuse to get it working on any variants of the Nokia LCD we can find.

Please can anyone with a Nokia LCD take a picture and post it here (even if yours looks the same as another), ideally showing at minimum the connector colour and markings and any other distinctive features (what breakout it is mounted on, where you got it). Hopefully then we'll be able to determine all the different variants, but also, that the ones that look the same are the same! We have some more around here so I'll hunt around later today.

Phil, you could also perhaps look at the Epson and Philips data sheets, and have a play with commanding it as each of them to see if you get any response.

Simon

27 Nov 2009

Hi Phil,

I knew that my device was using the EPSON drivers because when using the default library, I was getting some display but it was garbled and corrupted.

If you are getting nothing at all, it is most likely 1 of 3 problems. the way i went about fixing it was simply

1) try the standard library and only try to print hello world

 

#include 'mbed.h'

#include 'MobileLCD.h'

MobileLCD lcd(p5,p6,p7,p8,p9)

int main()

{

lcd.printf("Hello World!");

}

2) check the pin assignment to make sure they are correct

3) check the power to the screen logic is 3.3v, can take from mbed

4) check if you get anything at all. if so, then you know it is an epson controller and you can try the other libraries until you get a good result (http://mbed.org/projects/cookbook/svn/MobileLCD/tests/MobileLCD) worked for me

5) if not, it is either a connection problem of you have a phillips controller

if u have a phillips controller, you can get it to display by  cropping some of the code from here (Interface tutorial) to at least get it to display. just cut the LCDInt philips function from here into the MobileLCD library and replace the reset function, ignore all the spi comments and change the WriteSpiData to data() and WriteSpiCommand to command(); crude solution but mite get you started

The code i posted was because the unmodified library produced a line across the bottom of my display which the code fixed.

Hope this helps. Id recommend checking the connections because if there is even slight voltage noise on startup, there will be no output.

p.s. Thanks to Simon for all his work on this.

Adam

27 Nov 2009

Adam,

Thanks for your suggestions.

I have already check the physical connections and supply voltage.

It's worth me trying an extra decoupling capacitor for the logic supply on the LCD interface board.

No, I don't get any change on the display when I run either library.

Will take a photo of unit tonight and post on the forum.

Regards

Phil.

27 Nov 2009 . Edited: 27 Nov 2009

Hi Adam,

You were correct the controller seems to be the Philips.

I am slowly converting the functions to access the LCD.

Haven't sorted out the text and  the colours mode needs addressing.

My display is shown below, as you can see it is marked "X3".

Regards

Phil

 

08 Dec 2009

I just received the current SparkFun Nokia 6100 LCD in the mail.  Red PCB, 12 pin header at the end, includes two switches and an RGB LED for the user's purposes.  It did not work with the "first" LCD library in the LCD cookbook, but it does work with the second, although there do appear to be a couple rows that aren't addressed.  This LCD came with a sticker that said "GE" (no number).  The flex connector is green and there is no code on it, just the sticker on the LCD itself.

--steve

11 Dec 2009

I just started playing with the Nokia 6610 Olimex Rev. B 2009 board. (From www.coolcomponents.co.uk)

It seems to work with the Epson drivers, bar the fact that the backlight did not initially come on
(and with my light conditions it took me quite a while to notice it is actually working!)

Being the first time I played with a LCD I did not connect the backlight connector as I used the diagram in the cookbook (where it's missing relative to this board in any case)  Here is the naming conventions and connections I used for this board.

 

13 Dec 2009

On the topic of displaying bitmaps

I don't know if anybody else tried the Cookbook code?  It uses bitblit function that is a protected class :-(  and therefore does not compile.

( I'm using the Epson lib http://mbed.co.uk/projects/cookbook/svn/MobileLCD/tests/MobileLCD)

I don't know the reasons as to why it's not public, but is there an easy fix it would be appreciated!

13 Dec 2009

You will need to convert the protected functions to public functions.

Do this by importing the http://mbed.co.uk/projects/cookbook/svn/MobileLCD/tests/MobileLCD as files and you will get the MobileLCD.h and .cpp

remove the library and use these files in your main.cpp.

in the .h, cut the function definition from blitblit into the public section of code. you may have to do this for a couple of functions I think as the bitmap display is not really designed to go with this driver!

I am currently writing a more comprehensive driver with lines and rotation etc so I may publish that some time in the future.

Let me know how it goes.

Adam

13 Dec 2009

This should work but it will be slow!


int main() {
 BitmapFile MyBitmap("/local/zm.bmp");

    for (int x = 0; x < (MyBitmap.getWidth()); x++)   {
        for (int y =MyBitmap.getHeight(); y > 0; y--) {
            lcd.pixel(x,y , MyBitmap.getPixel(x,y,false));
        }
    }
}

14 Dec 2009

Thanks for the quick reply Adam!

It was a bit late last night, but I quickly tried the second option. It drew white boxes that represented the correct shape of the bmp file. (Tried different shaped ones).  I'll try a bit later in the week to see if I can find out more about the lack of picking up the colour as well as your other suggestion. Will keep you posted.

23 Feb 2010

could you please help me

for bitmapfile i have this message

"Identifier "BitmapFile" is undefined (E20)" in file "/LCD/main.cpp

thank

27 Nov 2010

I have the same problem as Arnaud Thery mentioned above.
Could anyone help?
for bitmapfile I have this message
"Identifier "BitmapFile" is undefined (E20)" in file "/LCD/main.cpp

Any other solutions to display a custom bmp onto the sparkfun nokia 6100 display is welcome too.

Thanks in advance.