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.

TMS320F28379S: ASysCtl_selectCMPHPMux

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

I am porting an f280025 code to f28379. Do I need to use the ASysCtl_selectCMPHPMux() for ADC configuration. If yes, then what is the equivalent function.

//*****************************************************************************
//
//! Select the value for CMPLPMXSEL for F28379S. 
//!
//! \param select is of type ASysCtl_CMPLPMuxSelect.
//! \param value is 0, 1, 2, 3, or 4.
//!
//! This function is used to write a value to one mux select at a time.
//! The parameter \e select can be one of the following values:
//!
//! - \b ASYSCTL_CMPLPMUX_SELECT_1
//! - \b ASYSCTL_CMPLPMUX_SELECT_2
//! - \b ASYSCTL_CMPLPMUX_SELECT_3
//! - \b ASYSCTL_CMPLPMUX_SELECT_4
//!
//! \return None.
//
//*****************************************************************************
static inline void
ASysCtl_selectCMPLPMux(ASysCtl_CMPLPMuxSelect select, uint32_t value)
{
ASSERT(value <= 4);

EALLOW;

//
// Set the value for the appropriate Mux Select.
//
HWREG(ANALOGSUBSYS_BASE + ASYSCTL_O_CMPLPMXSEL) =
(HWREG(ANALOGSUBSYS_BASE + ASYSCTL_O_CMPLPMXSEL) &
~((uint32_t)ASYSCTL_CMPLPMXSEL_CMP1LPMXSEL_M << (uint32_t)select)) |
(value << (uint32_t)select);

EDIS;
}

  • Hello Jagbir,

    Can you please clarify what you mean by ADC configuration? If you're trying to configure a pin to use for the ADC, you can follow the examples that are provided in C2000Ware for the F2837xS ADC, as these provide the setup for different ADC uses.

    Best regards,

    Omer Amir

  • Hi Jagbir,

    If you are just asking about the ''ASysCtl_selectCMPHPMux()" function, it is not needed on the F28379D device.

    You'll notice that the F28002x device has an analog interconnect where the ADC channels are muxed with the CMPSS inputs (snippet from the 'Analog Subsystem Block Diagram' in the TRM) and are not directly tied to a CMPSS module:

    In which case the CMPSS signals go through a mux (snippet from the 'Analog Group Connections' in the TRM) to decide which signals route to what comparator and high or low side of that comparator:

    However, on the F28379D device, there is no mux selection. The CMPSS inputs are already set to be shared with certain ADC channels (snippet from the 'Analog Subsystem Block Diagram' in the TRM).

    I recommend looking at the SysConfig tool as this would make it easy to "switch" between devices while not having to worry about the code generation. Here is a video that explains migration: https://training.ti.com/c2000-sysconfig-migrate-c2000-devices-under-10-minutes 

    Best Regards,

    Marlyn