cancel
Showing results for 
Search instead for 
Did you mean: 

How to init SPI properly

Tommino
Senior

Hi,

I am trying to init SPI1 (to just receive data qwith MISO) on nucleo G474RE without using HAL libraries.

Can you help me to assess why my code does not work ?

I can't see the clock eventhough SPI1 is enabled


_legacyfs_online_stmicro_images_0693W00000QLmdH.png
_legacyfs_online_stmicro_images_0693W00000QLmdR.png 

void SPI1_init(){
	RCC-> APB2ENR|=(1 AHB2ENR |= (1MODER &= ~(1 AFR[0] |= (1 AFR[0] |= (1 AFR[0] |= (1 CR1 |= (1 CR1 |= (1 CR1 |= (1 CR2 |=(1CR2 |= (1CR1|= (1CR1|= (1CR1&= ~(1

 

20 REPLIES 20

@Tommino​ "How is this prevented?"

There'll be a status bit that tells you when a transfer has completed.

0693W00000QM3UqQAL.png 

On this chip, you also have read & write FIFOs