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

Where  is no clock ?

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

After changing the code and uploading it on the bluepill, i use logic analyzer to see if it works.
There is no clock on the pin PB13 -> not toggling at all.

Cannot be ... :flushed_face:

Show what you set in Cube to SPI2 .  we looked already.

Try debug - on  HAL_SPI_Transmit(...) : what it doing ???

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

I ahve done it.
after initialiying it tries to send the data and waits for the TXE flag to be set so it can send data.

But it keeps wait then goes to timeout.

With the help of logic analzyer i see there is no clock.

Read out and check/post content of SPI and relevant GPIO/AFIO registers.

JW

ok - just : you use cubeIDE - right ? nothing special doing .... ?

Because i set it in CubeMX, then generate code, then write to spi (HAL_... ) -- and it works.

So you must do something different...but i have no idea, what it could be.

ed 

maybe i seen..

you set : half duplex master . 

try: 

 

AScha3_0-1708027359333.png

 

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

@AScha.3  thanks

I will try that but i am using Keil IDE and not STM32CubeIDE.

I tries to use STM21CubeIDE, but it couldn't upload the code to the MCU.

Ok, and how?

hamo
Senior

CS ist low -> correct.

I have tried transmit only master -> no

The problem is  -> NO CLOCK.

NO CLOCK -> WILL NOT WORK.

>I tries to use STM21CubeIDE, but it couldn't upload the code to the MCU.

Why ?   wrong debug setting ?

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