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: How do I connect a particular CMPSS module positive input to a particular GPIO pin

Part Number: TMS320F280049C

I am not sure how to connect the positive input of a CMPSS comparator to a particular GPIO pin.  I have read the manual and understand how the peripheral works.  But the connection of the positive input of the comparator to a particular GPIO pin is not still clear.

In the example cmpss_ex1_asynch.c, there was no code in the void initCMPSS(void) to do this.  This code is below

void initCMPSS(void)
{
//
// Enable CMPSS and configure the negative input signal to come from
// the DAC
//
CMPSS_enableModule(CMPSS1_BASE);
CMPSS_configHighComparator(CMPSS1_BASE, CMPSS_INSRC_DAC);

//
// Use VDDA as the reference for the DAC and set DAC value to midpoint for
// arbitrary reference.
//
CMPSS_configDAC(CMPSS1_BASE, CMPSS_DACREF_VDDA | CMPSS_DACVAL_SYSCLK |
CMPSS_DACSRC_SHDW);
CMPSS_setDACValueHigh(CMPSS1_BASE, 2048);

//
// Configure the output signals. Both CTRIPH and CTRIPOUTH will be fed by
// the asynchronous comparator output.
//
CMPSS_configOutputsHigh(CMPSS1_BASE, CMPSS_TRIP_ASYNC_COMP |
CMPSS_TRIPOUT_ASYNC_COMP);

//
// Setup the Output X-BAR to output CTRIPOUTH on OUTPUTXBAR3
//
XBAR_setOutputMuxConfig(XBAR_OUTPUT3, XBAR_OUT_MUX00_CMPSS1_CTRIPOUTH);
XBAR_enableOutputMux(XBAR_OUTPUT3, XBAR_MUX00);
}

Do I assume that the default values "0" which correspond to PIN 9 was used?  Or the configuration for this is located in another code section.

Is this the function that does the configuration 

ASysCtl_selectCMPHPMux ( ASysCtl_CMPHPMuxSelect select, uint32_t value )?

Thanks

  • Hi Abayomi,

    The CMPSS inputs are connected to the analog pins and not GPIOs. Please refer to the "Analog Pins and Internal Connections" table below from the TRM.

    For example if you look at A3 row in the above, you can see that it can connect to all inputs of CMPSS1.

    Is this the function that does the configuration 

    ASysCtl_selectCMPHPMux ( ASysCtl_CMPHPMuxSelect select, uint32_t value )?

    That is indeed the function you call to choose which analog pin the CMPSS input connects to per the table above. Let us know if this is not clear.