Tool/software: TI C/C++ Compiler
Could somebody send me an exemple of code for ADS131M04
to use it in my new project. Thank you
my email: nasri.touati@etu.umontpellier.fr
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: TI C/C++ Compiler
Could somebody send me an exemple of code for ADS131M04
to use it in my new project. Thank you
my email: nasri.touati@etu.umontpellier.fr
hello,
this code :
uint8_t spiSendReceiveByte(const uint8_t dataTx)
{
/* --- INSERT YOUR CODE HERE ---
* This function should send and receive single bytes over the SPI.
* NOTE: This function does not control the /CS pin to allow for
* more programming flexibility.
*/
// Remove any residual or old data from the receive FIFO
uint32_t junk;
while (SSIDataGetNonBlocking(SSI_BASE_ADDR, &junk));
// SSI TX & RX
uint8_t dataRx;
MAP_SSIDataPut(SSI_BASE_ADDR, (uint32_t) dataTx);
MAP_SSIDataGet(SSI_BASE_ADDR, (uint32_t *) &dataRx);
return dataRx;
}
i work with stm32F0, how can i make this code for stm32 because i dosen't undrestand this function.
thank you
Hi Nasri,
I'm afraid we cannot support the STM32 MCUs. You'll have to do some research on how to use the SPI peripheral on a third-party MCU, or try asking over at https://community.st.com/s/.
Regarding the TI ADS131M04 Example C Code...
The section of code you referenced uses the TI SimpleLink library to send a single byte of data on the SPI bus (using the MAP_SSIDataPut function), and then it reads back the response from the SPI slave (using the MAP_SSIDataGet function).
Likely there will be some equivalent functions for the STM32 MCU that you can use in place of these TI Library functions.
Hi Nasri,
FYI: I found a bug in the ADS131M04 Example C Code that I would like to make you aware of...
In the "ads131m0x.h" file there is a defined macro for "WLENGTH" on line 1665. This macro had an incorrect register address, and should be changed to the following to avoid issues:
#define WLENGTH ((uint8_t) ((getRegisterValue(MODE_ADDRESS) & STATUS_WLENGTH_MASK) >> 8))