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.

TM4C129DNCPDT: TM4C129DNCPDT as frequency counter (12MHZ)

Part Number: TM4C129DNCPDT

We're trying to implement frequency counter by TM4C129DNCPDT, Can someone guide us is it possible use GPIO or CPP pin to measure external input 12MHz clock?  

  • "Can someone guide us is it possible use GPIO or CPP pin to measure external input 12MHz clock?  "

    yes.

  • It is expected that the use of a, "CPP pin" - just as you noted - should work best.

    Unstated is the "source" of this, "external, 12MHz clock." Usually best results flow from the shortest, most direct, signal introduction - and try to insure that (any other) HF signals do not run "near" (or especially in parallel) w/your external signal.

    The MCU manual describes various, "Timer Configurations" - it is my experience that your, "experimentation - and observation of results - with several - yields the maximum learning."   (I'm no fan of  rushed, "Cookbook" (let's get this post "Off the List") response.)      (Never to state/suggest  - that such - occurs here...)

    Update speed is likely to influence your, "Method of Attack" - you should note that a simple, Character-Type LCD/OLED, very well serves to Display your measurement's results.     And - if you are (both) "motivated & clever"  - may extend to an additional, "Frequency Channel" - and even,  "Several Channels of  Analog Voltage Measurement & Display" - as well.     (i.e. Makes the project/product - even MORE - desirable.)

    Your identification of - and insertion - of a, "Higher Speed Capable/Accepting" Frequency Dividing IC (placed between your "external frequency Source" - and the MCU's CPP pin) - will  extend the frequency range of your project  - and likely will make it  more robust...  

  • Another point dawns - best that rather than,  "Grafting it into the earlier post" - it stands alone - to better, "capture your attention."    (maybe)

    It is noted that,  "Many land here" - after,  "Crashing/Burning" - or when they have a specific,   "Interest du jour."    And - that may not always prove best - (both) for these posters - and for this forum.

    Now you are specifically seeking  guidance so that a,  "12MHz, external clock, may be measured."      And - while perfectly valid - would you not be "better served" - by developing a method which proves,  "Far Broader in its frequency measuring capabilities?"     In addition - what if the pursuit of such "broadening" - applies to your "Learning" - as well as - any (sought)  "frequency measuring capability?" 

    Does not the broader objective - register as (far) more valuable & appealing?      (while insuring the best possible outcome - for your 12MHz  (tightly restricted) measurement!)

    Follows the various clock/timer modes - for this vendor's (smaller, '123) MCU)   (should be highly similar to your device - in this "Timer" regard)

    It would appear that (either) "EDGE-based" Mode - best serves you.     But which - and when - and (even) WHY?

    Experience teaches that your solving for (only) this (rather restricted)  "12 and only 12MHz"  measurement - will NOT produce,  "Full Learning!"     Would it not prove advantageous - to instead - extend your (high "accuracy) measurement  to encompass:  0.1Hz to beyond 100MHz?    

    When might you switch from,  "One EDGE Method" - to the other?     And - can that "switching" be automated - so that the MCU performs the,  "Heavy Lifting?"

    Might it be that your request - for  "CCP vs. GPIO" - would benefit - if (somewhat) extended?

  • Hello Chih,

    To add to cb1's comments, you can also search E2E for other users who have tried to measure input signals via the CPP to see methods they used. As we don't have an example in TivaWare which does this, you will need to develop or re-use code from other community members. As you are coding if you have issues with the implementation please feel free to post to receive further guidance.
  • Indeed - just as vendor/friend Ralph notes - your,  "Search, Find & Review" of the (earlier)  "e2e revealed" efforts of others - often proves useful.

    Keep one thing in mind however -  the most powerful - and greatly aiding, "KISS" - is (in my opinion)   inadequately promoted here.     As a (predictable) result - most e2e users attempt their  "EDGE-Keyed" measurements via,  "ONE and ONLY ONE TIMER" - which while (maybe) possible - proves  FAR HARDER & TIME CONSUMING TO IMPLEMENT -  THAN THE  (VASTLY) SIMPLER USE OF "TWO TIMERS" - EACH "DIALED INTO" A SPECIFIC TASK!      And that   "simplification - and  speed-up" is clearly,   "KISS!"