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.

Measuring frequency and generating PWM signals

Other Parts Discussed in Thread: TM4C123GH6PM

Hi,

I am using TM4C123GH6PM uC. I need to measure the frequency of given analog input. And I have to generate PWM signal(50Hz) for inverter(transistors). Can any one provide the steps to achieve that.

Andcan anyone post,  where is the pin and corresponding channel details are given?.

  • Andcan anyone post,  where is the pin and corresponding channel details are given?.

    That is in the datasheet. If you open it with PDF reader you should be able to see titles in the left side. Timers should be on 11 and it's what you need for it. For detail in which peripheral is connected to which pin check Table 10-2.

    I have this for a 50Hz PWM using the PWM module (not the Timers): http://forum.stellarisiti.com/topic/2059-tiva-pwm-module-tm4c1294ncpdt/?p=7447

    frequency measurement i don't have anything right now on the top of my head but i have this to measure pulse leght: http://forum.stellarisiti.com/topic/2004-pulse-legth-measure-srf04-example/

     

  • Hello M.Mary,

    While Luis's post will help you on the PWM signal, for measuring an Analog Input what type of Analog Signal are we speaking about. If it is a monotonic signal of 0-3.3V swing that you can use the Timer in Input Time Count mode to measure the periodicty.

    it is a non-monotonic signal, then it would require data processing. The simplest would be to use the Analog Comparator to decide a threshold, output the processed signal to the Digital out pin of the analog comparator and then use this as the input to the timer, in input time count mode.

    Regards

    Amit

  • Amit Ashara said:
    ...if a non-monotonic signal, then it would require data processing. The simplest would be to use the Analog Comparator to decide a threshold, output the processed signal to the Digital out pin of the analog comparator

    Might some signal, level shifting also prove helpful - should that signal prove, "non-monotonic?"  Here's the Analog Comparator spec from our 123AH device:

    Such suggests that transitions (too far) below GNDA may prove eventful for the MCU's health and/or the peripheral's behavior.  Thus - data processing - after the fact - is unlikely to insure MCU spec compliance...

    Instead - (external) signal level shifting (insuring monotonic input to the MCU) throughout the input signal's range - seems more sound...  Data processing may then proceed once the input signal is constrained w/in MCU's, "Input voltage range."  (both Min & Max)

  • Thank you. Moving forward.