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.

UCD3138, Code Composer & Debugging

Other Parts Discussed in Thread: UCD3138OL64EVM-031, UCD3138

Hi,

I want to add PMBus functionality and it would be helpful to have Debugging Features like breakpoints.

I use an UCD3138OL64EVM-031 Rev. A board and an USB Interface Adapter. Uptil now I compiled my code with the Code Composer and load the Image on my board using the UCD3xxx Device GUI. With this Software I could observe variables and set variables and Registers.

Now I want a real developing Scenario. As I tried to start the program, the Code Composer told me, I have to create a target control file. I found lot of targets listed, but unfortunately, no UCD3138 or my board.

Is there any way to get this going?

Thanks for helping.

With best regards

Gerhard

  • If you want to use JTAG, the only emulator pod we currently support is the Spectrum Digital XDS510. We are working on supporting others, but they're not ready yet. Here is a post describing how to start it up:
    e2e.ti.com/.../434221
  • I've found that using a combination of the memory debugger and instrumenting code - mainly toggling unused I/O lines when a code event occurs - is superior to JTAG for debugging power supplies. Sometimes I miss single step and breakpoints, but they can be very dangerous for power supplies, especially PFC.
  • Hi Ian,
    you were right, and so I didn't power my power stage ....

    I found out, that the Memory degugger uses the PMBus. So if I can find out the exact command Format I can set my Parameters like I do with the Memory Debugger.

    I just sniffed in, but I didn't regocnize my values within the data packets at the first glance. Is there any documentation available?
    It is not PMBus specific, it is something TI does.

    With best regards

    Gerhard
  • For a small number of parameters, it's much better to write your own PMBus commands. To see a really simple example, look at the pmbus_write_user_ram_00 function. I think it's in all the EVM codes, and it may be in the training labs as well.

    You can use the same code as the memory debugger uses. It was actually designed for writing parameters. The problem is that it is designed for finished codes where the parameters are in fixed known locations. It's not as useful for code which is changing, because the parameters tend to move around.

    There are two commands - parm_info, and parm_value. Parm_info gives the memory block it's in, the offset within the block, whether the elements are bytes, half words, or full words, and how many of them there are. Parm_value provides the actual data, both in read and write. If you search on Parm in most TI projects, you'll find it, and it's reasonably documented in the code. The number of memory blocks has gotten bigger than the original because the UCD3138 peripherals moved apart, so lots of them have their own memory block. The list is there with the parm commands.
  • Hi Ian,

    ok, started out with great Motivation to follow your advise, but after some minutes:  No such function found.

    There were the files pmbus.c and pmbus:manuf_.. but no file contains a function with a Name likely you told me. I only locate some functions for reading Serial numbers and such Infos, but it isn#t that easy to see, how this functions were invoked.

    There is no function for writing Infos to the Controller, except the one I found and this functions were used from the GUI with the Problem of reading the map file to get out the Locations of the Parameters and the still unknown mechanism to use it.

    Looks like, that this will be a very hard work to reverse engineer the code without Debugger ......

    With best regards

    Gerhard

  • Hi Ian,

    after my PC in the lab brokes down, I am working again on that PMBus stuff.

    I found some PMBus master code and implemented it. I send a command for reading Information, here I use PMBUS_REVISION, 0x98. I get ACK back but no data. As I could not use a Debugger on the UCD3138 board I didn't know whats going on.

    Is there any issue with the PMBus and is there any simple alternative way to communicate with the UCD3138? I only have to be compatible to myself!!!

    With best regards

    Gerhard

    but no more info follows

  • Gerhard, which code are you using?  I'm surprised that that function isn't there, so far as I know, it's in all of our codes.  In any case, here it is:

    Uint8 pmbus_write_user_ram_00(void)

    {

    user_ram_00 = pmbus_buffer[1];

    return PMBUS_SUCCESS;

    }

    Uint8 pmbus_read_user_ram_00(void)

    {

    pmbus_buffer[0] = user_ram_00;

    pmbus_number_of_bytes = 1;

    return PMBUS_SUCCESS;

    }

    As you can see, it's very simple to read and write to a variable in the PMBus functions.  

    There are switch tables for read and write commands - here is the start of the write one:

    // look at command byte from a write perspective

    int32 pmbus_write_message(void)

    {

    switch (pmbus_buffer[0])

    {

    case PMBUS_CMD_MFR_SPECIFIC_02:

    return pmbus_write_light_load_config();

    The read one is similar.  To add another pmbus message, just write a function like the ones above, and add its call to the switch statement. 

    If you want to return more than 2 bytes, you need to put in a number of bytes in the first byte on a read.  This is to follow the PMBus block write spec. 

    The pmbus firmware puts the message into the pmbus buffer and calls pmbus_write_message.

    For a read, it puts the command in the first byte of the pmbus buffer and calls pmbus_read_message.  the read function puts the return data into the pmbus buffer, starting at the first byte and returns.  Look at the functions called by the switch statements to see the details.

    If you make your own PMBus messages that access the variables directly, then you don't need to do anything to deal with the changing addresses. 

    As far as testing pmbus commands, there is a screen in the device GUI called SMBus Debug.  It will let you send pretty much any individual PMBus message that you want to and tell you what it gets.  Not surprisingly, it's under the SMBus/I2C tab. 

    If you still want an in circuit emulator, you can buy a Spectrum Digital XDS 510 USB and use CCS 6.x.