2019-11-26 05:12 AM
Hi
I want to communicate with a device that uses SPI, I want to grab data from this device but when it transmits a byte waits for an acknowledgment signal which is a positive pulse with 2us lent. So I should wait until it sends 1 byte of data, store it and make the acknowledgment signal.
could anyone help me to know what functions I need. I’m using HAL functions.
2019-11-26 11:33 AM
Is the ack signal a separate pin or it's mixed with MISO or MOSI ?
And which one is master, which one slave?
2019-11-26 12:59 PM
Hi
thank you for your attention firstly.
it is a separate pin and the unknown device that transmits is master and stm32 is going to be slave
additionally I have problem with receiving data and sending it through UART.
2019-11-27 11:45 PM
No one can answer my question?
2019-11-28 12:07 AM
> No one can answer my question?
Correct.
Take a look at the SPI peripheral section of the reference manual for your STM32, especially the configuration options. Seems you don't even know the required clock polarity.
Perhaps a trial-and-error approach, but getting to know your "unknown" device is the best way.
2019-11-28 12:29 PM
I’m using STM32F030F4P6. I set the clock polarity, slave mode and other settings using CubeMX so these things seem to be ok.
I think if I connect MOSI, CLK and CS pins, the SPI peripheral should get 8bit data coming from the “unknown device�? and generate interrupt. correct me if I’m wrong.
I want to read and store the data in a variable, send it through UART and generate ack on related pin when interrupt occurs.
what settings should I have on SPI in CubeMX to enable interrupt? And what functions is suitable for read and store the data in my case?
Hop this details enough someone who wants help me.
thanks