Tool/software:
void ADS8691_Init(uint8_t adc_num) { // 1. Plage d’entrée : Bipolaire ±10.24V 0x0001 dans le registre 0x14 ADS8691_WriteRegister(adc_num, REG_INPUT_RANGE, RANGE_BIPOLAR_10V24); // 2. Référence interne activée en permanence 0x0003 dans le registre 0x3C ADS8691_WriteRegister(adc_num, REG_REF_CTRL, REF_INTERNAL_ALWAYS_ON); // 3. Configuration ligne SDI : mode normal 0x000 dans le registre 0x3E ADS8691_WriteRegister(adc_num, REG_SDI_CTRL, SDI_DEFAULT); // 4. Configuration ligne SDO : toujours activée 0x000 dans le registre 0x3F ADS8691_WriteRegister(adc_num, REG_SDO_CTRL, SDO_DEFAULT); } void ADS8691_WriteRegister(uint8_t adc_num, uint8_t reg, uint16_t value) { uint32_t cmd = CMD_WRITE_REGISTER | ((reg & 0x3F) << 16) | (value & 0xFFFF); uint8_t tx[4] = { (cmd >> 24) & 0xFF, (cmd >> 16) & 0xFF, (cmd >> 8) & 0xFF, (cmd >> 0) & 0xFF }; GPIO_TypeDef* sync_port = (adc_num == 1) ? ADC1_SYNC_GPIO_Port : ADC2_SYNC_GPIO_Port; uint16_t sync_pin = (adc_num == 1) ? ADC1_SYNC_Pin : ADC2_SYNC_Pin; sync_port->BSRR = (uint32_t)sync_pin << 16; // SYNC LOW HAL_SPI_Transmit(&hspi2, tx, 4, HAL_MAX_DELAY); sync_port->BSRR = sync_pin; // SYNC HIGH HAL_Delay(1); }

I tried to oscillate the commands from clk, sdi, sdo, and sync, which seem correct to me, but where I should have the register data on the last two bytes of the 32-bit frame, I get nothing.


I can see that the ADS8691 is reacting, since it responds in SDO with the same data relating to the register queried in SDI?...
float ADS8691_ReadVoltageFast(uint8_t adc_num, float offset_correction) { GPIO_TypeDef* sync_port; uint16_t sync_pin; if (adc_num == 1) { sync_port = ADC1_SYNC_GPIO_Port; sync_pin = ADC1_SYNC_Pin; } else { sync_port = ADC2_SYNC_GPIO_Port; sync_pin = ADC2_SYNC_Pin; } uint8_t tx_buf[4] = {0x00, 0x00, 0x00, 0x00}; // NOP uint8_t rx_buf[4] = {0}; // SYNC LOW sync_port->BSRR = (uint32_t)sync_pin << 16; HAL_SPI_TransmitReceive(&hspi2, tx_buf, rx_buf, 4, HAL_MAX_DELAY); // SYNC HIGH sync_port->BSRR = sync_pin; uint32_t raw = ((uint32_t)rx_buf[0] << 24) | ((uint32_t)rx_buf[1] << 16) | ((uint32_t)rx_buf[2] << 8) | ((uint32_t)rx_buf[3]); // Sign-extended 18-bit value extraction int32_t code = ((int32_t)(raw << 2)) >> 14; float voltage = code * 0.000078125f; return voltage + offset_correction; }