cancel
Showing results for 
Search instead for 
Did you mean: 

how i can tarnsmit and receive 1 byte

hamzeh
Associate
Posted on July 03, 2016 at 07:14

Hi

How i can transmit and receive 1 byte by SPI and use of HAL layer for STM32F4 to do for example below routin:

while(1)

{

    while (__HAL_SPI_GET_FLAG(&hspi1,SPI_FLAG_TXE) == RESET);

    temp=0x00;

    HAL_SPI_Transmit(&hspi1,(uint8_t *)&temp,1,10);

    while (__HAL_SPI_GET_FLAG(&hspi1,SPI_FLAG_RXNE) == RESET);

    HAL_SPI_Receive(&hspi1,data,1,10);

}

the micro can not pass RXNE flag while data received. Why?
0 REPLIES 0