Microchip® Advanced Software Framework

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages

This should be configured by the user.

Macros

#define CLASSB_TC_MOD   D1
 TC module selection. More...
 
#define CLASSB_TC_PRESCALER   64
 TC prescaler. More...
 
#define CLASSB_TC_TOLERANCE   25UL
 Tolerance for the CPU frequency deviation. More...
 
#define F_CPU   <value>
 The system frequency. More...
 

#define CLASSB_TC_MOD   D1

TC module selection.

This is the specifier of the TC module that should be used for the CPU frequency test, e.g., C0 -> TCC0.

#define CLASSB_TC_PRESCALER   64

TC prescaler.

The TC runs on the system clock scaled down by this parameter. Possible values are 1, 2, 4, 8, 64, 256 or 1024.

#define CLASSB_TC_TOLERANCE   25UL

Tolerance for the CPU frequency deviation.

This value defines the tolerance (an integer, %) for the deviation between the measured and expected CPU frequency, e.g., 25 -> 25%.

#define F_CPU   <value>

The system frequency.

MCU Clock Frequency (Hertz)

This is the expected frequency (Hz) of the CPU. This value has to be defined at the compiler level and it is only used to compute the TC count reference, i.e., not to set the system clock. Therefore, this value should be consistent with the system clock settings in the main application. However, this constant could be used to test the self-diagnostic routine, i.e., a wrong value could be set to check whether the failure is detected.

Note
The system runs from the internal 2Mhz RC oscillator by default.
Deprecated:
The F_CPU configuration constant is used for compatibility with the Busy-Wait Delay Routines routines. The common loop-based delay routines are designed to use the Clock Management modules while anticipating support for legacy applications assuming a statically defined clock frequency. Applications using a statically configured MCU clock frequency can define F_CPU (Hertz), in which case the common delay routines will use this value rather than calling sysclk_get_cpu_hz() to get the current MCU clock frequency.