This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to set up SPI? STM32h743ZI

I'm still beginner to programming STM32. I haven't been able to configure SPI for two weeks and don't understand what I am doing wrong. I dug up all the forums looking for an answer, but nothing helped to solve my problem. I checked the MOSI and SCK pin with an oscilloscope and there are no signals on these pins. I tried different ways to configure SPI but still nothing helped. Tried configuring for SPI1, SPI2, SPI3, SPI4, SPI5 etc, same problem. Everything works in HAL, but I want to understand what I am doing wrong using CMSIS. Please give me at least a little hint what I'm setting up wrong. I'm using STM32H743ZI debug board. I really hope for your help, thank you.

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "main.h"
#define cs_set() GPIOC->BSRR |= GPIO_BSRR_BR11;
#define cs_reset() GPIOC->BSRR |= GPIO_BSRR_BS11;
void SPIinit (void);
void Settings7219 (void);
void SPITransmit (uint8_t adress, uint8_t data);
int main (void) {
SPIinit();
Settings7219();
GPIOB->BSRR |= GPIO_BSRR_BS0;
while(1){
}
}
void SPITransmit (uint8_t adress, uint8_t data)
{
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

0