-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GU128x64-800B Support #1604
Comments
Nice display, but seems to be very expensive. Indeed there is no support for such device in u8g2 (I came across such a VFD device before but it is too expensive for a open source project like u8g2), but I you are willing to do some testing we can try to implement support for your display. After review of the datasheet: We need to implement this as a 64x128 device. The memory structure seems to imply this. This means, that we need to drive the display with U8G2_R1 (https://github.com/olikraus/u8g2/wiki/u8g2reference#setdisplayrotation) to get landscape mode. I will go ahead with the implementation... Edit: I am confused with the GU800 RAM structure, Not sure whether landscape will be U8G2_R0 or U8G2_R1.. we need to test this. |
Technical question: The GU128x64 seems to consume 700mA. This is more than the Arduino can provide, right? So an external power supply is require, correct? |
|
I have created alle the constructors, for example:
|
I have created beta release 2.32.3. You can download the latest U8g2 beta release from here: https://github.com/olikraus/U8g2_Arduino/archive/master.zip
|
Yes, that is correct. I use a large 5V powerbank for my testing.
I'll give this a go now and report back. Thank you. |
I've tested both the full buffer and page buffer u8g2 logo examples, and get nothing on the screen. I tested my code using the library I mentioned in the original post, and confirm it still works. |
Which constructor did you use? Did you apply the correct pin values? Maybe you can share your test code. |
I'm using this constructor. U8G2_GU800_128X64_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); Here is my code repo that I have driven the display with successfully. It uses the exact same pins for CS, DC, and Reset. |
Are you able to see any kind of activity on CS or DC line? The reset should be driven high by u8g2. |
There is no screen activity. I will connect my logic analyzer and see what it shows. |
logic analyzer, nice. If you see activity, we probably need to check the init sequence for the display. It is here: Lines 143 to 172 in 438906e
|
Hmm.. but should the reset signal be high? I mean it is low in both cases, but according to the datasheet, the reset signal must be high. |
for quick reference here are the size_t GU800::writeSPI(uint8_t data, bool isCommand) {
*csport &= ~cspinmask; // Assert /CS
if (isCommand) {
*dcport |= dcpinmask; // Write command: DC high
} else {
*dcport &= ~dcpinmask; // Write data: DC low
}
delayMicroseconds(1); // Minimum 40nS between asserting /CS and starting transaction
SPI.beginTransaction(this->spi);
SPI.transfer(data);
SPI.endTransaction();
delayMicroseconds(2); // Minimum 1.5uS between last clock and deasserting /CS
*csport |= cspinmask;
delayMicroseconds(1); // Minimum 80nS between deasserting /CS and next transaction
return 1;
}
size_t GU800::writeSPI(uint8_t * buf, size_t count, bool isCommand) {
// GU800 requires that we deassert and reassert /CS after every byte, so no
// gain in doing batch transfers :(
for (int i = 0; i < count; i++) {
this->writeSPI(buf[i], isCommand);
}
return count;
} |
It might look like some signals are swapped. However there is still a sampling issue: |
U8g2 is configured for spi mode 0 (https://www.arduino.cc/en/reference/SPI) |
I am not sure which SPI frequency is used by the Adafruit lib, however maybe the 4MHz suggested by your code is too high. |
I tried 1MHz and got no display from u8g2 again. Let me capture the initial bytes again on 12.5MHz |
The pin assinment seems to be correct. In fact DC and select (ccs) seem to be ok (u8g2 does not unselect between each byte, but this should be ok).
Please review the code from above: I first sent 0x5f, then wait for 1ms (as described in the datasheet) and then send the 0x62. It should be the same as for your code. Let's try different SPI modes. Please locate the following line 187 in your local u8g2 code (file u8x8_d_gu800.c): Lines 186 to 187 in 61feaec
There are four modes, from 0 to 3 Maybe also reduce SPI clock to 1000000 in line 186 |
The screen is somewhat dim, I'm not sure the brightness is being set to max. I'll see if I can figure it out. |
wow, very nice. case U8X8_MSG_CAD_SEND_DATA:
u8x8_byte_SetDC(u8x8, 0);
data = (uint8_t *)arg_ptr;
while( arg_int > 0 )
{
u8x8_byte_StartTransfer(u8x8);
u8x8_byte_SendByte(u8x8, *data);
u8x8_byte_EndTransfer(u8x8);
data++;
arg_int--;
}
break; Will this also work? It would be a great performance improvement... case U8X8_MSG_CAD_SEND_DATA:
u8x8_byte_SetDC(u8x8, 0);
data = (uint8_t *)arg_ptr;
u8x8_byte_StartTransfer(u8x8);
while( arg_int > 0 )
{
u8x8_byte_SendByte(u8x8, *data);
data++;
arg_int--;
}
u8x8_byte_EndTransfer(u8x8);
break; |
Unfortunately that does not work. :( Is there a good test I could run to evaluate performance? |
You can use the set contrast command of u8g2, however remember to use the value 255 for max brightness. You display has brightness levels from 0 to 15, however u8g2 uses 0..255: The value in u8g2 will be divided by 16 to get the GU800 value. |
too bad
There is the FPS.ino example, which also includes some reference values of other displays. |
My device is an Arduino Mega 2560
Full buffer results:
|
well... better than expected :-) |
I have created a new cad_110 procedure. Also reverted some of the recent changes. |
Created beta 2.32.6 You can download the latest U8g2 beta release from here: https://github.com/olikraus/U8g2_Arduino/archive/master.zip
|
Did you solve the "dim" brightness issue? |
Thanks for testing and working with me on this topic. I am happy to have VFD support inside u8g2 :-) |
I'll be looking in to that soon. I'll give the 2.32.6 beta a test now. |
2.32.6 results in all pixels being On. I cannot make out whether there is anything actually happening on the screen. |
Ah, simple fix. the SPI mode must be 2, not 0. Line 192 in c25cd63
After changing this to 2, all is well again. |
I just PR'd the SPI mode fix and some other cleanups. A bunch of unnecessary start/end transfers were still there. I have confirmed that the display works fine with these changes. All that is left is brightness control. |
puh, guess it was too late for me to remember all the changes :-) |
ok, i assme this can be closed... |
@olikraus (FYI: On esp32s3 I'm using |
Hmm.. there had been similar issues in history, where the SPI modes had not been compatible. See for example here: #53 My bug report to ESP8266: esp8266/Arduino#2416 |
@olikraus sorry for late response, I missed the notifacation |
If mode 3 works with Arduino Uno, then mode 3 is correct and ESP is wrong because I assume, that Arduino Framework is the reference.
It would be better to address this to ESP framework... |
@olikraus
(this line:) Line 183 in 4b17158
Also I found #1970, I think this is similar to that. |
Ok, fine, then I would accept the PR |
Hello, there is an existing Adafruit_GFX based implementation to drive this display, but I would like to use u8g2.
I began digging through u8g2 to see if I could port it myself but unfortunately quickly got lost.
Some support on porting this display would be greatly appreciated.
Here is the datasheet.
The text was updated successfully, but these errors were encountered: