cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103C8 using SPI2

hamo
Senior

Hello,

i am trying to interface 1.8 inch SPI TFT Display 128 x 160 to the STM32F103C8 using SPI2.

https://www.az-delivery.de/products/1-8-zoll-spi-tft-display

SPI1 is used for LoRa, i thought to connect TFT too to SPI1 using addresses but i am affraid to influence the

LoRa.

The library which i am using is from this website:
https://controllerstech.com/st7735-1-8-tft-display-with-stm32/

A year earlier i tried to interface LoRa to STM32F103C8 using SPI2 but without success.

Is it a general problem in STM32F103C8 using SPI2?

Any help is appreciated.

65 REPLIES 65
hamo
Senior

Hello @waclawek.jan 

i have used logic analyzer and figured out that there is no clock.

Here is a capture of the SPI2:

SPI2_Com.JPG

 

The only toggle is when i reset the bluepill.

What code is this?

Have you got a basic SPI example working on SPI2?

hamo
Senior

This code is to make ST7735 TFT work.

Which example do you mean?

You just need the simplest SPI example you can find - one which does just SPI and nothing else.

You need to get the basic comms working before adding complications like a TFT display!

Otherwise you won't know if the problems are with the SPI itself, or elsewhere in all the mountains of other code.

ST publishes basic peripheral examples; eg, in the Cube IDE ...

 

EDIT:

 

https://www.st.com/en/embedded-software/stm32cubef1.html

 

Yes - i have just now a small 2,2" TFT on SPI2 running, on a "blue pill" board.

How you set the spi2 in Cube ?  ed , ok i seen it.

I have it at 18Mbit...and using CubeIDE .

 

->

AScha3_0-1707836886528.png

 

If you feel a post has answered your question, please click "Accept as Solution".
hamo
Senior

@AScha.3  thanks for for your reply.

can you please share your STM32CubeMX settings?

@Andrew Neil  thanks, i will do that surely

My spi2 setting:  (+ pin speed: high )

AScha3_0-1707838168356.png

 

 

If you feel a post has answered your question, please click "Accept as Solution".
hamo
Senior

@AScha.3 

and which pins do you use for CS, RESET and DC?

Are you clocking at max 72 MHz?

Yes , core at 72 M.

CS.. are just any I/O pins, that are close (for wiring...i hate, to have a wire cross the board. :) )

If you feel a post has answered your question, please click "Accept as Solution".
hamo
Senior

@AScha.3  i have just tried this settings and compiled the code and uploaded, it stills not working for me.

I used the logic analyzer -> all the pins (SPI2) are not toggling.

SPI2_setting.JPG