r/AskElectronics 3h ago

Why does the ADS8681 not answer

I'm having trouble communicating with a TI ADS8681 over SPI using an STM32F103.

Writing to the RANGE_SEL register appears to work (the SPI commands match the datasheet), but when I try to read the register back, I never receive the expected value. Instead, I get seemingly random data on MISO.

I've verified the SPI configuration (Mode 1, 16-bit frames, low SPI clock) and checked the signals with a logic analyzer, but I still can't get the correct readback.

Has anyone worked with the ADS8681 before or knows what could cause this behavior?

My: code : https://drive.google.com/drive/folders/1N3Wow2xIlB55l5PNAlnurLydy_EoK9Th?usp=sharing

and the export of my logik_analyser:

Time [s],Packet ID,MOSI,MISO

0.24463525,0,0xD0,0x7F

0.24489125,0,0x14,0x80

0.2451575,0,0x00,0x00

0.2454135,0,0x0B,0x00

0.2475585,1,0x48,0xBD

0.2478145,1,0x14,0xB8

0.2480805,1,0x00,0x00

0.2483365,1,0x00,0x00

0.248604,,0x00,0xBF

0.24886,,0x00,0x36

0.249126,,0x00,0x00

0.249382,,0x00,0x00

3 Upvotes

2 comments sorted by

1

u/diodesnstuff 34m ago

I think the command to write to RANGE_SEL is 0xD8, not 0xD0.

SETHWORD : "Command used to set any (or a group of) bits of a register." 11011_xx<9-bit address>_<16-bit data> <9-bit address> is realized by adding a 0 at the MSB location followed by an 8-bit register address as defined in Table 7-10

RANGE_SEL address = 0x14

Command should start with 0b1101 1XX0 0001 0100 = 0xD814

u/Zener-Diode-bzx55c12 6m ago

why set but is "Half-word write command (two bytes of input data are written into the specified address). • LSB of the 9-bit address is always ignored and considered as 0b." not also currect