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.


Part Number: ADS8686SEVM-PDK

 Here goes his request:

Hello, I am using ADS8686EVM kit to for digitizing a signal from eight
channels using Software mode and one SPI to get result.

The difficulty is that I do not know correct
format to transmit (and when) the channel number to switch the
multiplexer before converting.

I always read the correct result from channel A0, B0, but other channels
transmit the same value, independent of the real signal.

From Data Sheet it is no clear to me what "corresponding register"
should I use to change channel number before conversion and what format
needed (with or without register addres CH_SEL, WR bit?)

It would be great if You can provide code examples or data exchange
diagramm for this mode.

My function to change channel and read result using CUBEIDE+ STM32F407:

void start_conv(char ch_a, char ch_b)
int tempshort;
static status;
char txdata[8];


tempshort = 0;
tempshort |= 0b1000000000000000; // RW
tempshort |= CHANNEL_SEL << 9;
tempshort |= ((ch_b << 4) | (ch_a)) & 0x00FF;
txdata[0] = (tempshort >> 8);
txdata[1] = (tempshort & 0xFF);
// txdata[2] = (tempshort >> 8);
// txdata[3] = (tempshort & 0xFF);

HAL_SPI_TransmitReceive(&hspi2, &txdata, &spi_rx_data, 4, 100); //
what I need to transmite in 3,4 bytes? I need to tx it, because I need
to read 2-th word of B-ch result

adc_a[ch_a] = ((short)spi_rx_data[0] << 8) + ((short)spi_rx_data[1]);
adc_b[ch_b] = ((short)spi_rx_data[2] << 8) + ((short)spi_rx_data[3]);


void send_config(char regadr, char indata)
static short data2write;
static char data_out[2];

// надо собрать в 16 бит адрес регистра, данные и бит
// 15 R/W
// 14...9 regadr
// 7 ...0 data
data2write = 0;
data2write |= 0b1000000000000000; // RW
data2write |= regadr << 9;
data2write |= indata & 0x00FF;

data_out[0] = (data2write >> 8);
data_out[1] = (data2write & 0xFF);
while(HAL_SPI_GetState(&hspi2) != HAL_SPI_STATE_READY); // пока не
закончит передачу
HAL_SPI_Transmit_DMA(&hspi2, &data_out, 2); // по spi сделать
запрос данных

  • Hi Nikolay,

    I assume you are not using the sequencer and burst sequencer mode.

    Firstly, you have to follow the timing below, select the channels and send your command to the ADC at the CHx/CHy/CHz... position, then you will get the conversion data at A/Bx and A/By... position on the SDO:

    Secondly, the command should be 16-bit for AIN_Ax channel and another 16-bit for AIN_Bx channel, total 32-bit, see the timing below:

    Finally, the command format for writing resister is shown below:

    To select the channels, the CHANNEL_SEL register should be used, see the Figure 78 and table 16 for the details.

    I hope this helps.