Post Go back to editing

disable CRC AD5758

How to disable CRC for SPI in AD5758 ?

The register available to disable CRC (register 0x10, DIGITAL_DIAG_CONFIG, bit 0 SPI_CRC_EN) requires a CRC to use it.

Parents Reply Children
  • This reply was deleted.
  • Hi,

    Wondering why you have 0x5B assigned to TxData here and not 0x86? 0x86 is the correct CRC. (testA_pTxData[3] = 0x5B; //0000 => 0x86;) , like wise for   testA_pTxData[3] = 0xA1; //00=> 0x6B;. 

    I would suggest disabling echo mode until you have the two stage readback working correctly. 

    I assume the AD1 pin on your board is tied to a logic high? e.g. > 3V?


  • With SPI...

    We can transmit to the AD5758 using interrupts working now, but no receive (with or without interrupts), any ideas ?

  • Hi,

    I can't see the image I don't have access, can you port a snippet here? The AD5758 will not respond if the SPI frame is invalid so either the CRC is incorrect (see my question above on the CRC) or the frame itself is not valid i.e. clock edges etc... Can you post a snippet here instead? Also a scope capture image of the SPI frame you are sending would be good.


  • For receive, I am only getting two sets of clock bytes, then receive stops, not 3 or 4 bytes as expected.

  • This reply was deleted.
  • Hi,

    Can you tell me what is what in the scope plot? I assume yellow = SDI, Blue = SCLK, which one is CD and SDO? The chip select needs to be pulled high for the data to be clocked into the AD5758. Also the clock edges are supplied by the master to the AD5758, so the 2 clock bytes you see are likely an issue in your code.

    For a two stage readback you need to first write what register you want to read to register 0x13 bits 4:0, then to get the data back from the 5758 (assuming the SPI frame you sent is valid) you need to bring CS low and clock in 24 bits (CRC not enabled) to clock out the data on SDO. This is the NOP command, SDI is all 0s. 


  • Legend for scope plots captured in earlier message...

    Yellow is SDO

    Blue is SCLK

    Green is SDI

    Pink is sync for DAC

    1. Transmit to DAC (from STM32F105 MPU) works since CRC gets disabled OK.

    2. Receive from DAC (slave) only shows 2 bytes, due to either:

        a. not enough dummy transmit bytes sent to get enough slave receive bytes (likely cause)


        b. missing 1st receive byte

    So, as soon as I send NOP, I receive only 2 bytes for receive, perhaps the NOP send needs more dummy transmit bytes (one more) to get the extra slave receive byte that was missing ?

    Your thoughts ?


  • Hi Don,

    In the first plot there is data on the yellow signal which you are saying is SDO? In this case you have data from the AD5758. SDO is the data from the 5758, SDI is the data in from the micro. Are these connections possibly mixed up? Also can you confirm you bringing the SYNC for DAC low before data transmission and high after?

    For the receive you are not receiving 2 bytes, you are receiving nothing. All I can see is two bytes of SCLK data being sent to the AD5758, the 5758 does not create the SCLK it merely sends the data out on SDO on the falling edge of SCLK, so I think your option 2 is correct.


  • The yellow is data from MPU to DAC (SPI signals are labelled per MPU side), I am now clocking all 3 receive from MPU to DAC bytes, but they are zeroes. See attached. Any ideas ? I am also getting a fault signal from DAC.

    with sync showing: