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.

CODELOADER: About codeloader 4 command

Part Number: CODELOADER
Other Parts Discussed in Thread: LMK03318, TICSPRO-SW, , USB2ANY

Hi Ti,

    I am from China, we are preparing program  Device LMK03318,According to the official website, we purchased the USB2ANY Tool to program.

First we downloaded the codeloader 4 software , Successfully program EEPROM using GUI(program file :CVN_Clock_eeprom_0_2.epr),The problem we are having now is that we use another platform to call the burn through the command, However, the command description in the user manual does not describe how to program EEPROM. Can you give us a suggestion?How to use command to program eeprom?

  • Hello Seven,

    I recommend downloading and installing our latest EVM tool, TICS Pro (http://ti.com/tool/ticspro-sw). Once installed, you can make an ActiveX/COM connection to TICS Pro. For example using python:

    import win32com.client
    tp = win32com.client.Dispatch("TICSPro.ActiveX")

    Once the above is done. After you load the device, you can press buttons using the PressButton command. Provide the name as identified in the Context help (lower left) when you mouse over the button you'd like to press. For example:
    tp.PressButton("bPROGRAMEEPROM")

    73,
    Timothy

  • Hi Timothy,

          I downloaded the latest software based on the website you provided, but we can't successfully program it in eeprom using the software interface.

    But still in the codeloader 4 can be program normally,Can you solve this problem for me?

  • Hi Timothy,
    We don't know much about python.can you give me example for this devices program and read out. Or give us a user manual
  • Can you elaborate more on what you are trying to achieve? I understand you are wanting to automate the programming of the EEPROM. How does this fit into a larger flow? You are using some software? What is your platform?
    - Strange that TICS Pro didn't work to program the EEPROM for you.
    - Have you seen page 7 on automation in the codeloader documentation?

    Have you made a header on your custom board to connect the USB2ANY so you can program?

    Perhaps you can write these registers using your platform as described in section 10.5.5 of the datasheet, Write EEPROM.

    73,
    Timothy
  • Hi Timothy,

    We use TICS Pro software.

    Through the Python example you provided, we can operate various instructions, such as program, read, etc., but we still have 2 problems. First, when we execute "tp.PressButton ("bIMPORTEEPROMFILE")", Will pop up a window,but we can't do the image file that needs to be inserted, at the same time we insert the image file and save it as a tcs file, but we don't know how to use load tcs file. For this question, how can we insert the program file(.epr file)?can we provide an example to give me with paython?

    Second, we have an I2C interface that connects two ICs with different addresses at the same time (0X50 and 0X53), but the software can only recognize one IC address. For this problem, how to choose two IC addresses, when we program and read.can we provide an example to give me with paython?
  • Hello,

    It is possible to load a saved .tcs file by using...

    import os.path
    fullpath = r'c:\directory\file.tcs'
    if os.path.exists(fullpath) and os.path.isfile(fullpath):
    tp.RestoreSetup(fullpath)

    Note, you can always automate the sequence of register writes as per the datasheet.

    I'm not sure there is a way to automate i2c selection. I know that from the "USB communications" --> "Interface" it is possible to set the I2C address, but am not sure of an automated way off-hand. You should however be able to use tp.WriteAddressData(longAddress, longValue) to write to a specific address and then the data.

    73,
    Timothy
  • Thank you for your reply, we have successfully loaded tcs file and successfully sent I2C address, ask you a question, how to convert python syntax tp.WriteAddressData(7,0x53) into VBA syntax. Because we use python to open the Tics pro software, the default USB connection is not USB2ANY, but when we open the Tics Pro software with VBA, we can not connect to USB2ANY normally. Maybe Python initialization needs to call some files, we don't know。

    python :
    import win32com.client

    tp = win32com.client.Dispatch("TICSPro.ActiveX")
    tp.Initialize(r"C:\Program Files (x86)\Texas Instruments\TICS Pro")

    tp.SelectDevice ("LMK03318")

    fullpath = r'D:\Project_2018\SANM(IDA)\F894\BU3_F894\Flash\u78_u80_u82_u156\program_0x50.tcs'
    tp.RestoreSetup(fullpath)

    tp.WriteAddressData(7,0x53)

    tp.PressButton("bCOPYEEMAP")
    tp.PressButton("bPROGRAMEEPROM")
    tp.PressButton ("bREADBACKEEPROM")



    VBA:
    Sub main()

    Dim PLLobject As Object
    Set PLLobject = CreateObject("TICSPro.ActiveX")
    PLLobject.Initialize ("C:\Program Files (x86)\Texas Instruments\TICS Pro")
    PLLobject.SelectDevice ("LMK03318")

    fullpath = "D:\Project_2018\SANM(IDA)\F894\BU3_F894\Flash\u78_u80_u82_u156\program_0x50.tcs"
    PLLobject.RestoreSetup (fullpath)

    PLLobject.WriteAddressData ("7,&H53") '' ''The syntax is wrong

    ''PLLobject.PressButton ("bIMPORTEEPROMFILE")
    PLLobject.PressButton ("bCOPYEEMAP")
    PLLobject.PressButton ("bPROGRAMEEPROM")
    PLLobject.PressButton ("bREADBACKEEPROM")

    ''PLLobject.PressButton ("bEXPORTEEPROMFILE")


    MsgBox ("PLL Active X Exercise Finished")

    Set PLLobject = Nothing

    End Sub
  • This is a very urgent case, how to use tp.WriteAddressData(7,0x53) in VBA
  • You need the send each value individually. Not as a single string...
    tp.WriteAddressData(longAddress, longValue)

    and also address is first, so...
    So PLLobject.WriteAddressData(&H53, 7)

    73,
    Timothy
  • Hello Timothy,

        we use PLLobject.WriteAddressData(&H53, 7) in VBA ,show syntax error.Do you know how to write correctly?

        we use tp.WriteAddressData(0x53,7) in python ,The log displayed by the GUI is “Wrote Register R0x53 ad 0x5307” ,it is right? we find that from the "USB communications" --> "Interface"  the I2C address is not update ,Can I think that set address is unsuccessful?

        BTW,Why doesn't we automatically connect USB2ANY when we open the software in Python, but VBA can. Do you have any problems with my python code? .Please see attachment picture.

  • Hello,

    seven xiao said:
      we use tp.WriteAddressData(0x53,7) in python ,The log displayed by the GUI is “Wrote Register R0x53 ad 0x5307” ,it is right? we find that from the "USB communications" --> "Interface"  the I2C address is not update ,Can I think that set address is unsuccessful?

    I'm sorry the WriteAddressData, the address is for the register, not for the device.

    seven xiao said:
        we use PLLobject.WriteAddressData(&H53, 7) in VBA ,show syntax error.Do you know how to write correctly?

    I'll have to check on this.

    seven xiao said:
    BTW,Why doesn't we automatically connect USB2ANY when we open the software in Python, but VBA can. Do you have any problems with my python code? .Please see attachment picture.

    I think the reason for this is the TICS Pro that was started by VBA is not really closed and is still holding onto the USB2ANY connection.  TICS pro should not be closed by the "X" when automating.  Instead a call to, tp.CloseTICSPro() should be given.

    73,
    Timothy

  • Hello Timothy,

          Thank you for your answer.

          Then do you know how to modify the I2C address of the LMK03318 IC?Also help me to confirm how the VBA grammar is written?

  • Hello Seven,

    When you call PLLobject.WriteAddressData, I think you may need to cast to a long.
    PLLobject.WriteAddressData CLng(&H12), CLng(&H34)
    Which will write 0x34 to register 0x12.
    - If this does not work, you could try creating long varaibles, assigning their values, then calling the function with variable names instead of immediate values.... but if it works in python with 'immediate' values, I expect it would work in VBA also, but a debugging idea just in case.

    If you are asking how to change the I2C address the TICS Pro software writes to in an automated fashion, it currently doesn't support this. You would have to change and then press Set I2C address button in the communications setup.

    Note that GPIO1 can function as I2C slave address LSB select. The address is binary 10100xx where the two LSBs are set by GPIO1 pin in soft pin mode. Otherwise the LSB = 00. Refer to table 9 on page 53 of the datasheet.

    73,
    Timothy