Go Down

Topic: U8g2: Graphics Library for Monochrome OLEDs and LCDs (Read 16390 times) previous topic - next topic

olikraus

Finally, I finished U8glib V2, now called U8g2.

What is u8g2?
- Graphics library for many different monochrome OLEDs and LCDs
- Supported display controller: SSD1305, SSD1306, SSD1309, SSD1322, SSD1325, SSD1327, SSD1606, SH1106, T6963, RA8835, LC7981, PCD8544, PCF8812, UC1604, UC1608, UC1610, UC1611, UC1701, ST7565, ST7567, NT7534, IST3020, ST7920, LD7032, KS0108
- Powerful text and graphics commands
- More than 700 fonts available

Installation
- ... via Arduino IDE library manager (search for "u8g2").

What are the most important advantages compared to U8glib V1?
- Full "RAM" memory buffer without picture loop (u8glib picture loop still supported).
- Arduino SPI and TWI Libraries instead of custom code. This will make u8g2 much more portable.
- Successfully tested with AVR, SAM and ESP8266 boards.
- Support for Unicode and UTF-8: Unicode chars appear on the display as written in the Arduino IDE.
- Faster compilation.
- High speed text only API (U8x8).
- Hardware 180 degree rotation for some displays available.
- Compressed font format.
- Button debounce event handler included.
- 90% compatible with U8glib.

Limitations
- Still support for some display controller is missing compared to U8glib V1 :-(

Links
- Gallery
- Dokumentation and Reference Manuals
- Porting from U8glib V1
- List of all fonts


Oliver

Edit: Updated list of supported controllers and font count.
Edit: Updated list of supported controllers (v2.9.1)
Edit: Updated list of supported controllers (v2.12.6)

bperrybap

#1
Jun 29, 2016, 11:01 pm Last Edit: Jun 29, 2016, 11:05 pm by bperrybap
Oliver,
This sounds very interesting.
I wanted to take a look at it but the links are not working for me.

Your olikraus repository does not seem to be showing up on github.

Also, it would be nice to have a link to the actual repository to know where to find it for those needing to ad it manually vs using the lib manager.

BTW, while I see it shows up in the library manager, the library manager can't find it either.

update:
apparently the library manager can install it, but it can't find the repository if you click on the "More info" link which tries to go here: https://github.com/olikraus/u8g2
--- bill

olikraus

Hi Bill
The Arduino Repo is here: https://github.com/olikraus/U8g2_Arduino

And yes, somehow parts of my repo got disabled. I am in contact with the githup support, so I hope it get fixed within the next 12h.

The link to the library should be this:
https://github.com/olikraus/U8g2_Arduino/archive/2.0.7.zip

Oliver

Farzad321554

Dear Oliver

How can I add other languages to U8g2 lib? (for example  "u8g_font_unifont_12_13")
I tried to add "u8g_font_unifont_12_13" to "U8g2_fonts.c" file but I was not successful

Dalojan

I like to display large characters on an EA DOGM240S-6 display and suppose this is possible using the U8g2 lib but where can I find fonts that can be used. I planed to use an Arduino UNO the drive the display and control my audio preamplifier.

olikraus

Dear Oliver

How can I add other languages to U8g2 lib? (for example  "u8g_font_unifont_12_13")
I tried to add "u8g_font_unifont_12_13" to "U8g2_fonts.c" file but I was not successful

This should be done in the next release (which should be online in the next few hours)

Oliver

olikraus

I like to display large characters on an EA DOGM240S-6 display and suppose this is possible using the U8g2 lib but where can I find fonts that can be used. I planed to use an Arduino UNO the drive the display and control my audio preamplifier.
Currently the DOGM240 is not yet ported to U8g2. However you can probably use U8glib for this display.

U8glib also contains some very large fonts: https://github.com/olikraus/u8glib/wiki/fontsize

Oliver

olikraus

Version 2.1.5 of U8g2 is now available.

The new release includes support for the T6963 display and also includes some more fonts.

Oliver

liquid-light

Hej

I have some trouble with this library and my 128x64 (ST7920) display.
With the previous version (U8Glib) everything works fine. I'm able to steer my display via parallel connection and the following constructor :

Code: [Select]
U8GLIB_ST7920_128X64_1X u8g(22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32);   // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7 en=18, di/RS=17,rw=16

 But now I try to use the new U8g2 and basically nothing work. No signs on the screen.
I'm 100% sure that something is wrong with my code and not with the library, but I need some help.


There are some example constructors in the code examples but there seems to be no constructor for parallel mode for the ST7920 with 128x64. So I thought it should be quite easy to make a new one based on the example for the 192x32 ST7920.

So I wrote this :
Code: [Select]
U8G2_ST7920_128X64_2_8080 u8g2(U8G2_R0, 22, 23, 24, 25, 26, 27, 28, 29, /*enable=*/30, /*cs=*/U8X8_PIN_NONE, /*dc=*/32, /*reset=*/ U8X8_PIN_NONE);

This is just one version of several different I've tried. But nothing works.
It's also quite confusing what "RS" actually really is.
On this site it tells me that CS is RS :
https://github.com/olikraus/u8g2/wiki/setup_tutorial#select-a-physical-bus
Quote
According to the ST7920 datasheet, the PSB pin selects between the 8-Bit and the serial (SPI) bus. For the serial bus, pin "RS" is "Chip-Select", pin "E" will be the clock input and pin "RW" acts as data line.
On this site it tells me that RS is dc :
https://github.com/olikraus/u8g2/wiki/u8g2setupcpp#st7920-128x64
Quote
dc   Data/command selection line (register select)   D/C, A0, RS, ...
So how do I have to wire the display correct and build the constructor for my display.
As I said, with the older U8Glib everything works fine.

rainwulf

#9
Aug 11, 2016, 01:41 pm Last Edit: Aug 11, 2016, 01:48 pm by rainwulf
Thanks Oli!!! I love your library, its so easy to use and works so well with every small monocrhome OLED/LCD i have used.

I love not having to "Clear" the screen too! Means no flicker!


liquid-light

Hm, strange...
Because Parallel connection with u8g2 doenst seems to work with my ST7920 128x64 display I thought I'll "just" switch to SPI.
Now I found out that SPI also doesnt work. I get strange artifacts in the display and can barely see the text that should be written on the display.
Then I tried software SPI and that works fine, but horrible slow.

Then, again, I switched back to U8Glib and everything work awesome.

I've tested this with my Mega, Nano and Uno. So I dont think that the controller is the guilty one.

Any ideas?
I would still prefer to use the parallel mode ;)

supermac

The latest version is working on SIMBLEE hardware with software I2C on a SSD1306 128x64.
Thank you.

However the I2c speed seems to be slow.  what is the proper way to adjust the software I2C speed?

olikraus

Hm, strange...
Because Parallel connection with u8g2 doenst seems to work with my ST7920 128x64 display I thought I'll "just" switch to SPI.
Now I found out that SPI also doesnt work. I get strange artifacts in the display and can barely see the text that should be written on the display.
Then I tried software SPI and that works fine, but horrible slow.

Then, again, I switched back to U8Glib and everything work awesome.

I've tested this with my Mega, Nano and Uno. So I dont think that the controller is the guilty one.

Any ideas?
I would still prefer to use the parallel mode ;)
The latest version of U8g2 includes some modifications on HW SPI side, but i will also create an issue here and do some testing with the ST7920.

Oliver

olikraus

It's also quite confusing what "RS" actually really is.
On this site it tells me that CS is RS :
https://github.com/olikraus/u8g2/wiki/setup_tutorial#select-a-physical-bus
On this site it tells me that RS is dc :
https://github.com/olikraus/u8g2/wiki/u8g2setupcpp#st7920-128x64
So how do I have to wire the display correct and build the constructor for my display.
As I said, with the older U8Glib everything works fine.
ok... i will also look at this. Thanks for pointing out this difference.

Oliver

olikraus

The latest version is working on SIMBLEE hardware with software I2C on a SSD1306 128x64.
Thank you.

However the I2c speed seems to be slow.  what is the proper way to adjust the software I2C speed?
U8g2 just uses the Arduino Wire Lib as it is. To my knowledge there are no options to turn on fast mode or something similar.
For speedup you could also use the full frame mode (_F_ in the constructor) if there is enough RAM available.

Oliver

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy