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.

TMS320F280049C: C2000ware Motor Control SDK - Adapting to F280049C RSH Package -> Clock configuration issue

Part Number: TMS320F280049C
Other Parts Discussed in Thread: C2000WARE, LAUNCHXL-F280049C

Hello ,

for the C2000ware Motor Control SDK, I am adapting the Universal Lab for the F280049C RSH chip on our own board.
The xtal is connected to the X1 and X2 in Pins 38 and 39 with the recommended capacitors.

The system clock should run at 100 MHz and the low speed clock at 25 MHz like in the LaunchXL-F280049C demos.
I have adapted the calls to SysCtl_setClock and SysCtl_setLowSpeedClock in hal.c like this:

    SysCtl_setClock(SYSCTL_OSCSRC_XTAL |
                    SYSCTL_IMULT(10) |
                    SYSCTL_FMULT_NONE |
                    SYSCTL_SYSDIV(2) |
                    SYSCTL_PLL_ENABLE);


    // Make sure the LSPCLK divider is set to divide by 2
    SysCtl_setLowSpeedClock(SYSCTL_LSPCLK_PRESCALE_2); // 50MHz for SFRA, SPI&SCI

This is the same setting used in the LaunchXL-F280049C examples and there it works fine.

But here, checking the frequencies using SysCtl_getClock and SysCtl_getLowSpeedClock

    gDebug1 = SysCtl_getClock(DEVICE_OSCSRC_FREQ);

    gDebug2 = DEVICE_SYSCLK_FREQ;

    gDebug3 = SysCtl_getLowSpeedClock(DEVICE_OSCSRC_FREQ);

    gDebug4 = DEVICE_LSPCLK_FREQ;

 

results in:

If the DEBUG pre-define is set, this causes an error at the ASSERTS thereafter.

Any ideas what the issue could be?

Cheers,

John

  • You can refer to the peripheral configuration (hal.c) and memory assignment (.cmd) files for LaunchXL-F280049C in motor control SDK. And also, you need to use the right F28004x drivelib in this Universal Lab.

    C:\ti\c2000\C2000Ware_MotorControl_SDK_4_00_00_00\solutions\boostxl_drv8320rs\f28004x\drivers\source\hal.c

    C:\ti\c2000\C2000Ware_MotorControl_SDK_4_00_00_00\solutions\boostxl_drv8320rs\f28004x\cmd\f28004x_ram_cpu_is_eabi.cmd

    The issue is not only from the code your mentioned above. 

  • Hallo Yanming,

    yes, the hal.c came from the source you mentioned at:

    C:\ti\c2000\C2000Ware_MotorControl_SDK_4_00_00_00\solutions\boostxl_drv8320rs\f28004x\drivers\source\hal.c

    and has been adapted following the instructions in the Motor Control SDK Universal Project and Lab User's Guide.

    I will have a look at the .cmd file. To now I have been using f28004x_flash_lib_is_eabi.cmd because this is what comes with the Universal Motor Control lab.

    I am new to working with the TI structure on this level. I would like to change over to the f28004x_ram_cpu_is_eabi.cmd as you suggest, but am uncertain about what other changes in project, etc, are needed for this change. Is there an instruction showing how to do this, or can you give some pointers?

    Greetings,

    John

  • Attached file for your reference.https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/171/f28004x_5F00_flash_5F00_lib_5F00_is_5F00_eabi.cmd

    You may take a look at the link below to find more details about how to define .cmd file for memory map.

    [FAQ] Where can I find training content for C2000 devices?