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.

TM4C129XNCZAD: Measure the operating frequency of the micro controller

Part Number: TM4C129XNCZAD

Hi,

Custom board with TM4C129XNCZAD micro controller configured to work at 120 MHz

As a part of the test suite, we have to ensure that the TM4C129XNCZAD is operating at 120 MHz. Is there a way to measure the operating frequency of the microcontroller

TIA

Narendra

  • Hi Narendra,
    What you are looking for is a frequency counting mechanism. In another TI MCU family (TMS570) , there is a built in frequency counter module. However, this is not available in TM4C. The idea is to preload two different counters with each clocked by an independent clock source. For example, one counter is clocked by an OSC reference clock while the other counter is clocked by the PLL (the frequency to be measured). The two counters are compared to each other in a window to see if both of them have reached zero. The process can run continuously until an error is detected.
  • Hi,

    For your micro, pin A13 can outout a diveded operating frequency (DIVSCLK) - see your user manual, pg 2032.

    Another method is to configure a PWM and measure the output frequency. Take into account the PWM module has a separate clock divider.

  • Hi Petrei,
    Thanks for the suggestions. I was under the impression that the poster is looking for a built-in hardware solution. Perhaps to extend your suggestion the MCU can measure a fixed frequency input.
  • @Charles,

    Have been @ this forum since LMI days.     Never have I seen nor considered your suggestion of introducing - then measuring - the frequency of a "known," stable, source.    (one suspects that this can be up to - yet not exceed - MCU's system clock frequency - for best result)

    The (pehaps "not so obvious") beauty of Charles' method is that the MCU may make such measurement by itself - w/out the need for additional equipment (i.e. scope, frequency counter) - AND can even (continue) this test as part of the MCU's normal, Power-Up Sequence when operating alone - in the field...

    That stable, known frequency source may remain resident on the MCU pcb - or be external (cost saving) - and employed (only) during test/troubleshooting.

  • Hi cb1,
    If you have spare time and interested for more information, here is a link to an app note that describes such a module in the TMS570 MCU.

    www.ti.com/.../spna211.pdf

    The TMS570 family is designed with functional safety in mind. Various diagnostics including measuring the operating frequency are normally run at startup but can continue during runtime.
  • Well done, Charles - thank you for the link.
    Such "cross-pollination" (borrowing methods from more advanced devices) may enhance & extend the application of the Cortex M4...

  • cb1_mobile said:
    the MCU may make such measurement by itself

    Greetings cb1,

    I fail to figure out how can the MCU measure its own frequency... Do you mean without the need for any external reference? Or are you still considering the existence of an external known/trust clock source?

    Cheers

    Bruno

  • @ Bruno,

    As past post noted - indeed (either) the use of an external, known, solid frequency reference introduced during board check-out/commissioning OR via such known, solid frequency reference placed on-board - enabling the MCU to regularly check frequency.

    Several of our advanced systems employ multiple MCU boards - and we have one "dedicated, calibration board" which is able to send (via coax) "known, solid frequency output" to each of our MCU boards to insure their system clock is w/in spec.

  • cb1_mobile said:
    we have one "dedicated, calibration board"

    Way to go!

    On more thing to consider if I ever get to the point of building a multi-purpose test board...

    For the time being, most of our tests are done via self-test functions which are part of the fw. Of course, checking the MCU frequency is not one of the things we can do...

    Except for one of the products, which has a RTC IC in it, with a 32768 clock output connected to a TIMER input of the TM4C. Matter of fact, I actually created a frequency check - and my goal was to check the RTC integrity, not the other way around! I guess that, if the clock measured ever falls out of the expected range - never happened - the problem would not necessarily be on the RTC!

    A picture of the test page, just to add some color (monochrome) to the post. And the "precise" 32768Hz frequency shown!

    Bruno

  • We like your inclusion of "frequency test" - yet must note that 32KHz is (generally) "NOT" famed for (great) frequency accuracy. (and they are subject to drift w/temperature & aging)

    Device we employ includes a sealed, "mini-oven" which holds temperature constant - and generates a much higher, known, extremely stable & highly robust frequency output signal...

    Your result is quite good - yet if subjected to temperature extremes (or over time) those results are "sure" to degrade...

    So as NOT to present monochrome LCDs in a "less than flattering light" - two of our firm's high-contrast, wide viewing angle (R-G-B) mono LCDs (below) demonstrate that, "Mono CAN (still) be compelling!"