Arduino Nano and SSD1322 3.12"

Hello everyone,

I'm new to Arduino. I've done a few home automation related things before, but all as copy/paste youtube videos.

Now I want to add an oled display for my new dac.
What I want to do with Arduino is input selection and on/off with relay.

First of all, I want to run an oled display. But I'm not very good at electronics. I have attached pictures of the oled screen.
Which library should I use and which pins should I use? Can you help me?

ssd1322.pdf (292.2 KB)

Your pcb is configured for 8080 interface. Which means a LOT of wires to connect.

The only library is U8g2lib. e.g. https://github.com/olikraus/u8g2/wiki/u8g2setupcpp#ssd1322-nhd_256x64

U8G2_SSD1322_NHD_256X64_1_8080(rotation, d0, d1, d2, d3, d4, d5, d6, d7, enable, cs, dc [, reset]) [page buffer, size = 256 bytes]

If you are able to use a soldering iron, 4-Wire SPI uses much fewer wires.
U8G2_SSD1322_NHD_256X64_1_4W_HW_SPI(rotation, cs, dc [, reset]) [page buffer, size = 256 bytes]

Let us know how you get on. Ask if you want detailed pin to pin help.

I am always suspicious of shops that say
image

especially when the datasheet says maximum logic signals as 3.5V.
The Nano has 5V logic. Mind you, most other Solomon controllers specify maximum logic voltages but appear to be input voltage tolerant.

David.

Thank you for your fast answer.

Yes I can use a soldering iron.
I'm going to change it to R6 to R5; R8 to R7, right?

Would it be 8080 or 4spi that would limit my usage?

I didn't understand the last part of your message because I'm a beginner :slight_smile:
Can't I use 3v3 and Gnd on nano for oled?

8080 Parallel uses most of the pins on a Nano.
4-Wire SPI uses less wires.

Performance would be similar. Possibly slower with Parallel because it can use random digital pins on the Arduino.

Regarding voltages. Most displays contain their own voltage regulators e.g. U3, U4 on your pcb.
U3 and U4 will accept 5V or 3.3V. I suggest that you choose 5V from the Nano.

However 5V logic signals mean that your "high" logic is greater than the 3.3V operating voltage (from U3,U4). External chips are very fussy about signals that are higher or lower than their operating voltage. Which is why you provide level-shifter circuitry i.e. to convert 5V logic to civilised 3.3V levels.

If a chip is "input voltage tolerant" it means that a 5V high signal does no harm.
Your SSD1322 is made by Solomon Systech. The datasheet says "not tolerant" but in practice Solomon controllers seem to be ok.
Other manufacturers are less forgiving !!

David.

I will change it to 4spi.
R6 -> R5; R8 -> R7
Is that enough? Do I need to do anything else?

I want to help pin to pin for 4spi. :slight_smile:

image

Display : Nano
16        D10
15        D8
14        D9
5         D11
4         D13
2         5V
1         GND

From the U8g2 examples. Start with the SW_SPI e.g.

U8G2_SSD1322_NHD_256X64_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);	// Enable U8G2_16BIT in u8g2.h
//U8G2_SSD1322_NHD_256X64_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);	// Enable U8G2_16BIT in u8g2.h

Then try the HW_SPI version:

//U8G2_SSD1322_NHD_256X64_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);	// Enable U8G2_16BIT in u8g2.h
U8G2_SSD1322_NHD_256X64_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);	// Enable U8G2_16BIT in u8g2.h

I think that the example will "work" without editing U8G2_16BIT in u8g2.h
But you will need to do the edit for all 256 pixels to work properly.

Untested. I don't have your display.

From the photo you have R6, R8 i.e. 8080
You need R5, R8 i.e. 4-SPI

So you only change R6 to R5.

David.

I soldered R5.

I send to nano that;

#include <Arduino.h>
#include <U8g2lib.h>
#include <SPI.h>
#include <Wire.h>

//U8G2_SSD1322_NHD_256X64_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);  // Enable U8G2_16BIT in u8g2.h
U8G2_SSD1322_NHD_256X64_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);  // Enable U8G2_16BIT in u8g2.h

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

void loop(void) {
  u8g2.firstPage();
  do {
    u8g2.setFont(u8g2_font_ncenB14_tr);
    u8g2.drawStr(0,24,"Hello World!");
  } while ( u8g2.nextPage() );
}

But lots of error;
Arduino:1.8.19 (Windows 10), Kart:"Arduino Nano, ATmega328P"

Çalışmanız programın 9508 bayt (30 %) saklama alanını kullandı. Maksimum 30720 bayt.

Global değişkenler belleğin 748 byte kadarını (36%) kullanıyor. Yerel değişkenler için 1300 byte yer kalıyor. En fazla 2048 byte kullanılabilir.

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xea

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xea

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0xea

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0xea

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0xea

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0xea

Problem uploading to board. See https://support.arduino.cc/hc/en-us/sections/360003198300 for suggestions.

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0xea

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xea

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0xea

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0xea

SW_SPI and HW_SPI are same results.

I found the error solution; I chanced cpu ATmega328P (Old Bootloder).
There is no error.

SW_SPI;

HW_SPI

1 Like

And removed R6 at the same time.

The reason for the programming errors is due to using the "wrong" Arduino.
Old Nano bootloader expects 57600 baud.
New Nano bootloader expects 115200 baud.

Make sure that you select the correct Nano board.

Regarding the snow storm on your screen.
Make sure that you have identified the pins correctly on the 8x2 CON16 header.

And try again.

Yes it is ok.

You are right my nano was old bootloder. I sellect it and everything is ok.

You are right again. :slight_smile: I re-pinned the pins and it works.

It seems to work with both SW_SPI and HW_SPI. Which one should I choose?

HW_SPI is always better (and faster) than SW_SPI.
It is always safer to try SW_SPI first on a foreign board.

I suggest that you run all of the U8g2 examples.
You know which constructor to un-comment.

Only the "paged" examples will work. Your Nano does not have enough SRAM to use a "full buffer".
But if you had a Mega2560, Zero, Due, ... you could use the _F_ constructors. Then both paged and full examples should work.

Those big OLED displays look very nice. But much more expensive.

David.

I will run HW_SP.

What do you mean there?

My project is to read Bit rate - sample rate information from fgpa on my r2r dac and display it on the screen. Select input (xmoa and coax) on fgpa with ir remote. And turn on/off with relay.
Wouldn't nano be enough for this project?

I bought it from AliExpress. It's cost 25usd with shipping.

The Nano will be absolutely fine for displaying text and simple graphics. Don't worry about _F_ constructors or fancy MCU boards.

My advice is always : run all of the library examples first.

Don't jump into your own custom project until you have seen what the library examples can do. Make notes about which example does something that might be useful in your project.

Then you can study the source code when you want to implement something similar in your custom project.

If you want help, you can quote the library example name and say which feature you want to use.

David.

Ok, thank you very much for your help and guidance.

I'm going to ask one last question, and then I jump into the library. :slight_smile:

It works with fgpa 3v3. Will I have a problem with the Nano for the input selector? Do I need to add an converter? Or should I continue with a 3v3 device like Mini Pro?

Quote a part number for your FPGA.
Or better still, post a link to the actual FPGA that you have bought.

Arduino Nano uses 5V.
The civilised world uses 3.3V devices.
It is sensible to use 3.3V boards like Pro-Mini_8MHz or popular controllers like STM32

David.

This is my FPGA; EP4CE6E22C8N
https://a.aliexpress.com/_mNsuhVa

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.