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.

TMS320F280049: use comparator to measure frequency input

Part Number: TMS320F280049

Hello,

new to C2000,

if running out of pins, can I use comparator in PGA1_IN/CMP1_LP2 to measure frequency input (8KHz)?

if Yes, can provide the details internal connectivity required?

Thanks.

CK

  • CK,

    The comparator is not well suited for measuring frequency. It is primarily intended to generate a trip signal when a crossing of voltage thresholds is detected.

    You might be able to configure the CMPSS to generate trip signals to EPWM or GPIO, which can generate interrupts, which would require the CPU or CLA to capture the EPWM TBCTR or TIMER value for reference. Similarly the CLA could use a background task to continually poll the CMPSS status. Both of these approaches require a lot of overhead.

    The ECAP and EQEP modules would be better options if they are available.

    -Tommy
  • Hi Tommy,

    I read up more after posted the question.
    think the title is not correct, should be use PGA input pin to measure sensor frequency.

    the requirement is to measure the frequency of the sensor, around 8KHz,
    if running out of pins, left with PGA pin like PGA1_IN.

    notice that PGA1_IN pin can route to comparator CMP1_LP2,
    output CTRIP1L can connect to eCAP thru the X-bar,
    by selecting the eCAP input index 96~102.

    is my understanding correct?
    miss out anything?

    Thanks.
    CK
  • CK,

    Yes, you can use the CMPSS through its input MUX on PGA1_IN to extract digital high and low transitions from the sensor.  The ECAP can process the CMPSS output transitions by configuring its input selection MUX (which is different from the Input, Output, and ePWM X-BARs).

    -Tommy