Tool/software: TI C/C++ Compiler
I am pretty new for TI and would like to find out how I can find out what is my clock frequency ?
Which API call is for it ?
Thanks
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.
Tool/software: TI C/C++ Compiler
I am pretty new for TI and would like to find out how I can find out what is my clock frequency ?
Which API call is for it ?
Thanks
I'm unsure if an API call exists - yet you can (always) set up one of the MCU's Timers to provide a 'Frequency Scaled Replica' of the System Clock - and output that. (staff suggests a 'Divide by 8' - which would produce an 'Easily Measured' 15MHz (should your system clock be set to MAX [120MHz] ) - and add no (disturbance) to your (assumed) external oscillator components.)
Note: Pay (very) special attention to the System Control Clock/Frequency Set Command. Getting that wrong will, 'Lock you Out' from the MCU! (there are many examples - be sure to search/find/comply!)
Hi Sergey,
Please reference any of the TivaWare examples under <TivaWare_Installation>/examples/boards/ek_tm4c1294xl/. Start with the hell/hell.c example and you will find the API as shown below to configure the system clock frequency and return the clock frequency to g_ui32SysClock which you can later use in your application.
// // Run from the PLL at 120 MHz. // g_ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), 120000000);
May we note, 'A dagger to the heart' of what was believed to be a highly advantaged & earlier arriving (first arriving) suggestion!
Nothing can compete w/a 'Direct & Real, Observable (and Measurable) Frequency Output' - which may (often) prove of value - on its own! (as it may serve as the precise frequency source for other board devices.)
Relying (only) upon (pardon) 'overly complex' software - which involves multiple, inter-related parameters for correctness - is not always judged as effective. Simply review the length, depth & extent of (both) of those (near endless) API Calls - and then note 'How Many here' have been forced to 'Call for Help!.'
Regulatory Agencies (properly) 'frown upon' such highly tasked, 'Software Only' approaches. And - what happens should (any) of your external oscillator components prove 'out of spec', or mislabeled, or 'drift' - or otherwise age and/or become 'inaccurate.' (I believe the software calls vendor suggested to be unable to detect such issues - and to (improperly) report, 'ALL is WELL!) When in fact - it is not!
Such weakness could have been (properly & convincingly) detected - via the far more robust & simpler hardware/abbreviated software method (which proves more direct & vastly simpler/shorter - exercising basic MCU Timer software API).
Pity that such 'multi-advantaged method' (was) dismissed/kicked to the curb...