TROUBLES WITH T6963C's LIBRARIES

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,

Hi Breixo

Welcome to the Arduino Forum

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

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

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.

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.

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:

Oliver

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,

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

Breixo:
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

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,

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

The constructor arguments are also different:

Oliver

Wow, Oliver, you're a night owl like me :wink:

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,

Breixo:
Wow, Oliver, you're a night owl like me :wink:

Sometimes I just can not stop thinking about electronic problems :wink:

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

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.

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

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

Hi, Oliver,

I have returned to U8g2 and I have some problems:

a) My design requires the T6963C to be configured with FS1 = 1, ie characters of 6x8 and more specifically 40 columns and 16 rows. How can I do it?

b) I need a 6x8 font and a 12x16 font (numbers only). Exist?

c) I would need to create a font of symbols What program should I use?

Thanks and best regards,

The simple answer is: U8g2 will not work with FS1=1.
Both FS lines must be assigned to GND for U8g2 (and u8glib).

Oliver

Plongg!!!. To begin again ...

Just to be clear.
Your T6963 display has two fundamental modes. There is a character mode and a graphics mode. The graphics mode allways requires that the FS pins are connected to zero. For the character mode you can choose between 6x8 and 8x8 fonts via these FS pins.

However: If you are in graphcs mode you can choose to use ANY font you like. Your are not restricted at all and of course you can use a 6x8 font for your purpose. I have some u8g2 fonts here, which might match for you (do not get confused by the names):

6x8:

12x16:

There are probably more fonts, which might fit, bit I am sure you can finde something suitable.

So, as a conclusion, If you have that restriction regarding the FS pin, then please note that there is no restriction at all when using graphics mode with u8g2.

Oliver

Hi Oliver.

Some things:

  • Most fonts on the three 6x8 links produce the error: "'u8g2_ptofont10_mf' was not declared in this scope".
  • The font u8g2_font_6x10 meets my expectations but it is only numeric.
  • For size 6x12, the font u8g2_9x15B_tf meets my expectations but I need to make some changes.
  • For a smart thermostat project I need an 8x8 icon font.

So, I think the only solution I have is to create my own sources (so I do in my project with PICbasic). So, please;

a) What tools exist to create fonts for U8g2? (I can start from TTF fonts created by me)

b) Once the fonts have been created, are they added to the file u8g2_fonts.c? or is there any other operation to be done?

c) Which one or what are the procedures to put the T6963C in graphic mode?

Thans for your patience,

Breixo:

  • Most fonts on the three 6x8 links produce the error: "'u8g2_ptofont10_mf' was not declared in this scope".

It seems to be a spelling error. it is called profont.

Breixo:

  • The font u8g2_font_6x10 meets my expectations but it is only numeric.

Please have a look at the font pages, there are a lot of variants of that font.

Breixo:
a) What tools exist to create fonts for U8g2? (I can start from TTF fonts created by me)

I use fony.exe (1.4.6 version i think). Basically all tools which can export to .bdf file format can be used.

Breixo:
b) Once the fonts have been created, are they added to the file u8g2_fonts.c? or is there any other operation to be done?

A font is just a special string. The tool bdfconv.exe from u8g2 project generates the c-code (the string). You can just copy the string into your .ino file. No need to modify u8g2_fonts.c.

Breixo:
c) Which one or what are the procedures to put the T6963C in graphic mode?

This is done by u8g2 as soon as you call the .bgin() member function.

Oliver

Hi Oliver,

I've two beautifuls "My6x8.bdf" and "My12x16.bdf" throu Fony. They are checked with chortkeh-bdf-font-viewer and converted to U8g2 format with bdfconv.exe:

Following your instructions I used these command lines:

"bdfconv -f 1 -m "32-181" -n My6x8 -o My6x8.c My6x8.bdf"
"bdfconv -f 1 -m "42-62" -n My12x16 -o My12x16.c My6x8.bdf"

and I've obtained the My6x8.c and My12x16.c. Sorry, i'm not English-speaker and I've some difficulties...

  • What is the "fontname" file for? I just got the ".c" files.

  • My program is on the way to being gigantic, is it possible to treat the obtained ".c" font files as "#includes"?

Thanks a lot,

"-n" denotes the name, which should be used in the setFont command.
You can also rename the .c file to .h
You could also copy the content of the .c file directly into your .ino file.

Oliver