Skip to main content
Visitor II
February 8, 2024
Solved

STM32F103C8 using SPI2

  • February 8, 2024
  • 30 replies
  • 14200 views

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.

    This topic has been closed for replies.
    Best answer by hamo

    The problem was with the hardware.
    Finally i could get the SPI2 work together with SPI1 on the same Board.
    Many Bluepills are just not good this days.

    Anyway thank you all for being helpful.

    Best regards

    Mohamad

    30 replies

    hamoAuthor
    Visitor II
    February 16, 2024

    @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.

    hamoAuthor
    Visitor II
    February 16, 2024

    CS ist low -> correct.

    I have tried transmit only master -> no

    The problem is  -> NO CLOCK.

    NO CLOCK -> WILL NOT WORK.

    Super User
    February 16, 2024

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

    Why ?   wrong debug setting ?

    hamoAuthor
    Visitor II
    February 16, 2024

    @AScha.3 

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

    Thanks

    hamoAuthor
    Visitor II
    February 16, 2024

    I have debugged RCC -> APB1ENR:

    SPI2_RCC_BIT_14.JPG

    Bit 14 in RCC is set -> SPI2 is enabled

    hamoAuthor
    Visitor II
    February 17, 2024

    I need a driver for the 1.8 TFT ST7735.

    I am not sure but it may lay on the driver i am using.

    Do you know any?

    Graduate II
    February 18, 2024

    I'm sorry. My 2 inch 240x320 display works with ST7789 driver.

    I think that is not compatible with ST7735.

    hamoAuthor
    Visitor II
    February 18, 2024

    Thank you all for the support, but i think there is a big problem with the SPI2.
    Neither this driver has worked.
    The same issue -> HAL_SPI_Transmit() keep stucks.
    Idk what to do now.

    Super User
    February 18, 2024

    You have another board/cpu to try ? Just to check, that you not damaged this cpu/spi2 - and it cannot work....

    hamoAuthor
    Visitor II
    February 18, 2024

    @xisco 

    I have tried PB13 as DIO and the LED blinks normaly

    The GPIO B13 is working normaly, so the problem is with the SPI settings i think.

    hamoAuthor
    Visitor II
    February 18, 2024

    I have tried another STM32F103C8T6 -> not working.

    Super User
    February 18, 2024

    Ok, so : your SPI2 not "working" , others (+mine) do ; cpu change -> same , so cpu ok. (except other cpu same damage.)

    If same setup (in Cube) , same HAL calls used , but nothing coming out -> your on wrong pin. check again.

    hamoAuthor
    Visitor II
    February 19, 2024

    I am interfacing only the display right now.

    There is no LoRa now.

    Display cables are max 7cm.

    hamoAuthor
    Visitor II
    February 20, 2024

    I have tried many borads -> no success

    hamoAuthorAnswer
    Visitor II
    March 19, 2024

    The problem was with the hardware.
    Finally i could get the SPI2 work together with SPI1 on the same Board.
    Many Bluepills are just not good this days.

    Anyway thank you all for being helpful.

    Best regards

    Mohamad