cancel
Showing results for 
Search instead for 
Did you mean: 

SPI write read is not done properly

MDeva.1
Associate II

Hello,

I am working on STM32h7 controller. I configure the AD9106 DAC to SPI. When I tried to write read the configuration register some some registers are get read write and some not why these happening I check the register they are read write able also I changes the SPI frequency low to hgh. For DAC external clock is 150MHZ and SCLK is 4MHZ.0693W00000WJOZpQAP.png

7 REPLIES 7
Bubbles
ST Employee

Hi @MDeva.1​,

what makes you think there's a problem with STM32H7?

Try analyzing the communication using a logic analyzer or some SPI sniffing device such as Beagle.

BR,

J

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

I check on PICOSCOPE. But when I tries to read that particular registers I get the value 0 .

0693W00000WL58jQAD.pngI tried to make the RUN bit 1,but when I read back I get the zero.Why these happening.Here is my code.

0693W00000WL59cQAD.pngCan you me help me.

S.Ma
Principal

The state machine has multiple spi connection configuration. Check which one is enabled by default. If it is 3 wires, this is not the native 4 wire mode and requires that you disable STM32 Mosi pin when starting to read, then revert back manually when going back to output mode. If your SCK toggles, I guess the gpio config is ok.

Hi,

Can you please elaborate the things means what thinks I need to do ?There are two DACs are connected to the SPI4. MOSI ,MISO ,CLOCK are same. 0693W00000WLAaJQAX.jpgRight now I just try to access the DAC1 and for these I make the CS pin HIGH of the DAC2 through out the execution..

In these picture of waveforms I tried to write and read back the address of 1E RUN bit.

Write address=0x001E

Read address=0x801E

Value=0x0001;

I attaché the schematic Please have look.

Can you please help me .

S.Ma
Principal

2 slave dac on the same bus commandd 4 wire spi. Not multi drop, here it is daisy chain. STM32.MOSI goes to DAC1.SDI, DAC1.SDO goes to DAC2.SDI, DAC2.SDO goes to STM32.MISO

As it is daisy chain, you have 2 dac to update in one shot, so the data packet should be longer.... hope this helps.

We does not use the Daisy chain. We give parallel signal to DAC1 and DAC2 , using the chip select establish the communication for DAC1 or DAC2. At time we are not communicate to DAC1 and DAC2. Right now I just try to communicate with DAC1, for these I make CS pin of DAC2 High

S.Ma
Principal

I think an ST example with spi adc and dac would help many users...