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.

reading pulse

Other Parts Discussed in Thread: ENERGIA

I know this might be lil stupid. well, after all I'm a beginner.

I want to read pulse in C, as in pulseIn in energia. How do I do that?

I'm using M430G2553.

THANX A BUNCH!

  • zolkepi,

    This is TI E2E community forum not energia's so find one and ask there.

     

    Regards,

    Dharmendra Sharma

    INDIA

    __________________________________
    Do, click "Verify Answer", if any of my replies helps solve your problem.

  • Then, let me rephrase my question. How can I read pulse using M430G2553?

  • The pulse has to be electrical or converted to electrical. You can use the ADC to measure its amplitude. You can also use the Timer to measure its width. (Both with limits.)

    Is that what you mean by read?

  • Zolkepli,

    First you have to convert the logic high voltage of input pulse to below or equal to the VCC. Otherwise, your input voltage to the pin is higher then  VCC, you can "fry" your controller that you are using.

    After doing this, Using TIMER as counter would be the best option.

    Good luck.

    Regards,

    Dharmendra Sharma

    INDIA

    __________________________________
    Do, click "Verify Answer", if any of my replies helps solve your problem.

     

  • If with “reading pulse” you mean “detecting the length of a pulse”, then there is no ready function available on MSPs. But it is quite simple. You connect the pulse signal (after limiting or amplifying it to the proper voltage level for high/low) to two timer capture inputs. You start the timer and capture the timer count at the rising and falling edge of the pulse (which is done by hardware). Then you calculate the count difference, and by the speed the timer was counting, you know the duration.

    If you just want to know when a pulse comes, this can be simply done by detecting the pulse edge with a port pin interrupt.

**Attention** This is a public forum