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: Correct usage of Transient Capture Module (TCM) in conjunction with SysConfig

Part Number: TMS320F280049C
Other Parts Discussed in Thread: SYSCONFIG, C2000WARE

Tool/software:

I am using a C28x MCU in conjunction with SysConfig (software release info in screenshot below).

In main() I have the usual call to C2000Ware_libraries_init().

In SysConfig I have added a TCM resource named 'transientCaptureModule1' as shown below along with an appropriately named buffer.

I have also added

DCL_runTCM(&transientCaptureModule1, dq0AbcInputsSupplementary.id.newestOutputPU);

to an interrupt handler that is processing the value that I want to capture.

I arm transientCaptureModule1 and it goes into TCM_armed mode. After creating conditions to trigger transientCaptureModule1 the mode changes to TCM_complete indicating that it has captured a stream of data. The only problem that I have is that there doesn't seem to be any captured data anywhere.

I do not see any code (either mine or from SysConfig) to associate the buffer allocated by SysConfig named transientCaptureModule1_arr with transientCaptureModule1.

SysConfig provides appropriate code for the allocation of transientCaptureModule1_arr in c2000ware_libraries.c and an extern reference in the c2000ware_libraries.h, but I never see where the buffer is associated with the TCM structure. 

SysConfig generates initialization code for the TCM module but doesn't reference transientCaptureModule1_arr nor any other array storage that I can see.  IIn addition, after compiling and linking without errors, The CCS Expressions pane says that the buffer doesn't exist when I try to view it and this is confirmed to be missing by the link map file that has no reference to it.  I am guessing that the buffer was discarded in the link because it was never used.

What am I missing? I have not found any example programs from TI that show how to use this module. The DCL User's Guide does not show any examples of how to use this module either. My guess is that SysConfig is not generating a complete set of initializations for this module although it definitely provides an init function and calls it.

Here is what the SysConfig generated code located in C2000Ware_libraries.c looks like:

//
// DCL TCM
//
//
// transientCaptureModule1 variables
//
TCM transientCaptureModule1 = TCM_DEFAULTS;
FDLOG transientCaptureModule1_fdlog = FDLOG_DEFAULTS;
float32_t transientCaptureModule1_arr[1000];
void transientCaptureModule1_init(){
//
// transientCaptureModule1 settings
//
DCL_initTCM(
&transientCaptureModule1,
transientCaptureModule1_fdlog.fptr,
1000,
100,
0.88,
1.01
);
DCL_armTCM(&transientCaptureModule1);
}
void TCM_init(){
transientCaptureModule1_init();
}

When I look at the TCM structure in CCS after a capture is complete, the pointers are all still initialized to all zeroes.  What am I missing?

Here is the expressions pane after the capture has been triggered:

If you have a good example program, please let me know as I have not found one.  The DCL reference manual goes into great detail on how the module works but does not provide an example of how to use it.  It also doesn't seem to be aware of SysConfig's ability to allocate one.

Thanks,

Don

  • Hi Don, my apologies for the late reply. Just got back from break.

    Yes you're correct that there's an oversight in TCM that FDLOG was never assoicated to the buffer (transientCaptureModule1_arr). I'll file a request to fix this issue for the next sysconfig release. Our examples are luckluster as well, while we do have a TCM example C2000Ware\libraries\control\DCL\c28\examples. It was an example that didn't use sysconfig to demonstrate the capabilities. 

    As such , can you please add a following line to your main routine, before running the TCM?

    DCL_initLog(&transientCaputreModule1_fdlog, transientCaputreModule1_arr, 1000);

    Note that the default linker in sysconfig didn't allocate enough memory for .bss section to fit transientCaptureModule1_arr. Therefore, please select more RAM sections, like RAMLS5,6,7.

      

    Please let me know if this resolves the issue and if you have any additional questions.

    Best,

    Sen Wang