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.

pulse capture using TM4C123GH6PZ

Other Parts Discussed in Thread: TM4C123GH6PZ

Hi.I'm using the  TM4C123GH6PZ controller with 8MHZ external crystal frequency.I have set My system clock is 8MHZ.

i'm giving the pulses to PB4 (frequency range is 1K to 10K HZ).now in need to capture the pulse with in certain period of time..so i'm using the two timers for this application

 i'm using the timer0 for creating one second delay with an interrupt.when interrupt will generate then i'm going to count the pulse using timer 2 .Is this the correct way to do it like this???

please help me

thank sin advance.

  • Hi,

    Your problem/task is not well defined - you do not specify what you need to do with pulses when capturing them: either count the number of them whithin a defined time interval either measuring some parameters like period or duration.

    Depending on what you need to do, there is the possibility to need some extra hardware around the micro. 

    You need also to carefully read the user manual before writing any line of code. Try to analyze first your problem, you know better when the puses comes in, when you need to process them - at this stage nobody can tell you if your solution is good or bad.

    Petrei

  • Hi..I'm sorry..i need to count the number of pulses whithin a defined time interval.

     

     

    Best Regards

    Rashmi yc

  • Hi,

    Are you sure about that? Since you have a frequency range to deal with, this is going to be a little bit difficult; see the paragraph dealing with counting edges in Timer chapter of your user manual. Normally, you need a second register to be configured to allow some interrupts, but this cannot predicted, so you must use a single register to solve the problem - you know better what you need for. 

    Maybe a second taught/more analysis should be done.

    Petrei

  • ya i known that....So now i'm going use  the second  taught...i'l measure the period of incoming pulses.But i need some idea about how to measure the period of incoming pulses..

    Best Regards

    Rashmi.

  • Hi,

    This is of coarse much simple - use timing capture on a single edge, whatever is convenient to you, save the captured time in interrupt and go further. The last month was a good example posted here by the poster Otto Hunt - find that post ing and read it.

    Petrei

  • k Thank you..