Post Go back to editing

How to program AD5686R Evaluation Board SPI using arduino mega 2560?

Hello!

I am trying to program AD5686R Evaluation Board (EVAL-AD5686RSDZ) using arduino mega 2560. Does the SPI also needs to be in sports mode? How do i do that in arduino mega 2560? there are 4 SPI modes in arduino.

 

External V logic and external VDD connected to arduino 5V and AGND & DGND connected to GND of arduino

LDAC is set low(GND)

jumper setting LK1 -LK6

B, B, C, B, B, B respectively

 

1. does not reset when reset pin J5-7 pulled/pulsed low

2. DAC output cannot be controlled using SPI and stays at 1.25V or 2.5V for AD5686R & 0V for AD5686 on the board

3. reset pin voltage drop from 5V to 2.8V when connected to evaluation board

4. SYNC1 & SYNC2 voltage drop from 5V to 1.3V  when connected to evaluation board

5. SPICLOCK & DATAIN voltages also drops to about 1V from 5V

6. When LK3 is at posistion D. The Vref of AD5686 is 5V at(TP2) but external reference is not connected

 

My codes are as follows;

 

#include <SPI.h> // necessary library

#define DATAOUT 51//MOSI

#define DATAIN  50//MISO

#define SPICLOCK  52//sck

#define SYNC1 53//ss

#define SYNC2 49//ss2

 

void setup()

{

  pinMode(DATAOUT, OUTPUT);

  pinMode(DATAIN, INPUT);

  pinMode(SPICLOCK,OUTPUT);

  pinMode(SYNC1,OUTPUT);

  pinMode(SYNC2,OUTPUT);

  digitalWrite(SYNC1,HIGH); //disable device

  digitalWrite(SYNC2,HIGH); //disable device

  SPI.begin(); // wake up the SPI bus.

  SPI.setBitOrder(MSBFIRST); // sent MSB (most significant byte) first

  SPI.setDataMode(SPI_MODE0);

  SPI.setClockDivider(SPI_CLOCK_DIV4);

}

 

void loop()

{

  digitalWrite(SYNC1, LOW);//select device

  digitalWrite(SYNC2, LOW);//select device

  SPI.transfer(48); // send value (0~255)

  SPI.transfer(0); // DAC

  SPI.transfer(0); //

  digitalWrite(SYNC1, HIGH);//disable device

  digitalWrite(SYNC2, HIGH);//disable device

 

  delay(10000);              // wait for 10second

}

  • Hi, Darren.

    I will be moving this thread to the Precision DACs community.

    The SPI need not to be in SPORT mode. As for the SPI settings, our software uses CPOL = 0,  CPHA =1.

    I will do my best to try to answer your questions:

    1. does not reset when reset pin J5-7 pulled/pulsed low

    The /RESET bar has a minimum pulse width of 30ns to make it work. You can see this on Table 4 of the data sheet.

    Looking at your other questions, this might be a current issue. It may be that the Arduino couldn't drive enough current to the whole evaluation board.

     

    2. DAC output cannot be controlled using SPI and stays at 1.25V or 2.5V for AD5686R & 0V for AD5686 on the board

    This means that the commands that you are sending through the Arduino is not valid. The AD5686R contain a power-on reset cicuit that controls the output voltage during power-up.

    • By connecting the RSTSEL pin low, VOUT powers up to zeroscale.
    • By connecting the RSTSEL pin high, VOUT powers up to midscale.

    In the evaluation board, This is being controlled by LK5 which controls the RSTSEL pin. The most logical explanation is that when you are reading the outputs of the AD5686R, LK 5 is in A. when you are reading the AD5686 LK 5 is in B.


    3. reset pin voltage drop from 5V to 2.8V when connected to evaluation board

    4. SYNC1 & SYNC2 voltage drop from 5V to 1.3V  when connected to evaluation board

    5. SPICLOCK & DATAIN voltages also drops to about 1V from 5V

    This is most likely a current issue. The Arduino couldn't provide enough current to drive the digital lines and the other components in the evaluation board. Try using external power supplies.

     

    6. When LK3 is at posistion D. The Vref of AD5686 is 5V at(TP2) but external reference is not connected

    Would you be able to do a short circuit test on possible sources of the mysterious 5V? Please try the following:

    • between TP2 and U4's pin6 (ADR435's Voutpin)
    • between TP2 and VDD


    Have you checked the signals in an oscilloscope? Would you be able to provide some screen shots from the oscilloscope especially the digital lines?


    Regards,

    Mark

  • to add on.

    I have tried all 4 modes of SPI setting in arduino.

    Mode Clock Polarity (CPOL) Clock Phase (CPHA)
    SPI_MODE0 0 0
    SPI_MODE1 0 1
    SPI_MODE2 1 0
    SPI_MODE3 1 1

    Also external V logic and external VDD of EVAL-AD5686RSDZ have been connected to 5V external  power supply and they do not draw more than 10mA.

    Arduino is connected to external 9V power supply and to computer via USB for programming. Current drawn is about 0.5A from power supply which increased from 0.2A after SPI pins connected.

  • Hi, Darren.

    After trying to write to and update DAC n 0.49-0.52A but no change in DAC value althought the SPI bits are shown

    Which DAC are you referring to? I suppose you are referring to AD5686R.

    The boards should be connected first before supplying power to the boards. It is indicated in the user guide (UG-459) that in running the software, you should do the following:

    1. Connect the evaluation board to the SDP board and connected the USB cable between the SDP board and the PC.
    2. Power the SDP and evaluation board by connecting 6 V to the J3 connector.
    3. Click Start > All Programs > Analog Devices > AD56x(R). Each of the AD5686R, AD5686, AD5684R, and AD5684 has its own version of software. Click the appropriate one to run the software. As the software connects to the evaluation board, the message in Figure 2 displays.
    4. If the SDP board is not connected to the USB port when the software is launched, a connectivity error displays (see Figure 3 ). Simply connect the evaluation board to the USB port of the PC, wait a few seconds, click Rescan, and follow the instructions.

    I hope this solves the problem. Don't hesitate to post when you have further questions.

    Regards,

    Mark

  • Hello Mark, thank you for your reply.

    6. When LK3 is at posistion D. The Vref of AD5686 is 5V at(TP2) but external reference is not connected

    Would you be able to do a short circuit test on possible sources of the mysterious 5V? Please try the following:

    • between TP2 and U4's pin6 (ADR435's Voutpin)
    • between TP2 and VDD


    Do note that there is no chip at U4. Anyway I test all 8 pins including pin 6 and there is no short circuit to any of them when LK3 is at position D.

    No short circuit to internal VDD or external VDD too.

    Removed jumper at LK3(not connected to any also gets a 5V at TP2)


    I decided to purchased EVAL-SDP-CB1Z and connected to EVAL-AD5686RSDZ.

    jumper setting LK1 -LK6

    A, A, C, B, B, B respectively

    Current drawn when 6V connected 0.20-0.21A

    After connecting USB to SDP current increased to 0.35-0.37A

    After opening software AD5686R Evaluation Software v1.1 & sync connected 0.43-0.44A

    DAC output at start up 2.51V for AD5686R & 20-40mV for AD5686 on the board

    After trying to write to and update DAC n 0.49-0.52A but no change in DAC value althought the SPI bits are shown

    Trying again to write to and update DAC n gets a pop up;

    System Development platform wait

    Waiting for transfer to SDP....

    waited for a long time but does not disappear.


    For software AD5686R Evaluation Software v1.01

    once trying to program the pops up appears

    System Development platform wait

    Waiting for transfer to SDP....


  • After trying to write to and update DAC n 0.49-0.52A but no change in DAC value although the SPI bits are shown

    Which DAC are you referring to? I suppose you are referring to AD5686R. all at 2.5V

    All DAC of AD5686R.

    I followed the steps to connect in the datasheet and there were no problem with connection but I felt the current were high. Thus I broke them down to check current consumption.

    I just tried AD5686 jumper and I get the same problem of waiting for SDP

  • Hi, Darren.

    I understand your concern. I believe this is normal as the SDP Blackfin consumes around 300mA.

    If you have any further inquiries, please do not hesitate to ask.

    Regards,

    Mark

  • Hi Mark,

     

    Problem still not solved

     

    jumper setting LK1 -LK6

    A, A, C, B, B, B/A respectively


    1. DAC output at start up @

    2.51V for AD5686R

    20-40mV for AD5686


    2. 5V at TP2 even with jumper LK3 removed


    3. Unable to program using SDP due to

    System Development platform wait

    Waiting for transfer to SDP....

    which does not disappear


    I requested a return when i first got the board but they directed me here instead.

  • Hi, Darren.

    Have you made changes in the board (removing or adding or changing any parts)? If you did, could you state all of them? Could you also take a photo of both sides of the board?

    Regards,

    Mark

  • Hi Mark,


    No changes to the board &

    No parts removed or added.


    Photos


  • Hi Darren,

    I would like to do some diagnostics to the board. Please use 5.5V as your external supply and 3.3V as your external logic supply. Do not connect the SDP board.

    Please use this link options. LK1 to LK6 respectively: B,B,NC(no connection),B,B,B .

    Tell me what you observed specifically the values of the following:

    • TP2
    • All Vout of both DACs
    • Pin1 of U7
    • Pin1 of U5

    Regards,

    Mark