Connecting Arduino portenta H7 to transparent OLED screen

Hey peers!
A little guidance can be really helpful here

How to connect Arduino Portenta H7 to DFROBOT Fermion 1.51 "OLED transparent display with available breakout board (converter)

Question about "which code to write" or "how to wire"?

Both of the questions answered would be appreciated but if primarily how to connect

Seems like a nice display

There is an image on the dfrobot website that shows a sample connection - that should be easy to adapt to the portenta.

So, it looks to me as:

  • this display uses an UNIDIRECTIONAL SPI (just SCLK, MOSI and CS, not response via MISO)
  • there are also RES and DC signals (using a regular GPIO out from MCU, but no idea what DC is,
    maybe a signal to differentiate between "Data" and "Command" (for the SPI packet))

So,
it should not be a big deal to setup a SPI interface, to wire to display.
When it comes to SPI to display, here the list of questions to "answer" (and to bear in mind on code writing):

  • is the SPI LSB-First or MSB-First?
  • what is the max. SPI clock speed (SCLK)?
  • what is a "word" in the SPI packet (e.g. a command code, a parameter)?
  • what is the encoding of a SPI command?
    • command keywords? (datasheet)
    • parameters in SPI packet? (datasheet)
    • when word based: are the words LITTLE or BIG Endian? (datasheet)

Other questions could be:

  • are the signals 3V3 or 5V logic?
  • or even 1V8! - do you need a level shifter?
  • what is "DC" used for? (it could be a signal to toggle between "command" and "data", so
    before a SPI transaction, maybe this signal must be driven (and content of SPI packet depends,
    e.g. a command for display or data (e.g. pixels) for display)

Start with simple stuff, e.g.:

  • can you generate a "DISPLAY CLR" command via SPI?
    (or set background color, move cursor ...)
  • do you see any effect on display?
    (due to fact SPI is just for "sending" (UNIDIRECTIONAL) - you cannot read/query any state, not any error codes from display (you have to "trust" that your SPI command is correct, if not - you can mess up the display and "stall" the communication)

It should not be so difficult. Just read the datasheet for this display (the chip used) and setup
a SPI peripheral on Portenta H7.
Implement step by step the SPI commands (with properly encoded SPI packet content).

I would assume:
you have to write all the code needed (at least the SPI packet generation, the "communication") yourself: the Portenta H7 will not have and does not provide a library to support this type of external SPI display.
SPI is a communication to something "external". MCU FW will not know if and what is connected as "external".

Just try to understand the "SPI packets" encoded properly for commands on display.
MCU FW will provide to you a SPI peripheral where any sequence of bytes can be sent.
But what a "proper" SPI packets with bytes/words is for your display - it is up to you to write the code.

I think the signal "DC" means: "Data" vs. "Command":
one level selects on display to send a Command (e.g. reset, cursor position, colors) and the other to send Data (via SPI packet) (e.g. characters, pixels).

It reminds me about a very common "SPI LCD character display" interface.

Just google for some example code, e.g.:
SPI LCD character display

Just find example code (or follow the datasheet for LCD).
You had to implement these code examples on your own FW project.
(Portenta H7 LIB, mbed ... might not support or provide examples how to do, it is for sure not
directly available on your FW project (and LIB) - implement yourself)

Thank you so much would help a lot

Primarily the problem is how to connect the breakout board of the display to arduino portenta H7 board

Here suggestion:

  • the SCLK, MOSI, CS from SPI peripheral pins and use the SPI in FW (as Tx is enough)
  • 2x GPIO signals as output: RES (toggle it to reset display), CD (set accordingly for Command or Data, before you do a SPI transaction)
  • plus 3V3 and GND

Is there any SPI code just to test the connections?