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.

RTOS/LAUNCHXL-CC1350: Comparator

Part Number: LAUNCHXL-CC1350
Other Parts Discussed in Thread: LMT01

Tool/software: TI-RTOS

I'm having trouble setting up the comparator to trigger an interrupt.

I have an LMT01 generating a pulse train into the analog pin 23 with a reference on pin 24.

Configuration/Setup:

//Enable clocks for peripherals in the AUX domain. ADC Digital and Analog interface (not currently enabled in driver).
AUXWUCClockEnable(AUX_WUC_MODCLKEN0_AUX_ADI4_M);

HapiSelectCompARef(COMPA_IN_AUXIO0); //AUXIO0 = DIO 23 as reference in COMPA
HapiSelectCompAInput(COMPA_IN_AUXIO1); //AUXIO1 = DIO 24 as Input in COMPA

//Setup COMPA
HWREGB(AUX_ADI4_BASE + ADI_4_AUX_O_COMP) = ADI_4_AUX_COMP_COMPA_EN;

HWREG(AUX_EVCTL_BASE + AUX_EVCTL_O_COMBEVTOMCUMASK) |= AUX_EVCTL_COMBEVTOMCUMASK_AUX_COMPA;

Power_setConstraint(PowerCC26XX_SB_DISALLOW);


How do i configure the output of the comparator to a DIO on the LAUNCHXL?

How do i configure the comparator to trigger and interrupt?

  • Hi,

    Make sure you have the inputs connected the right way:

    AUXIO0 = DIO30 and AUXIO1 = DIO29.

    DIO23 would be AUXIO7 and DIO24 is AUXIO6.

    Also enable interrupt due to Comparator A using the function:

    IntEnable(INT_AUX_COMPA); // INT_AUX_COMPA is interrupt vector 47.

    You will also need interrupt handler declared.