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
  • Hi,

    The command to disable CRC is 0x10005C31. 0x10005C sets bit 0 to 0 while the rest is not changed. and 0x31 is the CRC8 code for 0x10005C. This means you still need to write 32-bits data for the disable command, and after that, you could use 24 bits data write/read.

    Best regards,

    Ian

  • can this be done right after calibration memory refresh ? or must it be done later, say after all required startup register setups ?

    also, slip-AD1-AD0 (0-1-0) must be in the 1st byte to disable, correct:

        testA_pTxData[0] = 0x50;//Address: 0x10, 010 1 0000

Reply Children
  • Hi,

    The slip bit must be the inverse of bit 22 (AD1). AD1 and AD0 are the address bit and must match the logic levels of the address pins on the IC. Disabling the CRC can be done anytime.

    Valerie

  • 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?

    Valerie

  • 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.

    Valerie

  • 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. 

    Valerie

  • 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)

    or

        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 ?

    Don

  • 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.

    Valerie