This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DAC3482EVM: Connect two DAC3482 EVMs with DLL - some follow up questions

Part Number: DAC3482EVM
Other Parts Discussed in Thread: DAC3482

I have connected two DAC3482 EVMs with the DLL (after changing the names of each FTDI chip).

In each device I'm reading and writing both the DAC chip and the CDC. 

A weird thing though happens - after reading DAC registers, the CDC registers change as well.

For example:

I'm writing 0x8040000 to address 0 in CDC. Reading it returns 0x8040000.

Now after reading address 0 in the DAC - reading address 0 in the CDC gives a different number. Reading a different address from the DAC results in reading a different value from address 0 of the CDC..

At least for first step what I'm trying to do is to simulate opening the EVM GUI and pressing Load Regs to load a saved file. So to do this I connect both EVMs and send all registers data (both DAC and CDC) one by one.

The result in terms of signal synthesis is not the same and the PLL won't lock if I do it like this. What is happening in the EVM GUI when pressing load DAC? maybe there is a procedure of which regs should be written and when?

Thanks

  • Hi Italy,

    Will you please check if your python script have the software issuing SDEN to both DAC and CDC at the same time? You will need to make sure the SDEN is addressing to one device at a time to avoid bus contention.

    -Kang

  • Do you mean to check it with scope? will I see both data going to DAC and to CDC?

    Isn't it determined by the pattern files? from what I see in my files - the DAC pattern file has line5 as SDEN and the CDC has line2 as SDEN - so they should not been issued at the same time, right?

    Here is the DAC pattern file:

    Write																																																			
    0	0	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	0
    1	0	0	0	A6	A6	A5	A5	A4	A4	A3	A3	A2	A2	A1	A1	A0	A0	D15	D15	D14	D14	D13	D13	D12	D12	D11	D11	D10	D10	D9	D9	D8	D8	D7	D7	D6	D6	D5	D5	D4	D4	D3	D3	D2	D2	D1	D1	D0	D0	0	0
    2	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
    3	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
    4	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
    5	1	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	1
    6	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
    7	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
    																																																			
    Read																																																			
    0	0	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	0
    1	0	1	1	A6	A6	A5	A5	A4	A4	A3	A3	A2	A2	A1	A1	A0	A0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
    2	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
    3	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
    4	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1	1
    5	1	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	1
    6	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	D15	D15	D14	D14	D13	D13	D12	D12	D11	D11	D10	D10	D9	D9	D8	D8	D7	D7	D6	D6	D5	D5	D4	D4	D3	D3	D2	D2	D1	D1	D0	D0	0	0
    7	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
    

    And here is the CDC pattern file:

    Write																																																																		
    0	0	0	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0
    1	0	0	A0	A0	A1	A1	A2	A2	A3	A3	D0	D0	D1	D1	D2	D2	D3	D3	D4	D4	D5	D5	D6	D6	D7	D7	D8	D8	D9	D9	D10	D10	D11	D11	D12	D12	D13	D13	D14	D14	D15	D15	D16	D16	D17	D17	D18	D18	D19	D19	D20	D20	D21	D21	D22	D22	D23	D23	D24	D24	D25	D25	D26	D26	D27	D27	0
    2	1	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	1
    3	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
    4	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
    5	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
    6	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
    7	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
    																																																			
    Read																																																																																																																																				
    0	0	0	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0	1	0
    1	0	0	0	0	1	1	1	1	1	1	A0	A0	A1	A1	A2	A2	A3	A3	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0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	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
    6	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
    7	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0

    And here is an example script with the problem:

    from ctypes import *
    import os
    
    # load DLL
    orig_cwd = os.getcwd()
    os.chdir(r'D:\dev\DAC348xEVM_SPI_Utilities\64-bit DLL\FTDI Pattern Generator')
    dll_file_name = r'FTDI_Pattern_Generator.dll'
    dll_path = os.path.join(os.getcwd(), dll_file_name)
    dll = CDLL(dll_path)
    
    # init variables
    evm_index = c_int(0)
    dac_index = c_int(0)
    cdc_index = c_int(1)
    dev_desc = 'DAC348xEVM'
    baud_rate = 230400
    dac_pattern_path = os.path.join(os.getcwd(), 'DAC348x.txt')
    cdc_pattern_path = os.path.join(os.getcwd(), 'CDCE62005.txt')
    read_data = c_ulong(0)
    
    # open port to first EVM
    error_status = dll.openUSBPort(dev_desc.encode(), baud_rate, byref(evm_index))
    print(error_status)
    print(evm_index.value)
    
    # init DAC
    error_status = dll.initializeDevice(dac_pattern_path.encode(), evm_index, byref(dac_index))
    print(error_status)
    print(dac_index.value)
    
    # init CDC
    error_status = dll.initializeDevice(cdc_pattern_path.encode(), evm_index, byref(cdc_index))
    print(error_status)
    print(cdc_index.value)
    
    # write 0x8040000 to reg0 in CDC
    error_status = dll.writeRegister(evm_index, cdc_index, c_ulong(0x0), c_ulong(0x8040000))
    print(error_status)
    
    # read reg 0 from CDC
    error_status = dll.readRegister(evm_index, cdc_index, c_ulong(0x0), byref(read_data))
    print(error_status)
    print(hex(read_data.value))
    # this prints 0x8040000 as desired
    
    # read reg 0 from DAC
    error_status = dll.readRegister(evm_index, dac_index, c_ulong(0x0), byref(read_data))
    print(error_status)
    print(hex(read_data.value))
    #! this prints DAC reg0 value - 0xD18E
    
    # read reg 0 from CDC again
    error_status = dll.readRegister(evm_index, cdc_index, c_ulong(0x0), byref(read_data))
    print(error_status)
    print(hex(read_data.value))
    #! this prints a different value from 0x8040000 (not always the same one)
    #! can be 0x14 or 0x18 sometimes
    
    # close USB connection
    error_status = dll.closeAllPorts()
    print(error_status)

    Thanks

    BTW, although I love Italy - my name is Itay w/o the l.. Slight smile

  • Hi Itay,

    sorry for mistype your name Slight smile

    Although SDENB are two separate lines between DAC and CDC, the SCLK and SDIO are the same

    See diagram above where the SCLK and SDIO are shared between the two devices. This means when you are writing to both DAC and CDC at the same time with two SENB triggered at the same time, both devices will be written. You will need in your software provision to trigger only one SDENB at a time between the CDC and DAC to prevent bus contention. 

  • Well - as you can see in the script, I'm using only the basic DLL read/write functions - so I have to provide the device index and it is different in every call, so I never issue a read together for both devices, only for DAC OR CDC..

    Any other idea what's wrong?

  • Hi Itay,

    I will ask our Soliton team to look into the code that you had posted. Please confirm if it is the latest that you have, and update the code if it needs to be updated.

    In parallel, will you be able to probe both SDENB signal on the DAC and CDC to confirm if only one SDENB is active at a time?

  • Thanks

    How do I probe the CDC SDENB signal? I don't see a connector I can connect to..

  • Hi Itay,

    you may probe R88

  • Yes, found it also in the PDFs..

    It will be hard to reach the back side the way it is mounted but I'll try..

    Is there no option to get the DLL source-code? or the LabView VI file of the EVM-GUI?

    As far as I understand it is just a rapper around ftdi DLL with the proper signals isn't it?

  • Hi,

    The EVM GUI did not use the DLL. It is a straight bit bang using Lab view driver. To make it universally compatible, we developed the .dll software.

    If you need the labview source code I can send to you offline. However, we cannot support it further and it is taken as-is.

  • This will be great.. and the lack of support is completely understood.

    If you can please send it to: itay.pelled@gmail.com (my work email will probably block the files).

    I'll also try probing CDC SDENB next week.

  • Hi Itay,

    please download from the following link for our source code. Please note that it is taken as is as we do not have support bandwidth to support the details of the GUI development.

    https://tidrive.ext.ti.com/u/-NeFsnhXhe_q14W2/acc155b9-0797-4bf4-9226-b4c58754ea24?l

  • Thank you very much

  • no problem. 

  • Hi Kang,

    While I'm digging into the LabView code - is there any update from Soliton group?

    Regarding the code I shared - I put here a simplified script without class wrapping with methods etc.

    I can confirm that I checked this script many times and the bad results always repeat (reading from DAC change the value of CDC regs and also vice-versa.

  • Itay,

    Please upload the latest code. We were waiting for you. Thanks. 

  • Hi, 

    The code I posted is the latest script version.

    No changes were made since..

    Thanks

  • Let me check in with the team and get back to you

  • Hi

    after digging into the Labview a little bit - could it be that line #2 in DAC pattern file should always be 1 and not 0? (and the same for line #5 in CDC)

  • I tried to change DAC pattern file as I suggested (no change to CDC yet) and it seems to solve the problem.

    Now reading regs from a device do not affect the other device Slight smile

  • good to hear Itay. Thanks for looking into this.