2021-06-03 12:44 PM
I need to get information from an ti's ads124s08 and imported an example from arduino forums. I can communicate with device using an arduino for test (on the same board and same specs) but can not use with stm.
In fact, i think there should be a problem about the spi configuration etc, but can't test or resolve the problem.
For example; when the device is connected on SPI pins, hal_spi_transmit function returns 0, but when i disconnect the device from STM's spi pins, it is also returns 0.
How can i get the best test to check my SPI is OK or not?
And, you can check my init functions(canbus, gpio pins, i2c works fine) and ads124s08 code from below. Maybe somebody can help about ads124s08.
Thanks & Regards.
2021-06-03 02:27 PM
> For example; when the device is connected on SPI pins, hal_spi_transmit function returns 0, but when i disconnect the device from STM's spi pins, it is also returns 0.
HAL_SPI_Transmit returns 0 (HAL_OK) when it succeeds. Why are you expecting a different value? It doesn't care if you have SPI pins hooked up to something else or not, it has no way of knowing.
2021-06-03 03:06 PM
> How can i get the best test to check my SPI is OK or not?
The basic test is a simple local loopback - disconnect the ads124s08 and connect the MOSI and MISO pins together - you should be able to receive what you transmit.
SPI is quite simple to operate without any "library" such as cube/HAL, and for basic experiments you don't even need to write any code, just write to and observe its registers in debugger, while observing the signals using oscilloscope/logic analyzer.
JW