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.

AM2612: AM261x comparators not triggering

Part Number: AM2612
Other Parts Discussed in Thread: SYSCONFIG

Hi,

I have a working example of comparators tripping on comparators eneabled in the provided example project in the sdk examples. However, I cannot get the rest of the comparator module to trip. I have tried externally routing both IN+ and IN-, as well as using the internal DAC to generate the trip zone. Both methods work on the comparators covered in the example, but as soon as I increase the number in SysConfig, the other CMPSSs don't work.

Can someone provide an example project that works with all of the comparators, so I can diff it against mine and look through it?

I have updated CCS and the MCU+ SDK to the latest versions.

Thank you for your help!

  • Hi Gary,

    We don't have a ready-made example project that exercises all CMPSS instances simultaneously. However, based on the AM261x CMPSS architecture, the most likely reasons your additional comparator instances aren't triggering relate to signal routing and XBAR configuration, not the comparator settings themselves.

    Key Configuration Requirements for Each CMPSS Instance

    When you add CMPSS instances beyond those in the SDK example, each one requires its own complete signal chain 1:

    1. PWM XBAR routing — Each CMPSS trip output (CTRIPH/CTRIPL) must be explicitly routed through the PWM XBAR to reach the ePWM Digital Compare submodule. Simply enabling the CMPSS module in SysConfig does not automatically connect its output to anything.

    2. Input source differences between CMPSSA and CMPSSB — CMPSSA instances allow external routing of both IN+ and IN−, while CMPSSB instances have fixed DAC connections (DAC_H to high comparator negative input, DAC_L to low comparator positive input). Verify you're configuring the correct input source for the instance type 1.

    3. ADC pin mapping — Each CMPSS instance maps to specific ADC input pins (ADC0_AIN0–5). Confirm the physical pin connections match the CMPSS instance you're enabling per the ADC-CMPSS signal connection table 1.

    Debugging Checklist

    Check What to verify
    PWM XBAR Is the trip signal from each new CMPSS instance routed to an XBAR output?
    Output XBAR / GPIO Can you observe the comparator output on a GPIO via Output XBAR to confirm it's actually tripping?
    Pin mux Are the correct ADC/comparator input pins muxed for the additional instances?
    DAC value Is the DAC reference appropriate for the signal range on that specific input?
    Digital filter Are filter/latch settings preventing the output from propagating?

    Recommended Approach

    Rather than diffing against a full example, isolate the problem:

    1. Configure one additional CMPSS instance (beyond the example's working ones).
    2. Route its CTRIPH output to a GPIO via Output XBAR — this bypasses ePWM entirely and confirms whether the comparator itself is tripping.
    3. If the GPIO toggles, the issue is in your PWM XBAR / ePWM Digital Compare configuration.
    4. If it doesn't toggle, the issue is in the comparator input source, pin mux, or DAC value.

    SysConfig is strongly recommended for this configuration to catch routing errors early 1.

    1. AM26x Academy - CMPSS Peripheral

    If you can share your existing example code, we would be glad to review it.

    Best Regards,

    Zackary Fleenor

  • We have been using Sysconfig. We are not able to configure the rest of the comparators despite setting up identically with the working sysconfig example resource explorer project.

    A more targeted question how to enable ADC1 path for CMPSSA2 as reported in the datasheet? 

    I am asking this on behalf of a colleague, he states that he has already went through this checklist to no avail (he has spent many hours on this)

    Best,
    Gray

  • Hi Gray,

    The ADC-to-CMPSS routing on the AM261x is hardware-fixed in silicon — there are no software multiplexer registers to configure. The connection exists automatically at the pin level 1.

    CMPSSA2 Has Dual Input Paths

    CMPSSA2 accepts inputs from two different physical pin sets simultaneously 2:

    Pin ADC Input CMPSS Input
    ADC0_AIN4 ADC0:inp2 (+IN2) CMPSSA2:inH (+IN)
    ADC0_AIN5 ADC0:inm2 (-IN2) CMPSSA2:inL (-IN)
    ADC1_AIN0 ADC1:inp0 (+IN0) CMPSSA2:inH (+IN)
    ADC1_AIN1 ADC1:inm0 (-IN0) CMPSSA2:inL (-IN)

    Both paths feed CMPSSA2 simultaneously. You simply drive the correct physical pin — either ADC0_AIN4/AIN5 or ADC1_AIN0/AIN1 — and the comparator sees it. No register configuration selects between them.

    Most Likely Root Cause: COMPHSOURCE Bit

    A resolved E2E thread with the exact same symptom (comparator ignoring external input, only responding to DAC value changes) identified the problem as COMPCTL bit 6 (COMPHSOURCE) being set to 1 1:

    • COMPHSOURCE = 1 → Internal DAC routes to comparator +IN, disconnecting the external ADC pin entirely
    • COMPHSOURCE = 0 → ADC pin routes to +IN, DAC routes to −IN (correct for threshold comparison)

    Fix: Set CMPSSA2_COMPCTL = 0x8000 (ASYNCHEN=1, COMPHSOURCE=0). Do not set bit 6.

    What to Verify

    1. Read back the COMPCTL register for each non-working CMPSS instance. Confirm bit 6 = 0.
    2. Physical pin connection — confirm your signal is on ADC0_AIN4 or ADC1_AIN0 (for CMPSSA2:inH).
    3. Unused −IN pin — if using single-ended mode with internal DAC, connect the unused inL pin (ADC0_AIN5 or ADC1_AIN1) directly to GND. Do not leave it floating 1.
    4. Quick validation — route CTRIPH to a GPIO via Output XBAR to confirm the comparator is actually tripping, independent of ePWM/trip zone configuration.

    SysConfig defaults COMPHSOURCE to 1 when adding new instances, which explains why the SDK example works but additional instances do not.

    Follow up: Can you read back the CMPSSA2_COMPCTL register value and confirm whether bit 6 (COMPHSOURCE) is 0 or 1 in your current configuration?


    1. AM2612: AM261x CMPSS pin selection – E2E Forum
    2. AM261x Datasheet (SPRSPA7C) – ADC-CMPSS Signal Connections

    Best Regards,

    Zackary Fleenor