I have an 128x64 lcd, but I don't know the model, what it says on the back: 12864B V2.0 2008100528
is it supported by u8g2? can I use an i2c?
Could you post clear photos of it, front and back? I use the 128x64 mono graphics LCD so may be able to help you.
What Arduino board?
If possible mega 2560, for the photos, gimme some mins
Thst looks like the display that I have. Give me a little time and i will post example code and wiring.
Here is an example for the 128x64 monochrome graphics display with the ST7920 or ST7921 controller and using hardware SPI. This has been tested on real hardware and is known to work.
Note: I made an adapter so that the connection is on the side instead of along the bottom for convenience. The wiring is as shown in the schematic below.
Code:
#include <Arduino.h>
#include <U8g2lib.h>
#include <SPI.h>
U8G2_ST7920_128X64_F_HW_SPI u8g2(U8G2_R0, /* CS=*/ 10, /* reset=*/ 9);
void setup()
{
u8g2.begin();
}
void loop(void)
{
static unsigned long timer = 0;
unsigned long interval = 1000;
if (millis() - timer > interval)
{
timer = millis();
u8g2.clearBuffer(); // clear the internal memory
u8g2.setFont(u8g2_font_ncenB08_tr); // choose a suitable font
u8g2.drawStr(0, 10, "Hello World!"); // write something to the internal memory
u8g2.setCursor(0,32);
u8g2.print(millis());
u8g2.sendBuffer(); // transfer internal memory to the display
}
}
Schematic:
What driver does it use?
What does that mean?
The display has a ST7921 (ST7920) controller and the interface is hardware SPI. I don't know what you mean by "driver".
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
Failed uploading: uploading error: exit status 1
That looks like a communication problem between the Mega and your PC. Post the whole error message.
If the above is preceded by the below text then compilation was successful and the problem is with upload.
Sketch uses 9390 bytes (3%) of program storage space. Maximum is 253952 bytes.
Global variables use 1430 bytes (17%) of dynamic memory, leaving 6762 bytes for local variables. Maximum is 8192 bytes.
Do see the above before the
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
Are you using the Arduino IDE? If so, which version?
I got the first text, the second idk
Arduino ide 2.0.2
El Sketch usa 9390 bytes (3%) del espacio de almacenamiento de programa. El máximo es 253952 bytes.
Las variables Globales usan 1430 bytes (17%) de la memoria dinámica, dejando 6762 bytes para las variables locales. El máximo es 8192 bytes.
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
Failed uploading: uploading error: exit status 1
That indicates a successful compilation with no errors. You have a communication problem.
I do not use the 2.0 IDE so can be of no help if the issue is related to the IDE.
You need to troubleshoot the communication problem.
Start here >> https://docs.arduino.cc/learn/starting-guide/troubleshooting-sketches
and here >> https://support.arduino.cc/hc/en-us/articles/4403365313810-Errors-when-uploading-a-sketch
I think it's because of an usb hub, I think it has an unstable connection
exit status 1
Compilation error: exit status 1
tried again, same avrdude error
That gives me absolutely nothing to work with. Is that the entire error message?
Yes
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.