AD74413R example of "spi_write_and_read" function body in AD74413.c file

Hi guys:

Can you help to provide the example of the "spi_write_and_read" function body in AD74413.c file, I can't find it in our website.

Parents Reply
  • I am using an Atmel ATXmega256A3BU.

    I am using an evaluation board made by Mikroe, the AD-SWIO 2 Click, so I cannot test it with the gui. 

    I checked the voltages across the AD74413R  on the board and they seem ok.

    What I see on the SPI lines is a clean signal on the SCK and on the MOSI but I don't see any input on the MISO of my master device. 

    It is like the AD74413R is not reacting to the frames I send to it.

    What I am doing is the init phase of the driver that is available on Analog documentation : I power up the device then I send a SW reset command sequence and I try to read back the value of the Status registers.

  • 0
    •  Analog Employees 
    on Sep 2, 2021 11:54 AM in reply to jacopo.soffritti

    Hi Jacopo, 

    I am not very familiar with the software environment or hardware for the MikroE product. Have you been in contact with the MikroE support team? Are you able to run the MikroE software on the board? 

    From a device point of view, this is the approach I suggest to verify that you are communicating correctly with the device:

    1. Power up the AD74413R 

    2. The Alert pin should be pulled low (~0V) on power-up - this is to indicate that the part has just exited from a power-on-reset sequence

    3. Write to the device to clear the ALERT_STATUS register: Write 0xFFFF to the ALERT status register (address 0x2E). The full 32-bit packet is: 0x 2E FF FF 4B. If this is successful the ALERT status register will be cleared and the ALERT pin should now measure a high voltage (IOVDD on your board). This would indicate correct communication (writes, at least) with the device.

    I am happy to help debug any AD74413R related issues. There is nothing unusual on the SPI of this part and you do not need a device ID. If the sequence above does not work for you, I'll need to see the scope shots, showing the SPI signals going to the device.

    I also suggest that you contact the MikroE support team to get the best support for the board that you are using.



  • Hi,

    many thanks for your insignts.

    I tries what you suggested but I couldn't make it work.

    I have purchased the EV-BOARD. When it arrives I will try it to see if I notice what I am missing.