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

    See the snippet below. 

    I hope this helps.

    Bríde

  • Many thanks for your help.

    As regards SPI Master mode configuration, the AD74413R works with SPI  mode 1 right ?

  • Hi,

    I have been trying to commnuicate with the AD74413R with an external SPI master but it cannot.

    I checked several issues on the forum to get more insights but I couldn't make it work.

    Is the AD74413R SPI  somehow special ? Do I need to apply some specific PIN configuration to my SPI master device ? 

    If you could please give me more insight on the proper SPI master configuration it would be really helpful.

  • Hi Jacopo, 

    Can you tell me which microcontroller you are using? 

    Do you have the ability to take a screen shot of the signals you are sending to the device? If so, could you send some screen shots on -  I might be able to spot something from that. 

    Have you been able to get the AD74413R GUI working with the device? 

    Are you happy that the device is powered up correctly? 

    Thanks,

    Bríde

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

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

    Thanks,

    Bríde

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

    Thanks,

    Bríde

Children