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.

TMS570LS3137: Capture Signal Read not Working Properly

Part Number: TMS570LS3137
Other Parts Discussed in Thread: HALCOGEN

Hi everyone,

Although I have made the necessary configurations from halcogen and CCS software, I cannot obtain stable data. When I generate PWM and read it with capture mode, the data I get is always correct, but it does not detect gnd and idle status.

I would be very happy if you could help with this.

Halcogen Config:

CCS Code Config:

/** PWM Duty and Frequency Setting Begin Code */
    hetSIGNAL_t Signal;
    Signal.duty = 50;
    Signal.period = 1000;
    pwmSetSignal(hetRAM1,pwm0,Signal);
    /** PWM Duty and Frequency Setting End Code */

    /** Capture Mode Read Begin Code */
    while(1)
    {
        capGetSignal(hetRAM1, cap0, &DataCap0);
        float PeriodValueCap0 = ceil(DataCap0.period);
        float DutyValueCap0 = DataCap0.duty;
    }
    /** Capture Mode Read End Code */
  • Hi,

    The instruction PCNT is used to capture PWM signal. The PCNT is not able to capture the signal without edge transition (falling edge or rising edge).

  • Hİ QJ Wang,
    Thanks for your answer. Capture mode is efficient when the system is stable. But it is also possible that there is a malfunction in the signal sensing PCB. What precautions can I take in case of an error in the system? (for system self-test)
    Best regards
  • Hi Eyup,

    If there is no no edge detected for long time, the PCNT counter gets overflowed (all 1’s in the counter value), then PCNT stops counting until the next reset
    edge is detected.

    I don't how to test the signal in system level.

  • I calculated the instantaneous logic state and period-task value of a signal using the capGetSignal() and gioGetBit() functions from the same pin. I made the capture value sensitive to the GND pin with a small software plugin. Since I haven't done static analysis yet, I don't know about Misra's suitability, but I wanted to share it.

    /** Capture Mode Read Begin Code */
    capGetSignal(pinmapCAP_PIN, &data);
    CapData.Counter++;
    CapData.PeriodISR = gioGetBit(hetPORT1, 14);
    if(CapData.PeriodISROld != CapData.PeriodISR)
    {
        CapData.Counter = 0;
    }
    CapData.PeriodISROld = CapData.PeriodISR;
    if(CapData.Counter > 1000)
    {
        CapData.PeriodState = 0;
        CapData.Counter--;
    }
    else
    {
        CapData.PeriodState = 1;
    }
    
    CapData.PeriodValue = CapData.PeriodState & data.period;
    /** Capture Mode Read End Code */

    Best regards,

    Eyup SAYIN