Author Topic: STM32 SPI usage question  (Read 355 times)

0 Members and 1 Guest are viewing this topic.

Offline gogomanTopic starter

  • Regular Contributor
  • *
  • Posts: 123
STM32 SPI usage question
« on: September 07, 2024, 08:24:04 pm »
Hello, I'm not a embedded person nor an expert with STM. is it possible to use the SPI internal hardware, with a gpio which I toggle to clock out/in data.
If so in general how?  The micro is the master.


thanks gogo
 

Offline dietert1

  • Super Contributor
  • ***
  • Posts: 2380
  • Country: br
    • CADT Homepage
Re: STM32 SPI usage question
« Reply #1 on: September 07, 2024, 08:58:29 pm »
If you input your GPIO generated clock into the SPI peripheral unit pin SPI1_SCK, you can configure and use the SPI unit as SPI slave. Is that what you want to do?
 

Offline gogomanTopic starter

  • Regular Contributor
  • *
  • Posts: 123
Re: STM32 SPI usage question
« Reply #2 on: September 07, 2024, 10:45:44 pm »

If you input your GPIO generated clock into the SPI peripheral unit pin SPI1_SCK, you can configure and use the SPI unit as SPI slave. Is that what you want to do?
yes: to replace the internal SPI clock with GPIO generated clock and no: the STM32 SPI is a master not a slave.


gogo
 

Offline dietert1

  • Super Contributor
  • ***
  • Posts: 2380
  • Country: br
    • CADT Homepage
Re: STM32 SPI usage question
« Reply #3 on: September 08, 2024, 09:44:58 am »
That can't work. If you want to run the SPI interface from an external clock, its clock pin must be an input, so it will run in slave mode. That STM32 can still be the SPI master, but its SPI device can't.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf