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

I have debugged RCC -> APB1ENR:

SPI2_RCC_BIT_14.JPG

Bit 14 in RCC is set -> SPI2 is enabled

@AScha.3 

Yes i think wrong debug setting.
can you share your debug settings please for the bluepill?

Thanks

xisco
Associate III

Hi,

I tested it on a blue pill, on spi2, 72 MHz Core, 36 MHz APB1.

Works perfect with a 2 inch display.

Bluepill.png

Cubeide.png

 

@hamo , here debug setting:

AScha3_0-1708160227126.png

 

If you feel a post has answered your question, please click "Accept as Solution".
>> Read out and check/post content of SPI and relevant GPIO/AFIO registers.

> Ok, and how?

Read out in debugger, in the same way as you've did it with RCC registers (there should also be some "peripheral view" window in your IDE somewhere, I don't use IDEs). Do that just before the moment you intend to start to transmit (i.e. place a breakpoint there).

(Using debugger is the most convenient way, even if there are some caveats. You could also read them out in program and output them in any way e.g. using UART).

Check by comparing registers content to the expected content, referring to respective chapters in Reference Manual.

JW

Hello,

look at my settings just like your still not working.

STM32CUBEIDE_DEBUG_CONFIG.JPGSTM32CUBEIDE_DOWNLOADD_SUCCESS.JPG

Download successfully, and altough not working -> LED not blinking

Seems it working ok, but you dont start debug , only download ; look at you startup setting ->

AScha3_0-1708171551685.png

 

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

Hi,

 

I remember that time ago, I had problems with this display.

The driver from bluefish (github), if you use it, has a problem using dma. The first time, in compilation, show a warning about variable types and not work. Next compilations, CubeIDE does not show any warning but still not working.

This driver works ok without using DMA.

 

The hardware, better soldered than dupont cables.

 

On STM32F446RE, this display shows bad information using High clock frequencies.

 

I lokked at my startuo settings, they are just yours.
i have tried to upload the code as .bin file using STM32 ST-LINK utility -> code uploaded but still not working, LED is not blinking.

I tried another bluepill, so the problem is not with hardware.

The hole story is driving me crazy.

I will go back to Keil IDE and try another Driver for the TFT

So i cannot help you - if same settings in CubeIDE do different things - we have to call a priest or exorcist .

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