Post Go back to editing

AD7771 and DOUTx interface

Category: Software
Product Number: AD7771

Hi,

I want to read ADC data from AD7771 via DOUT0 line - all 8 channels in 1 line.

What I did:

I am in SPI control mode:

- Set PowerMode to LP

- Set decimation rate (I want ODR = 1 kHz) => 1024/1 = 1024 = 0x400 - to the rigister  SRC_N_MSB I wrote 0x04 and to SRC_N_LSB I wrote 0, then I update it via register 0x64 (SRC_UPDATE)

- Set Output format and DCLK via reg. 0x14 (DOUT_FORMAT) => DOUT_FORMAT = 0b11100100 (1 DOUTx line,CRC header,reserved,MCLK/4,Reserved).

- Set reference to internal via reg. 0x15 (ADC_MUX_CONFIG) => ADC_MUX_CONFIG = 0b01000000

After that I can see:

- DRDY pin has period of 1 khz - perfect!

- On the scope I can see 8x32 bits packets - looks OK to me.

Questions:

- Is OK when after all 8x32 bits packet the CLK still generates cloks even if the data are already sent?

image here:

- Where does the data start (CRC header for channel 0)?:

Finally I tried to read this data by STM32 via SAI interface, but I am not succesful. The discussion is here without answer:  RE: Any advice on reading the AD7779 DOUT0 using an STM32 SAI input? 

Thank you for any advice.

Jan.

Parents Reply
  • Hi, unfortunatelly I can not confirm it.

    The best results  I have got:

    I Can read 4 channels or can read 8 channels but with shift: first byte is on second possition in my rxDataArray,... so I need to read not 32 bytes but 33. So I still do not have the right configuration, cannot find any detailed information about it

Children
  • Finally!

    This variant works to me - reading 8 channels in 1 DOUt line:

    hsai_BlockB3.Instance = SAI3_Block_B;
      hsai_BlockB3.Init.Protocol = SAI_FREE_PROTOCOL;
      hsai_BlockB3.Init.AudioMode = SAI_MODESLAVE_RX;
      hsai_BlockB3.Init.DataSize = SAI_DATASIZE_32;
      hsai_BlockB3.Init.FirstBit = SAI_FIRSTBIT_MSB;
      hsai_BlockB3.Init.ClockStrobing = SAI_CLOCKSTROBING_FALLINGEDGE;
      hsai_BlockB3.Init.Synchro = SAI_ASYNCHRONOUS;
      hsai_BlockB3.Init.OutputDrive = SAI_OUTPUTDRIVE_DISABLE;
      hsai_BlockB3.Init.FIFOThreshold = SAI_FIFOTHRESHOLD_EMPTY;
      hsai_BlockB3.Init.SynchroExt = SAI_SYNCEXT_DISABLE;
      hsai_BlockB3.Init.MonoStereoMode = SAI_STEREOMODE;
      hsai_BlockB3.Init.CompandingMode = SAI_NOCOMPANDING;
      hsai_BlockB3.Init.TriState = SAI_OUTPUT_NOTRELEASED;
      hsai_BlockB3.Init.PdmInit.Activation = DISABLE;
      hsai_BlockB3.Init.PdmInit.MicPairsNbr = 1;
      hsai_BlockB3.Init.PdmInit.ClockEnable = SAI_PDM_CLOCK1_ENABLE;
      hsai_BlockB3.FrameInit.FrameLength = 256;
      hsai_BlockB3.FrameInit.ActiveFrameLength = 1;
      hsai_BlockB3.FrameInit.FSDefinition = SAI_FS_STARTFRAME;
      hsai_BlockB3.FrameInit.FSPolarity = SAI_FS_ACTIVE_LOW;
      hsai_BlockB3.FrameInit.FSOffset = SAI_FS_FIRSTBIT;
      hsai_BlockB3.SlotInit.FirstBitOffset = 0;
      hsai_BlockB3.SlotInit.SlotSize = SAI_SLOTSIZE_32B;
      hsai_BlockB3.SlotInit.SlotNumber = 8;
      hsai_BlockB3.SlotInit.SlotActive = SAI_SLOTACTIVE_0|SAI_SLOTACTIVE_1|SAI_SLOTACTIVE_2|SAI_SLOTACTIVE_3
    		  	  	  	  	  	  	  	  |SAI_SLOTACTIVE_4|SAI_SLOTACTIVE_5|SAI_SLOTACTIVE_6|SAI_SLOTACTIVE_7;

    Thank you all!