Post Go back to editing

AD3542RFMCZ Is any other register require to initialize dac ? Is sequence need to change?

hii,

I am using class SPI mode of communication and single instruction mode. I am just writing the data not reading. fallowing is initialization sequence of dac AD3542R. 

INTERFACE_CONFIG_B_ADDR = x"01"

INTERFACE_STATUS_A:= x"11"

REFERENCE_CONFIG = x"15";

TRANSFER_REGISTER  = x"0F";

CH0_CH1_OUTPUT_RANGE= x"19"; e.g: data:00000001 To get output in 0 to 5 volt.

INTERFACE_CONFIG_C_ADDR = x"10";

CH0_DAC_16B (15 downto 8) = x"2A" e.g:DATA: FFFFFFFF
CH0_DAC_16B(7 downto 0) = x"29". DATA: FFFF0000

I went through: BBB & board eval-AD3542RFMCZ - Q&A - Precision DACs - EngineerZone (analog.com). still vout1 is not getting. how I check the Evaluation board is working/ power up properly.

Is any other register require to initialize dac ? Is sequence need to change?

  • Hi  ,

      will be helping you with this query. Thanks for your patience.

    Best Regards,

    Den

  • The only requirement to update the output is writing to the DAC register. The first write wakes up the DAC and updates the output. To write DAC register on channel 0, write 0x2A followed by 16 bits of data (MSB, then LSB). The DAC will not update if you write this register in two separate transactions.

    Before writing the DAC register, I suggest setting the Output Range register to make sure you obtain the desired voltage.

    Note that the SPI bus works in classic mode if QSPI pin is low and in Quad-SPI mode if this pin is high.

  • I am classic mode ( single instruction mode) 

    when 0 =>
    reg_data <= x"01"; 
    dac_out_value <= REFERENCE_CONFIG_ADDR & reg_data;  // ADDR =0X15

    when 1 =>
    reg_data <= x"00"; 
    dac_out_value <= TRANSFER_REGISTER_ADDR & reg_data;  //ADDR=0X0F


    when 2 =>
    reg_data <= x"10"; 
    dac_out_value <= INTERFACE_CONFIG_A_ADDR & reg_data; // ADDR= 0X11

    when 3 =>
    reg_data <= x"88"; 
    dac_out_value <= INTERFACE_CONFIG_B_ADDR & reg_data; //0X01

    when 5 =>
    reg_data <= x"00"; 
    dac_out_value <= CH0_CH1_OUTPUT_RANGE_ADDR & reg_data; // ADDR=0X19

    when 6 =>
    reg_data <= x"f0";
    dac_out_value <= CH0_DAC_16B_ADDR_1 & reg_data;  // ADDR= 0X2A

    when 7 =>
    reg_data <= x"f0";
    dac_out_value <=  CH0_DAC_16B_ADDR_1 & reg_data // ADDR =0X29 

    Right now i generate the internal vref of 2.5 means dac is started but still vout is not updated. According to data sheet for classic mode we have to send the 0X2A THAN MSB 8 BIT DATA(F0) AND THAN 0X29 THAN SEND LSB (F0) 8 BIT DATA

    I tried for stream mode: 

    when 0 =>
    reg_data <= x"01"; 
    dac_out_value <= REFERENCE_CONFIG_ADDR & reg_data;  // ADDR =0X15

    when 1 =>
    reg_data <= x"04"; 
    dac_out_value <= TRANSFER_REGISTER_ADDR & reg_data;  //ADDR=0X0F


    when 2 =>
    reg_data <= x"10"; 
    dac_out_value <= INTERFACE_CONFIG_A_ADDR & reg_data; // ADDR= 0X11

    when 3 =>
    reg_data <= x"08"; 
    dac_out_value <= INTERFACE_CONFIG_B_ADDR & reg_data; //0X01
    ;

    when 5 =>
    reg_data <= x"00"; 
    dac_out_value <= CH0_CH1_OUTPUT_RANGE_ADDR & reg_data; // ADDR=0X19

    when 6 =>
    reg_data <= x"f0";
    dac_out_value <= CH0_DAC_16B_ADDR_1 & reg_data;  // ADDR= 0X2A

    when 7 =>
    reg_data <= x"f0";
    dac_out_value <=  CH0_DAC_16B_ADDR_1 & reg_data // ADDR =0X2A

    i used same address for msb and lsb still vout is not getting, here also i get internal vref 2.45

    The DAC will not update if you write this register in two separate transactions ?  what exact i am missing while initialization 

    PLEASE REPLY AS SOON AS POSSIABLE

  • You cannot write the DAC register in two separate transactions with a single data byte.

    It must be a single transaction encompassing 3 bytes: Address - MSB - LSB

  • Hii,

    Thanks for help,

    I used fallowing reg:

    when 0 =>
    reg_data <= x"01"; --DATA
    dac_out_value <= REFERENCE_CONFIG_ADDR & reg_data & x"00";
    when 1 =>
    reg_data <= x"44";
    dac_out_value <= TRANSFER_REGISTER_ADDR & reg_data & x"00";
    when 2 =>
    reg_data <= x"10";
    dac_out_value <= INTERFACE_CONFIG_A_ADDR & reg_data & x"00";
    when 3 =>
    reg_data <= x"08";
    dac_out_value <= INTERFACE_CONFIG_B_ADDR & reg_data & x"00";
    when 4 =>
    reg_data <= x"02";
    dac_out_value <= STREAM_MODE_ADDR & reg_data & x"00";
    when 5 =>
    reg_data <= x"01";
    dac_out_value <= CH0_CH1_OUTPUT_RANGE_ADDR & reg_data & x"00;
    when 6 =>
    reg_data <= x"FF";
    dac_out_value <= CH0_DAC_16B_ADDR_1 & reg_data & x"F0";

     i get the output but it is not  the expected output. I expected output 4.99 for FFF0  but  i got the  1.56v On multimeter. on oscilloscope I am getting the AC waveform 

    when 0 =>
    reg_data <= x"01";
    dac_out_value <= REFERENCE_CONFIG_ADDR & reg_data & x"04"; // msb address 0x14 data 04
    when 1 =>
    reg_data <= x"44";
    dac_out_value <= TRANSFER_REGISTER_ADDR & reg_data & x"02"; // 0x0E LSB ADDRESS With data 02
    when 2 =>
    reg_data <= x"08";
    dac_out_value <= INTERFACE_CONFIG_B_ADDR & reg_data & x"10";// 0x00 LSB ADDRESS INTERFACE_CONFIG A DATA = 10
    when 3 =>
    reg_data <= x"01";
    dac_out_value <= CH0_CH1_OUTPUT_RANGE_ADDR & reg_data & x"00";// OX18 POWER DOWN MODE DATA=00
    when 4 =>
    reg_data <= x"FF";
    dac_out_value <= CH0_DAC_16B_ADDR_1 & reg_data & x"F0"; //3 BYTE MSB AND LSB

    got the output but it is not  the expected output. I expected output 4.99 for FFF0  but  i got the  1.56v On multimeter. on oscilloscope I am getting the AC waveform like pwm which is 5v. Is stream mode gives ac output not dc ?  or any other initialization  needed to get the correct output.

  • There should be no waveform if you wrote a single code. The oscilloscope must be set to 1 Mohm input impedance.

    It looks like you are trying to write 2 bytes in registers that are only 1 byte.

    Streaming mode does not imply that the DAC plays a waveform autonomously. This mode just allows sending multiple data words after the register address within the same transaction.

  • I am writing single code. I am just showing you the 2ways of writing/initialization dac. I used only one way.

    I initialize dac such as:

    when 0 =>
    reg_data <= x"01";
    dac_out_value <= REFERENCE_CONFIG_ADDR & reg_data & x"04"; // msb address 0x14 data 04
    when 1 =>
    reg_data <= x"44";
    dac_out_value <= TRANSFER_REGISTER_ADDR & reg_data & x"02"; // 0x0E LSB ADDRESS With data 02
    when 2 =>
    reg_data <= x"08";
    dac_out_value <= INTERFACE_CONFIG_B_ADDR & reg_data & x"10";// 0x00 LSB ADDRESS INTERFACE_CONFIG A DATA = 10
    when 3 =>
    reg_data <= x"01";
    dac_out_value <= CH0_CH1_OUTPUT_RANGE_ADDR & reg_data & x"00";// OX18 POWER DOWN MODE DATA=00
    when 4 =>
    reg_data <= x"FF";
    dac_out_value <= CH0_DAC_16B_ADDR_1 & reg_data & x"F0"; //3 BYTE MSB AND LSB

    I am getting output like this. Why Multimeter showing 1.56v (DC)?

  • It seems you are executing the program cyclically. The high value of the waveform is likely 0xFFF0 but the register is then written with 0 or the chip is reset.

    The multimeter reads the average value. Since the waveform is 1 square up, 2 squares down, the average value is 1/3*5 = 1.6V.

  • NO we are sending same data (FFF0) in cycle. instruction phase and data phase for ch0_data_16b is set to send in loop after configuring Initialization registers.

    dac_out_value <= CH0_DAC_16B_ADDR_1 & x"FF" & x"F0";                     //3 BYTE MSB AND LSB

    Also, what should be the excepted output when in Stream mode we are using is it ac or dc ?

    please tell me for single instruction mode also what should be expected output ?