cancel
Showing results for 
Search instead for 
Did you mean: 

Weird data word size in OLED SPI

bmak
Senior

0693W00000D0pBvQAJ.pngHi!

I'm using EA W162-XBLG OLED in SPI mode. Timing shown in datasheet is really weird. In instruction diagram there is 20 clock cycles, in data transmission 18. I try to get it to work with STM32F407VG, but I can only set 8 or 16 clock cycles.

Maybe someone interfaced with this OLED, or have any idea how to obtain this problem?

Datasheet: https://www.elfadistrelec.pl/Web/Downloads/_t/ds/oled_eng_tds.pdf

Thanks and have a nice day 🙂

1 ACCEPTED SOLUTION

Accepted Solutions
Peter BENSCH
ST Employee

Your chosen derivative only supports 8/16bit transfers with SPI, so depending on other required peripherals you might switch to one of the many other STM32s that support a flexible data length, e.g. STM32F410/412/413, STM32F469, STM32L4xx or STM32F74x...F77x.

Then you can split the data format into 10-bit and 8-bit blocks, each starting with the RS or RW bit. The manufacturer EA has also shown this as an example in an application note for similar OLED modules, see section 7.3 (a).

Good luck!

/Peter

[Edit: Check the reference manual for suitable devices, usually the bits for setting the SPI data size can be found in SPIx_CR2 or SPI_CR2]

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

3 REPLIES 3
Peter BENSCH
ST Employee

Your chosen derivative only supports 8/16bit transfers with SPI, so depending on other required peripherals you might switch to one of the many other STM32s that support a flexible data length, e.g. STM32F410/412/413, STM32F469, STM32L4xx or STM32F74x...F77x.

Then you can split the data format into 10-bit and 8-bit blocks, each starting with the RS or RW bit. The manufacturer EA has also shown this as an example in an application note for similar OLED modules, see section 7.3 (a).

Good luck!

/Peter

[Edit: Check the reference manual for suitable devices, usually the bits for setting the SPI data size can be found in SPIx_CR2 or SPI_CR2]

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Thanks, I thought that it is not possible with the STM32 i have.

Could you tell me, how can you change the data size in these mcus? I don't see information about flexible data length.

In STM32F410 reference manual it is written that you can choose between 8-bit or 16-bit data word size (page 722).

https://www.st.com/resource/en/reference_manual/dm00180366-stm32f410-advanced-arm-based-32-bit-mcus-stmicroelectronics.pdf

Nevermind, I found in the STM32F74xx datasheet. Thanks for your help!