gavinlyonsrepo / ERM19264_UC1609

Arduino Eco-system Library to Support the ERM19264 LCD driven by the UC1609C / UC1609 controller.
https://gavinlyonsrepo.github.io/
GNU General Public License v3.0
17 stars 6 forks source link

It doesn't work #3

Closed skartalov closed 1 year ago

skartalov commented 2 years ago

I have this display tried the examples with ARDUINO NANO, but it doesn't work. Display is 19264-05 V3.2 It just shows random dots when initialized. That's all. What could be the reason?

gavinlyonsrepo commented 2 years ago

Hi

It works here, library v1.4 , Arduino nano V3 , 5V setup, although My display boards have V3 on them not V3.2.

What version of library are you on the latest 1.4? What example file you use? What colour display ? Hardware or software SPI? What type of arduino NANO you use? Are you using 3.3V or 5V setup? What is your wiring setup?

Thanks

skartalov commented 2 years ago

Latest version 1.4 5V setup White on Black. Hardware SPI

define CD 10 // GPIO pin number pick any you want

define RST A4 // GPIO pin number pick any you want

define CS A5 // GPIO pin number pick any you want

ERM19264_UC1609 mylcd(CD, RST, CS); // instantiate object

Strange is, that sometimes in very rare occasion it starts and works! I think there must be something wrong with the timings.

I have tried 3 displays( the same), connected to two different ARDUINO NANO setups.

gavinlyonsrepo commented 2 years ago

Hi

Where did you buy the displays , From company "buydisplay"? Your boards have 19264-05 V3.2 on back correct? I wonder if there is difference LCD's between v3.2 and v3.

For 5V setup you have shorted Jumper J1 on back of LCD, correct ?

Regarding timings i had some issues at start of project:::->

They are 4 timing values used in initialisation of code in ERM19264_UC1609.h On version 1.0.0 i had these set to

// delays v1.0.0 
#define UC1609_RESET_DELAY 150 // mS delay
#define UC1609_RESET_DELAY2   1 // mS delay
#define UC1609_INIT_DELAY 100   //  mS delay
#define UC1609_INIT_DELAY2 3 // mS delay

Then for Version 1.1.0 I noticed that Delay reduced, as ERM19264SBS (white on blue)version of LCD on Software SPI would not initialise, intermittently. So I changed the reset delays to solve.

// Delays v1.4.0
#define UC1609_RESET_DELAY 3 // ms Delay
#define UC1609_RESET_DELAY2   0 // mS delay datasheet says 5mS, does not work
#define UC1609_INIT_DELAY 100   //  mS delay ,after init 
#define UC1609_INIT_DELAY2 3 // mS delay,  before reset called

You could try changing UC1609_RESET_DELAY to > 1 mS , UC1609 Datasheet says > 3uS UC1609_RESET_DELAY2 to 6 mS , UC1609 Datasheet says > 5mS

regards

skartalov commented 2 years ago

Just want to mention, that my setup works fine with U8G2 library! Although I prefer your LIB as its lightweight. Please check what could be wrong in the code.

gavinlyonsrepo commented 2 years ago

Can you do a test for me ? In file ERM19264_UC1609.h can you change

define UC1609_RESET_DELAY 3 //

define UC1609_RESET_DELAY2 0 //

to

define UC1609_RESET_DELAY 1 // ms

define UC1609_RESET_DELAY2 6 // mS

skartalov commented 2 years ago

image

Nothing changes. It always shows this dots.

skartalov commented 2 years ago

image

The same setup with u8g2 library. Hello world example with following: U8G2_UC1609_SLG19264_F_4W_HW_SPI u8g2(U8G2_R0, / cs=/ A5, / dc=/ 10, / reset=/ A4);

Works immediately. I suspect there must be something wrong with the initialization of the screen. See how they did it. This is their init sequence:

static const uint8_t u8x8_d_uc1609_19264_init_seq[] = {

U8X8_START_TRANSFER(), / enable chip, delay is part of the transfer start /

U8X8_CA(0x0f1, 63), / set COM end (display height-1) / U8X8_C(0x0c0), / SEG & COM normal / U8X8_C(0x040), / set scroll line to zero / U8X8_C(0x02e), / chare pump / U8X8_C(0x0eb), / set bias 1/2 /
U8X8_CA(0x081, 0x08f), / set contrast /

/ AC0: 0: stop at boundary, 1: increment by one AC1: 0: first column then page, 1: first page, then column increment AC2: 0: increment page adr, 1: decrement page adr. / U8X8_C(0x088), / set auto increment, low bits are AC2 AC1 AC0 / U8X8_C(0x0a1), / frame rate 95Hz /

/ LC0: 0 MX: Mirror X MY: Mirror Y /
U8X8_C(0x0c4), / low bits are MY, MX, LC0 /

U8X8_C(0x0a6), / set normal pixel mode (not inverse) / U8X8_C(0x0a4), / set normal pixel mode (not all on) /

U8X8_END_TRANSFER(), / disable chip / U8X8_END() / end of sequence / };

skartalov commented 2 years ago

Yes, I ran you HELLO WORLD example, here is the code:

include "ERM19264_UC1609.h"

// LCD setup defines

define LCDCONTRAST 0x49

define MYLCDHEIGHT 64

define MYLCDWIDTH 192

// GPIO 5-wire SPI interface

define CD 10 // GPIO pin number pick any you want 10

define RST A4 // GPIO pin number pick any you want A4

define CS A5 // GPIO pin number pick any you want A5

// GPIO pin number SCK(UNO 13) , HW SPI , SCK // GPIO pin number SDA(UNO 11) , HW SPI , MOSI

ERM19264_UC1609 mylcd(CD, RST, CS); // instantiate object

// define a buffer to cover whole screen uint8_t screenBuffer[MYLCDWIDTH * (MYLCDHEIGHT/8)]; // 1536 bytes

void setup() { mylcd.LCDbegin(LCDCONTRAST); // initialize the OLED mylcd.LCDFillScreen(0x00, 0); // clear screen mylcd.setTextColor(FOREGROUND); // set text color mylcd.setFontNum(UC1609Font_Default); // set font type }

void loop() {

MultiBuffer myStruct; // Declare a multi buffer struct mylcd.LCDinitBufferStruct(&myStruct, screenBuffer, MYLCDWIDTH, MYLCDHEIGHT, 0, 0); // Intialise that struct (&struct,buffer,w,h,x,y) mylcd.ActiveBuffer = &myStruct; // Assign address of struct to be the "active buffer" pointer mylcd.LCDclearBuffer(); // Clear active buffer

while (1) { mylcd.setCursor(20, 20); mylcd.print(F("Hello world")); mylcd.LCDupdate(); // Update screen , write active buffer to screen delay(5000); } }

gavinlyonsrepo commented 2 years ago

Hi

My display does NOT work with the u8g2 library. I suspect their is a difference between the displays, I have and the one you have and the one used to set up the u8g2 library. (two different manufactures ) This is my theory. I Brought my displays from " Buydisplay" also called "East rising "

This is the github issue(u8g2) where they set up UC1609 https://github.com/olikraus/u8g2/issues/1565 Note the link in issue is to Surenoo product page https://www.aliexpress.com/item/4001167985085.html?spm=a2g0o.cart.0.0.2ef43c00I1rGn4&mp=1

in u8g2 header : U8G2UC1609SLG19264_F_4W_HW_SPI The SLG here stands for "Surenoo LCD graphic" .

  1. Can you tell me where you purchased display module?
  2. Also Can you show me a photo of rear of display board?

Thank you

skartalov commented 2 years ago

Aliexpress

image

image

image

gavinlyonsrepo commented 2 years ago

Hi

FYI If you are connecting DIRECT to 5V Logic lines like on the NANO the J1 jumper is supposed to be shorted. ( i don't know if you are using level shifting or not ) See the wiring diagrams in hardware section of the README.

I will start an issue on u8g2 github to see what manufacturer boards they used and try to gather more testing data.

regards

skartalov commented 2 years ago

It doesn't make sense to short J1 sensor when using 5V. This will pass 5V to the IC and can destroy it. J1 just passes the 3.3V regulator. I think J1 should be shorted only when using 3.3V on power supply.

gavinlyonsrepo commented 2 years ago

The diagram on Readme is copied from manufacturer datasheet. I have shorted J1 and used on 5v logic.

gavinlyonsrepo commented 2 years ago

Hi

A few more things to try for you

  1. Run at voltage logic and psu as per wiring diagram in README.

if you are using 5 volt logic use 5 volt vcc with J1 shorted OR use 3,3 logic (convert nano signals to 3.3) and use 3.3-5V Volt psu with J1 open

You are currently using 5 volt logic with 3.3 V psu

  1. Put a capacitor on Vcc as per wiring diagram in readme if not there already, perhaps issue is PSU noise.

  2. In file ERM19264_UC1609.h set #define UC1609_POWER_CONTROL 0x2F try set this to value 0x2B this is what the other library was it set to for the charge pump , it does not use the external capacitors on module.

  3. Try the software SPI example and see what happens ERM19264_UC1609_SWSPI.ino

  4. Also I have a light text only version of this library you could try this and see what happens [here at link]..(https://github.com/gavinlyonsrepo/ERM19264_UC1609_T)

  5. I suspect the problem lies with these 3 values in ERM19264_UC1609.h

These control the timings of the power up sequence.

define UC1609_RESET_DELAY 3 // ms Delay ,datasheet >3uS

define UC1609_RESET_DELAY2 0 // mS delay datasheet says > 5mS,

define UC1609_INIT_DELAY2 3 // mS delay, before reset called datasheet <3mS

They correspond to the 3 delays pictured here in start up sequence (in reverse order) You could try putting different values in here

Screenshot_2022-03-16_15-11-43

regards

Myaflick commented 2 years ago

1649447754175 1649447754195 Hi there!
Just added a photo of my LСDs - works great with this library. Pay attention to the highlighted area. Your wiring is different (may be some new controller there). P.S. J1 is open, tested on NANO and LGT8 - no problem.

I'm not entirely sure, but u8g2 didn't work for me with these LCDs. Bought on aliexpress from different sellers. The last purchase of the exact same displays was a month ago.

Myaflick commented 2 years ago

Sorry... some update info:

  1. I also bought from the "TZT Official Store" (aliexpress) last year, and "TZT-Five-Star Store" (aliexpress) a month ago.
  2. Just tested the u8g2 - it works too. gavinlyonsrepo's lib (like it much more because of the lightweight):

1649456734352

u8g2 (https://github.com/olikraus/U8g2_Arduino): U8X8_UC1609_SLG19264_4W_HW_SPI u8x8(/ cs=/ 10, / dc=/ 9, / reset=/ 8); 1649456872501

U8G2_UC1609_SLG19264_F_4W_HW_SPI u8g2(U8G2_R0, / cs=/ 10, / dc=/ 9, / reset=/ 8); 1649456734379

And one more thought - maybe this problem appears only on white on blue LCDs (I have not one to test, but I think that setting reset_delays should help).

Video of the same problem and authors comment - If you pull out the rst wire in the on state and connect it back and then restart the arduino, then a picture appears on the display, but still the display does not really work, it freezes. https://www.youtube.com/watch?v=1Wn7uxE2N5o