Go Down

Topic: TROUBLES WITH T6963C's LIBRARIES (Read 283 times) previous topic - next topic

Breixo

Hi to all,

I'm a complete newbie in the Arduino world. I'm trying to migrate from PICs to Arduino and my first attempt is to run a MEGA2650 with a GLCD EA DIP240B (T6963C). After several weeks of learning and multiple "trial and error" I have managed to, at least, display a bitmap of 240x128 bits.

The only library that, so far, has worked is the U8glib, however, I have seen that it is obsolete and that the U8g2 should be used. Unfortunately, in U8g2, the T6963C is not contemplated as in U8glib.

U8glib: U8GLIB_T6963_240X128 u8g (2,   3,   4,   5,    6,   7,   8,    9, 13,  10, 11,12, 14); // THAT'S OK
//                        8Bit With: D0..D7: D0, D1, D2, D3, D4, D5, D6, D7,  cs, c/d, wr, rd, reset

U8g2 : U8G2_T6963_240X128_1_8080 u8g2 (U8G2_R0, 2,   3,   4,   5,   6,   7,    8,   9,  13, 10, 11, ??14);
// 8Bit With: D0..D7:                                                  D0, D1, D2, D3, D4, D5, D6, D7,  cs, c/d, wr, rd, reset Connect RD with +5V, FS0 and FS1 with GND // NO GOOD!!.

Unless someone corrects me, I think U8glib is my only option.

Arrived here, I have a few doubts that I will try to describe briefly:

a) Is U8glib the best T6963C library possible?
b) I can't find a converter of monochrome bitmaps to files manipulated by Arduino (except in XBM format that I think is not very compact ...)
c) I don't know how to do a #include for bitmap files.
d) I can't find a font converter/creator to be able to make an icon font.
e) I don't have found any function and/or parameter to invert bitmaps and text.

Excuse me for so many questions but I'm finding it very tiring to move from the simple PICbasic to, for me, spicy c ++.

Thank you very much for your time and your attention,

olikraus

Hi Breixo

Welcome to the Arduino Forum

Quote
a) Is U8glib the best T6963C library possible?
You should use better use u8g2. Unfortunately the sequence of arguments has changed from:
U8GLIB_T6963_240X128 u8g(d0, d1, d2, d3, d4, d5, d6, d7, cs, dc, wr, rd, reset);
to
U8G2_T6963_240X128_1_8080 u8g2(U8G2_R0, d0, d1, d2, d3, d4, d5, d6, d7, wr, cs, dc, reset);
Additionally, you must connect rd to +5V


Quote
b) I can't find a converter of monochrome bitmaps to files manipulated by Arduino (except in XBM format that I think is not very compact ...)
U8g2 does not support any other bitmap format than XBM. You can use "gimp" to convert to XBM

Quote
c) I don't know how to do a #include for bitmap files.
You just copy the content of the XBM file into the .ino file. XBM is a plain ASCII format and can be read/modified/copied with any editor.

Quote
d) I can't find a font converter/creator to be able to make an icon font.
You can use "fony.exe". Export your font to .bdf format. Then you bdfconv to create a u8g2 font. See the U8g2 FAQ for details, ask here in the forum or create an issue in the U8g2 issue tracker.

Quote
e) I don't have found any function and/or parameter to invert bitmaps and text.
U8g2 offers several features for this, see for example:
https://github.com/olikraus/u8g2/wiki/u8g2reference#setdrawcolor

Oliver


Breixo

Hi, Oliver,

Thank you very much for your support. I will try your U8g2 lib because my application uses invert birmaps to show states.

Regards,

Breixo

Hi, Oliver

I have tried to go from U8glib to U8g2 in a very simple program to display a logo but I have not succeeded.

Following your instructions I converted the BMP to XBM, the following header comes out:

#define APCXL12_width 240
#define APCXL12_height 128
static unsigned char APCXL12_bits [] = {

I have changed

u8g.drawXBMP (0, 0, 240, 128, APCXL12_bits); by u8g2.drawXBMP (0, 0, 240, 128, APCXL12_bits);

and it gives me a compilation error that I can not understand:

D: \ ARDUINO-IDE \ 1-TESTING \ B-MEGA + DIP240B + U8g2 \ MEGA_DIP240B_U8g2 / APCXL12.XBM: 3: 36: error: expected initializer before 'U8G_PROGMEM'

  const unsigned char APCXL12_bits [] U8G_PROGMEM = {

Any suggestion?

Thanks and regards

olikraus

#4
Sep 07, 2017, 02:07 pm Last Edit: Sep 07, 2017, 02:09 pm by olikraus
D: \ ARDUINO-IDE \ 1-TESTING \ B-MEGA + DIP240B + U8g2 \ MEGA_DIP240B_U8g2 / APCXL12.XBM: 3: 36: error: expected initializer before 'U8G_PROGMEM'

  const unsigned char APCXL12_bits [] U8G_PROGMEM = {

Any suggestion?

I have renamed this to U8X8_PROGMEM.

Oliver

Breixo

Hi, Oliver,

In fact, with your last help I've compiled good but, now, with U8g2lib nothing is displayed.  I've encountered several strange problems. Look:

- Tests on the same circuit, even with RD always connected to + 5V.

- Very simple program with the only variations:

#include "U8glib.h" <> #include "U8g2lib.h"
U8GLIB_T6963_240X128 u8g <> U8G2_T6963_240X128_1_8080 u8g2
u8g.drawXBMP <> u8g2.drawXBMP
u8g.firstPage <> u8g2.firstPage
u8g.nextPage <> u8g2.nextPage

PROBLEMS:

a) Frequency has increased noticeably but that should not be a problem.

b) The timing is completely different. While, I believe, with U8glib appears a GLCD initiation cycle, with U8g2, no.

c) Here is the most serious, while with U8glib, the signals oscillate between + 5V and GND, with U8g2, the signals oscillate between + 5V and FLOAT.

Attached timing and oscilloscope displays for each library.

I await your always instructive advice, thanks a lot,

olikraus

Quote
Tests on the same circuit, even with RD always connected to + 5V.
The constructor arguments are also different:

https://github.com/olikraus/u8g2/blob/master/doc/faq.txt#L91

Oliver

Breixo

Wow, Oliver, you're a night owl like me ;)

Yes, the constructors are in order, too:

U8GLIB_T6963_240X128 u8g(2,  3,  4,  5,  6,  7,  8,  9, 13, 10, 11, 12,  14);

and

U8G2_T6963_240X128_1_8080 u8g2(U8G2_R0,    2,  3,  4,  5,  6,  7,  8,  9, 11, 13, 10, 14);  //Olikraus, RD to +5

It's really strange that a library causes a hardware problem like the present but I have reviewed everything that I could humanly.

Thanks and regards,

olikraus

#8
Sep 10, 2017, 05:54 am Last Edit: Sep 10, 2017, 05:54 am by olikraus
Wow, Oliver, you're a night owl like me ;)
Sometimes I just can not stop thinking about electronic problems ;-)


Yes, your constructor modification looks correct.
So you say, the change from
U8GLIB_T6963_240X128 u8g(2,  3,  4,  5,  6,  7,  8,  9, 13, 10, 11, 12,  14);
to
U8G2_T6963_240X128_1_8080 u8g2(U8G2_R0,    2,  3,  4,  5,  6,  7,  8,  9, 11, 13, 10, 14);  //Olikraus, RD to +5
does not work?

How did you connect RD to +5V? Did you do a "pinMode(12, OUTPUT); digitalWrite(12, 1);"?
Does your old setup still work?

Oliver


Breixo

Hi,Oliver,

In fact, library U8glib works very well but U8g2 shows the electrical problems that I've reported.

RD is connected physically  to +5 power supply, pin 12 appears as FLOAT, that's ok. Even U8glib works ok.

Now I've unconnected RD from the +5V and I've connected RD to pin 12 and I've introduced the two sentences pinMode(12, OUTPUT); digitalWrite(12, 1); and now RD follows pin 12 but the electrical problem persists and nothing is displayed.

It's very strange that a library affects the electrical performance up to this point. Nevertheless, see in my picture that with U8g2 there's not a GLCD init cycle.

Tell me if you wishes any other test.


olikraus

I do not know what else I can suggest. The two changes for moving from u8g to u8g2 is to
1) change the order of constructor argumenst
2) attach RD to 5v (somehow)

Following this, it did work for my own setup.

Maybe you can switch back to your previous setup, just to ensure, that there are no other bugs.

Oliver

Breixo

Ok. I will continue with U8glib to a level sufficient to ensure that both hardware and software work well.

It will take a week or two.

Thanks, Oliver

Go Up