3.1.2.1 DIAG_CLK_Frequency()

diag_result_t DIAG_CLK_Frequency (uint32_t clockFrequency, uint32_t referenceFrequency, uint8_t msec, uint8_t tolerance)

Calculates and validates the frequency of the CPU clock using a reference SOSC for the diag_clk_frequency.

Parameters:
in clockFrequency

- CPU system clock frequency value

in referenceFrequency

- Reference secondary oscillator frequency value

in msec

- Time in ms to run the test

in tolerance

- Limit for deviation frequency value

Returns:

DIAG_PASS - Success  

DIAG_FAIL - Failure  

DIAG_INVALID_ARG - Invalid  

DIAG_UNDEFINED - Undefined  

Note:

Maintain a test duration ranging from 10 ms to 30 ms to achieve an approximate accuracy of ±1%. The accuracy might fluctuate depending on the system clock and the time taken in milliseconds to execute the test. This procedure is incompatible with a reference frequency exceeding 2 MHz. For the purpose of this test, the reference frequency is configured at 32.768 kHz, facilitated by a crystal linked to the SOSC pins. In the absence of SOSC circuitry in the device, an external reference clock of 32.768 kHz needs to be supplied to the Timer1 Clock Input Point pin through T1CKIPPS.