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.

CCS/TMS570LS0432: Capture PWM function of HalCoGen

Part Number: TMS570LS0432
Other Parts Discussed in Thread: HALCOGEN

Tool/software: Code Composer Studio

Hello, TI Engineers

When I read the help document of HalCoGen, I found the capture function capGetSignal (hetRAMBASE_t *hetRAM, uint32 cap, hetSIGNAL_t *signal). However, I could not understand hetSIGNAL_t *signal. All examples about the function have ignored it. So I thought it means pwm signal. But CCS always displayed errors.

Thanks and regards!

Xinyu

  • Hi Xinyu,

    The hetSIGNAL_t means this:

    typedef struct hetSignal
    {
    uint32 duty; /**< Duty cycle in % of the period */
    float64 period; /**< Period in us */
    } hetSIGNAL_t;


    if you pass this type of variable reference to capGetSignal function, than it will fill with captured PWM signal's duty cycle and period.

    For example:

    hetSIGNAL_t signal_example;

    capGetSignal (hetREG1, 0 , &signal_example); // 0 means you will capture the PWM signal cap0 channel which you set in HALCOGEN.

    Kind regards,
    Norbert
  • Hello Xinyu,

    --------------------------------

    So I thought it means pwm signal. But CCS always displayed errors.

    -------------------------------

    Can you please show us the errors you got in CCS? The signal used in the function is just a structure which contains signal's period and duty cycle.

  • Hello, Wang

    I missed the '&' when I type the signal address. But I found '&' could be lost sometimes.

    Thanks for your help!

    Xinyu