U8glib: Graphics Lib for LCDs and OLEDs

to my understanding your pic seems to be correct (according page 20 of the st7687 datasheet).
I will create also a 8bit interface,

Oliver

:slight_smile: thanks man i replyed to your email address

Thanx for the great lib! it works great with my DFRobot ST7920 128X64 display.

I've got one question. I use software SPI on pins 9 and 8, but it looks like that it interferes with my hardware SPI which I want to use to communicate with a DS3234 RTC.

Good to know, that the DFRobot display is fine with the lib. Thanks for the feedback.

Regarding the RTC: What is the problem: Display does not work, RTC does not work, both do not work?
Maybe you can post the setup code for your display and your RTC: What are the involved pin numbers for both devices?

Oliver

Can't both use the hardware spi if you use separate pins for the slave selects?

I must have been verry sleepy yesterday evening because it works now!

But for the others how to connect the DFRobot to the ARduino:

This is my innitialization string:

U8GLIB_ST7920_128X64 u8g(9, 8, 3, U8G_PIN_NONE); // SPI Com: SCK = en = 9, MOSI = rw = 8, CS = di = 3

And this is how I connected it:
Arduino pin = function = DFRobot pin
Pin 9 = SCK = e
Pin 8 = MOSI = rw
Pin 3 = CS = rs

Thanks for the information.

Oliver

Release v1.02 is available vor download.

  • Support for LC7981 controller
  • drawCircle, drawDisc
  • Ported "little rook chess", a full playable chess engine with graphical user interface

Oliver

hi and good day..

thx for the wonderful library, works great on my DS-LCD-TG12864E (ST7920 controller) in spi mode. (R/W = MOSI, E= CLK , PSB =LOW, RS=HIGH)
speed is quite ok in spi, gotta try the parallel mode soon. the liquid crystal itself may be limiter.

Hmm..is possible can u make point to point drawline (x1,y1,x2,y2) available? :smiley:

thx again :slight_smile:

Hi

Thanks for the feedback.
I will add a drawLine procedure with the next release.

Oliver

Thx for the feedback, looking forward for it :slight_smile:

in progress in porting the GLCD lib into u8glib now. :3

it is any procedure is equivalence to GLCD.ClearScreen for u8glib?

now using drawBox procedures for clearing screen :stuck_out_tongue:

Hi NeOCzx

There are some imporant differences between GLCD v3 and U8glib. While porting is for sure possible, there are some restrictions on U8glib, which are not present for GLCD lib. GLCD and U8glib have two completly different programming concepts. It might require much more than just replacing the drawing primitives.

I suggest reading the article here, before porting:
http://code.google.com/p/u8glib/wiki/tpictureloop

Also, Bill's library is highly optimized and much faster than U8glib. On the other hand, U8glib should be more flexible regarding the graphics hardware.

One result of the different concepts is that there is no clear screen available in U8glib. The screen is cleared as soon as you enter the "picture loop".

Oliver

thx for the claraficatiion & tips olikraus :smiley:

if it doesnt work out well maybe i will as well try to use 2 LCD display with different library on a same arduino board. it is possible to be done or someone here had done it before?

just curious :slight_smile:

It should be possible to use more than one display, but i never tried.
Oliver

Hi

Release v1.03 is available for download. It includes the requested drawLine procedure.
http://code.google.com/p/u8glib/downloads/list

Oliver

Hi Oliver,

is there some pitfall in get your lib running on an Arduino Mega 2560 with an EA DOGXL-160 ? :wink:

if tried it yesterday and it did not work. i looked at the signals of the pins (with an oscilloscope) and the clock pin was a little bit confusing.
in Hardware SPI Mode the signal was realy destroyed.
in Software SPI Mode the u8g.setContrast(127); worked. but the 'hello World' not.
It looked like something is setting the clock pin manually some times..
the signal of the clock was at ~3.3V level out of the arduino and the odd spikes were at 5V level...
i used the Hardware SPI Pins on the Arduino Mega - see constructor..

i used the example hello world sketch and added the contrast command in setup.
my constructors that i tried were the following:

//U8GLIB_DOGXL160_2X_BW u8g(52, 51, 53, 49);            // Software SPI ARDUINO MEGA   SPI Com: SCK = 52, MOSI = 51, CS = SS = 53, A0 = 49 //there is something wrong...
U8GLIB_DOGXL160_2X_BW u8g(53, 49);            // Hardware SPI ARDUINO MEGA   SPI Com: SCK = 52, MOSI = 51, CS = SS = 53, A0 = 49 // here is something wrong too

have you got an idea?

know i will try it with an arduino Duemilanove. we will see :slight_smile:

sunny greetings

Stefan

Hi

I recently added the 2X driver. Can you please check the single buffer constructor (without 2X).
I also do not own a Mega Board, so i have to rely on whatever the Arduino.h file has defined for the Hardware Pins.
If these hardware pins require some special settings, than these settings are not known to me.

But in any case, the SW SPI should work.

Your observation might also be caused by the connected hardware. How do you do the level transition?
Is it a HC4050 level translator for the signals? Resistor networks might work, but you might observe
other voltage ranges.

Oliver

I checked v1.03 with my DOGXL160 display. HW SPI and SW SPI are fine. I do not see any issues here.

Oliver

Hi

I have been using the u8g Library to complete a university project. I have been playing around with it and must say that it is fantastic. The one problem I am having is that I want to display a line of ASCII print for a certain period of time, clear the entree screen and then write another set of ASCII text. I am using an ST7920 screen as it was the only one locally available as all shops have sold out of the KS0108. The screen i attached to a DFRobot mega clone...

Please if anyone can help me I have tried so many ways to get this to work but with no success

thanks in advance

Chris

Hi Chris

I am not sure what you mean by "ASCII print". A chart of ASCII glyphs can be produced in this way:

void u8g_ascii_1() {
  char s[2] = " ";
  uint8_t x, y;
  u8g.drawStr( 0, 0, "ASCII page 1");
  for( y = 0; y < 6; y++ ) {
    for( x = 0; x < 16; x++ ) {
      s[0] = y*16 + x + 32;
      u8g.drawStr(x*7, y*10+10, s);
    }
  }
}

As shown in the second tutorial (Google Code Archive - Long-term storage for Google Code Project Hosting.) there is no clear screen command. Instead, as soon as you enter the picture loop, the screen gets cleared.
See also the background article here: Google Code Archive - Long-term storage for Google Code Project Hosting.

In order to display a screen, wait some time and than display another screen, you may use the code and ideas from "GraphicsText.pde" (attached to this post, but also part of the Arduino examples).

Oliver

GraphicsTest.pde (6.38 KB)