Tool/software:
Hello everyone,
I'm working on a custom board that uses the ADS124S06 but I'm unable to communicate.
I've checked SPI CS/DIN/SCLK signals and it looks just fine despite that I'm unable to see any data in DOUT.
I guess timigs are ok, spi clock is 1MHz and CS delay is ~1us
I'm using my own driver, wrote following the user manual:
void ADS124S0X_send_read_command(void* spi, uint8_t start_adr, void* dest, uint8_t length) { if(length == 0) return; uint8_t *p8_dest = (uint8_t*)dest; hal_spi_channel_t* hal_spi = (hal_spi_channel_t*)spi; hal_spi_result_t result = HAL_SPI_RESULT_OK; uint8_t command = CMD_RREG | (start_adr & 0x1F); uint8_t len = (length - 1) & 0x1F; HAL_SPI_Enable_slave(hal_spi); HAL_SPI_exchange_byte(hal_spi, command, NULL); HAL_SPI_exchange_byte(hal_spi, len, NULL); while(length-- && result == HAL_SPI_RESULT_OK) { result = HAL_SPI_exchange_byte(hal_spi, 0, p8_dest); p8_dest++; } HAL_SPI_Disable_slave(hal_spi); } void ADS124S0X_send_write_command(void* spi, uint8_t start_adr, void* src, uint8_t length) { if(length == 0) return; uint8_t *p8_src = (uint8_t*)src; hal_spi_channel_t* hal_spi = (hal_spi_channel_t*)spi; hal_spi_result_t result = HAL_SPI_RESULT_OK; uint8_t command = CMD_WREG | (start_adr & 0x1F); uint8_t len = (length - 1) & 0x1F; HAL_SPI_Enable_slave(hal_spi); HAL_SPI_exchange_byte(hal_spi, command, NULL); HAL_SPI_exchange_byte(hal_spi, len, NULL); while(length-- && result == HAL_SPI_RESULT_OK) { result = HAL_SPI_exchange_byte(hal_spi, *p8_src, p8_src); p8_src++; } HAL_SPI_Disable_slave(hal_spi); } #define ID_ADS124S06 (0x01) uint8_t AD124S0X_Init(void* hal_spi) { uint8_t ads124s0x_id = 0; ADS124S0X_send_read_command(hal_spi, 0x00, &ads124s0x_id, 1); if(ads124s0x_id != ID_ADS124S06) return 1; return 0; }