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: CMPSS Ramp generator:

Part Number: TMS320F280049C
Other Parts Discussed in Thread: C2000WARE

Hello,

I want to generate Ramp and need to use with CMPSS, But not able to verify if what I am configuring, whether it will generate correct ramp or not?

1) Are any examples available for Ramp configuration?

2) How to verify whether configuration giving correct ramp  or not?

Thanks,

  • Hi,

    There is an example in C2000Ware SDK. Please take a look at the example. They are located here:

    C:/ti/c2000/C2000Ware_4_02_00_00/driverlib/f28004x/examples/cmpss/CCS

    In the file header of .c file, it goes the required external connection and how to validate the functionality.

    Regards, Santosh

  • Hi Santosh, 

    I checked in this location, only examples related to CMPSS is given which also not integrating  Ramp with it.

    One more query How to sync ramp with any EPWM module?

    Regards,

  • Hello Jainam,

    Thank you for your patience.

    In the examples, you need to modify two functions CMPSS_configDAC() and CMPSS_configRamp() in your board.c files to use the ramp generator. Please use the following lines for your code.

    CMPSS_configDAC (myCMPSS0_BASE,( CMPSS_DACVAL_PWMSYNC| CMPSS_DACREF_VDDA | CMPSS_DACSRC_RAMP));

    Also, for configuring the function CMPSS_configRamp use the following explaination:

    Configures the comparator subsystem's ramp generator.

    //!

    //! \param base is the base address of the comparator module.

    //! \param maxRampVal is the ramp maximum reference value.

    //! \param decrementVal value is the ramp decrement value.

    //! \param delayVal is the ramp delay value.

    //! \param pwmSyncSrc is the number of the PWMSYNC source.

    //! \param useRampValShdw indicates if the max ramp shadow should be used.

    //!

    //! This function configures many of the main settings of the comparator

    //! subsystem's ramp generator. The \e maxRampVal parameter should be passed

    //! the ramp maximum reference value that will be loaded into the ramp

    //! generator. The \e decrementVal parameter should be passed the decrement

    //! value that will be subtracted from the ramp generator on each system clock

    //! cycle. The \e delayVal parameter should be passed the 13-bit number of

    //! system clock cycles the ramp generator should delay before beginning to

    //! decrement the ramp generator after a PWMSYNC signal is received.

    //!

    //! These three values may be be set individually using the

    //! CMPSS_setMaxRampValue(), CMPSS_setRampDecValue(), and

    //! CMPSS_setRampDelayValue() APIs.

    //!

    //! The number of the PWMSYNC signal to be used to reset the ramp generator

    //! should be specified by passing it into the \e pwmSyncSrc parameter. For

    //! instance, passing a 2 into \e pwmSyncSrc will select PWMSYNC2.

    //!

    //! To indicate whether the ramp generator should reset with the value from the

    //! ramp max reference value shadow register or with the latched ramp max

    //! reference value, use the \e useRampValShdw parameter. Passing it \b true

    //! will result in the latched value being bypassed. The ramp generator will be

    //! loaded right from the shadow register. A value of \b false will load the

    //! ramp generator from the latched value.

    //!

    //! \return None.

    //

    //*****************************************************************************

    extern void

    CMPSS_configRamp(uint32_t base, uint16_t maxRampVal, uint16_t decrementVal,

                     uint16_t delayVal, uint16_t pwmSyncSrc, bool useRampValShdw);

    Regards,

    Hadi