2017-12-17 09:49 PM
Hi
We have tested the SPI example code provided from ST disco board with other boards like atmel controller.
Atmel as master and ST disco board as slave.
We have connected
Atmel ST/FPGA
MOSI MOSI
MISO MISO
SCK SCK
NSS NSS
We have set both board side clock frequency 86khz,
Clock Polarity 0
Clock phase 0
SPI Slave(ST) written data to master(Atmel) is below
we have observed the data as below table, other data we have attached.
Data Binary LSB/MSB No of bit shift
0x20(Real) 0010 0000 - -
0x10 0001 0000 LSB 1 bit shift on right
0x80 1000 0000 MSB 2 bit shift on left
When we made slave(ST)side LSB or MSB orientation data shift is happening as above,
Can you please suggest me what is the issue.
the other data observed is attached.
2017-12-17 10:50 PM
Which STM32 is used? At which point of the communication the data to send out by slave is ready? Using interrupt and especially EXTI interrupt on the NSS pin?
2017-12-19 02:07 AM
We are using STM32F769I_Discovery board as slave
SPI_SLAVE_SYNBYTE = 0x55
/**
* @brief Slave synchronization with Master * @param None * @retval None */static void Slave_Synchro(void){ uint8_t txackbyte = SPI_SLAVE_SYNBYTE, rxackbyte = 0x00;/* if (HAL_SPI_TransmitReceive_IT(&SpiHandle, (uint8_t *)&txackbyte, (uint8_t *)&rxackbyte, 1) != HAL_OK)
{ Error_Handler(); }*/if (HAL_SPI_TransmitReceive(&SpiHandle, (uint8_t *)&txackbyte, (uint8_t *)&rxackbyte, 1, HAL_MAX_DELAY) != HAL_OK)
{ Error_Handler(); }}I have tried with both driver API's provided for interrupt method its not working only for HAL_SPI_TransmitReceive only its working
2017-12-19 03:59 AM
Does HAL works properly for interrupts