Corrupted Display using DOGm128 Display

I have a project that I have been working on using a Arduino MICRO and a DOGm128 Display.

the display works BUT it glitches out. and sometimes goes blank. I have tried using different
libraries with the same outcome.

here is a link to a video clip https://1drv.ms/v/s!AvQPj1hPTrhrhTq4nXlTNyBoMCvN

Could this be a hardware problem, I have tried 2 different displays. could I have a bad cap?

Thanks,
Rick

Please post a link to the actual display that you have bought.
Please say which library you are using and post some code that exhibits your problem.

The video shows three small rectangles that appear to change.
The manner of the corruption suggests a software problem. The ST7565 hardware would not do that by itself.

Yes, a video is very useful. It probably involves many MB of online storage somewhere.
Pasting the URL of an Internet purchase involves about 100 Bytes.
Pasting a small sketch involves a few kB.

David.

p.s. Google shows many different "DOGM128" items. I can "guess" one from the video but would be much happier if you identify the actual model.

I am using the DOGm128s6 display, I have tried using the "DOG_7565R.h" library as well as u8g2lib.h

I purchased the display from Mouser, I don't see how that even matters!

my code is from the manufactures website

#include <Arduino.h>
#include <SPI.h>
#include <dog_7565R.h>
#include <font_16x32nums.h>
#include <font_6x8.h>
#include <font_8x16.h>
#include <font_8x8.h>
#include <logo_BLH.h>

/*Available functions in dog_7565R Libraray:
  void initialize  (byte p_cs, byte p_si, byte p_clk, byte p_a0, byte p_res, byte type);
  void clear       (void);
  void contrast    (byte contr);
  void view        (byte direction);
  void string      (byte column, byte page, const byte *font_adress, const char *str);
  void rectangle   (byte start_column, byte start_page, byte end_column, byte end_page, byte pattern);
  void picture     (byte column, byte page, const byte *pic_adress);
*/

dog_7565R DOG;

//the following port definitions are used by our demo board "EA PCBARDDOG7565"
int led       = 3;
int led_red   = 3;
int led_green = 5;
int led_blue  = 6;
int Sat;
void init_backlight(boolean mono);
void mono_backlight(byte brightness);
void rgb_backlight(byte red, byte green, byte blue);


void sample_screen(void);

//initialize the backlight and the display
void setup()
{
  init_backlight(true); //use monochrome backlight in this sample code. Please change it to your configuration
  DOG.initialize(10,0,0,9,4,DOGM128);   //SS = 10, 0,0= use Hardware SPI, 9 = A0, 6 = RESET, EA DOGM128-6 (=128x64 dots)
}

//create a sample sceen content
void sample_screen(void)
{
  Sat = 5;
  DOG.clear();  //clear whole display
  DOG.picture(0,0,ea_logo);
  DOG.string(71,0,font_8x16,"DOGM128");        //font size 8x16 first page         
  DOG.rectangle(71,2,127,2,0x03);              //show small line (filled pattern = 0x03), to the left and right of 'DOGM128'            
  DOG.string(0,4,font_6x8,"-ST7565R controller");
  DOG.string(0,5,font_6x8,"-different backlights");
  DOG.string(0,6,font_6x8,"-extrem low power");
  DOG.string(0,7,font_8x8,"lcd-module.com");
}

//main loop
void loop()
{
  mono_backlight(255);    //BL to full brightness
  DOG.view(VIEW_BOTTOM);  //default viewing direction
  sample_screen();        //show content
  delay(2000);
  mono_backlight(128);    //BL to half brightness
//  DOG.view(VIEW_TOP);    //alternate viewing direction
  sample_screen();
  delay(2000);
}

//The following functions controll the backlight with a PWM. Not needed for the display content
void init_backlight(boolean mono)
{
  if(mono) //EA LED55X46-G, EA LED55X46-W, EA LED55X46-B, EA LED55X46-A, EA LED55X46-R, EA LED55X46-E
  {
    pinMode(led,  OUTPUT);
    mono_backlight(255);
  }
  else  //EA LED55X46-RGB
  {
    pinMode(led_blue,  OUTPUT);
    pinMode(led_green, OUTPUT);
    pinMode(led_red,   OUTPUT);
    rgb_backlight(255,0,0);
  }
}
//Use this funtion for monochrome backlight
void mono_backlight(byte brightness)
{
  analogWrite(led, brightness);  
}
//Use this function for RGB backlight
void rgb_backlight(byte red, byte green, byte blue)
{
  analogWrite(led_red,  red);  
  analogWrite(led_green, green);  
  analogWrite(led_blue,   blue);  
}

Rick

It does not matter where you bought it from. Only that the link shows the model that you have bought and what it looks like. e.g. the Mouser sale page.
I had to Google "DOGM128 mouser" to find https://www.mouser.co.uk/ProductDetail/Display-Visions/EA-DOGM128W-6

Likewise, it would be nice to have a direct link to the dog_7565R.h library.
Google "dog_7565R.h" does not get the source code.

I don't mind doing some simple Googling. But I can't debug a library that I can't find.

On the other hand, u8g2lib.h is a publicly available library. I can confirm that ST7565 displays work very reliably with u8g2lib

If u8g2lib produces the same corruption as your video I would suspect your hardware.
As I said earlier. The corruption shown in the video is unlikely to come from the ST7565R controller.

David.

the DOG_7565R.h library can be found on the manufactures website.

https://www.displayvisions.us/display-support-in-software-and-hardware/application-note/arduino-meets-ea-dog.html

if you think that this is a hardware issue, do you think it could possibly be my Arduino Micro itself?
I have changed all other components on my PCB.

Rick

The pin outs that I am using are:
A0=D9
CS=D10
Reset=D6
SI=MOSI
CLK=SCK

The Level shifter I am using is the 74LVC245 with
pin 20 going to 3.3v
Pin 1 going to +5v
Pin 19 going to VSS
Pin 10 going to VSS

with the 4 data lines using A0 -> A4 inputs
and the outputs from B0->B4 going to the display.

Rick

Thanks for the link. I can build the dogm128_mono_backlight.ino example and run it on a regular 3.3V ST7565 display. (but tomorrow not tonight)

The link also shows schematics for connecting to a 5V Uno.
You need to follow a similar plan for your 5V Micro. i.e. voltage dividers (or level shifter chips)

The DOGM128 pdf is very clear about 3.3V logic. However you can use either 5V or 3.3V for the backlight via a suitable current limiting resistor.

David.

thanks David, I appreciate your help.

in the post above your will find my pin outs listed

Rick

The LVC245A should be fine. I count five logic signals on A0-A4

I presume that you have soldered headers / sockets. i.e. reliable wiring connections.
Breadboards might "work" but I would never trust them.

David, I was just looking at the schematic for the UNO with the DOGm...
am I using the correct Pinout for SI? I have it going to MOSI the UNO schematic shows it going to MISO!

Rick

I had a PCB made for my project

Rick

The schematic calls it SI (Slave-In) and it connects to Arduino D11 (MOSI on a Uno)

It will be interesting to see how the example sketch works on my ST7565.
You appear to have covered all the usual suspects i.e. wrong logic levels, flaky breadboard, flaky jumper wires, ...

David.

I am wondering if i have a flaky Micro...
Rick

I ran the example on a regular 3.3V ST7565 display. My panel is slightly different to the DOGM panels. I had to edit the library CPP file

void dog_7565R::position(byte column, byte page)  
{
	if(top_view && type != DOGM132)
		column += 4;
		
	command(0x10 + (column>>4)); 	//MSB adress column
	command(0x00 + (column&0x0F));	//LSB adress column
	command(0xB0 + (page&0x0F)); 	//adress page	
}

to

void dog_7565R::position(byte column, byte page)  
{
	if(!top_view && type != DOGM132)   //.kbv my panel requires offset at bottom view
		column += 4;
		
	command(0x10 + (column>>4)); 	//MSB adress column
	command(0x00 + (column&0x0F));	//LSB adress column
	command(0xB0 + (page&0x0F)); 	//adress page	
}

I had a further look at your video. You have a DOGM128-B not DOGM128-W
I looked a t stationary views at 2.1, 4.1, 6.1, 8.1, 10.1, ... 18.1 seconds

You can see that the backlight does not change in intensity. But different rectangles on the screen are corrupted when the mono_backlight() is changed.
If the pcb is already made, just comment the mono_backlight() calls in loop(). i.e. call once in setup()

I assume from your code that you are using:

SCK = D15
MOSI = D16
CS = D10
DC = D9
RST = D4
LED = D3

and that the PWM signal on D3 is corrupting the picture. I guess that the affected rectangles do not always match the video.

I suggest that you wire LED directly to VCC via a resistor. i.e. forget about PWM.

Morning David, my backlight has always been wired to 5v.

Am I correct to believe that your display did not glitch out?

As you pointed out the display in the video is glitching every 2 seconds, that is when the display
updating.

I have also used the u8g2 Library and it does the same glitching.

I will try to build up another board later with a different Arduino installed on it to see
if that fixes it issue.

if you have any other suggestions please let me know.

Rick

The PDF advises suitable values for the backlight resistor. I guess something like 200R for 5V.

Remove the mono_backlight() calls. Something is upsetting your loop() code every 2 secs.

Are the corrupted rectangles repeatable?

Which U8g2lib example shows a problem?

Yes, my LCD works 100%.

David.

this has got to be the most basic example...

#include <U8g2lib.h>

U8G2_ST7565_EA_DOGM128_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 6);

void setup(void) {
  u8g2.begin();
}

void loop(void) {
  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.sendBuffer();                  // transfer internal memory to the display
  delay(1000);  
}

Rick

it does not glitch every time it refreshes, and it seems to glitch more often when there is more data on the screen.

Rick

It looks as if you have to assemble this by yourself. i.e. COG display + backlight + pcb.
I presume that the pcb contains the external capacitors already mounted.

However you look at it, there are many things to go wrong. e.g. dry joints, broken pcb traces, ...

My display came from AliExpress https://www.aliexpress.com/item/32849604267.html
I probably soldered the header pins but everything else was ready-made.

I can only suggest that you check over your "assembly procedure". e.g. check SMD capacitors, soldering etc.
Then ask for a replacement from Mouser.
Meanwhile I would order some cheap 128x64 COG displays from China.

David.

Thanks for the info David, I will try a different Arduino Micro first but to do that I will need to build up another PCB.

The Display from Aliexpress, is it daylight readable?

Also can it display inverse text (white text on black background)?

Rick