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.

MSP430FR4133: Determining Edge Direction for the First Sample in Capture Mode

Part Number: MSP430FR4133

Hello,

I am looking at reading the PWM output of a sensor on the MSP430FR4133.  From what I can tell, the timer capture mode should allow me to do this.  However, I am concerned that if I use rising and falling edge detection, I may need to do a bit test on the port input pin to determine the high portion of the duty cycle.  Alternatively, I was thinking I could start with only rising edge detection and switch to both rising and falling edge detection after the first rising edge was detected.  However, I was wondering, is there already a dedicated register that clarifies whether the capture was triggered off a rising edge or a falling edge?

  • Hi Patrick,

    There isn't a register that indicates whether the capture was triggered off a rising edge or falling edge. The only way to know this would be the method you've described of reading the pin to determine whether it is hi/lo then setting the falling/rising edge detection accordingly.

    Are you trying to determine the frequency of the PWM signal or the duty cycle? If you're trying to determine the duty cycle, you'll need to capture every edge which requires changing between rising and falling edge detection every time a capture occurs. Otherwise, you can just use either rising or falling edge to track the period of the signal and determine it's frequency. Hope this helps an let me know if you have any further question.

    Best regards,
    Caleb Overbay

**Attention** This is a public forum