AM64x MCU+ SDK  10.00.00
DCC

The Dual Clock Comparator (DCC) is used to determine the accuracy of a clock signal during the time executaion of an application. The DCC measure the frequency of a selectable clock sources using another input clock as a reference. The clock sources as well as the accuracy are programmed by the application.

The DCC can also be configured to operate in single-shot or continuous mode. In single-shot mode, DCC performs a one-time countdown where DCC stops operation when the counters reach 0. A completion interrupt is raised and the status can be checked. In continuous mode, DCC reloads both counts with the seed value upon completion without error. In case of an error, an ESM error event is raised.

Features Supported

The DCC module provides the following functionality:

  • Ability to configure a DCC instance
  • Ability to verify the configuration of the DCC instance
  • Ability to enable a DCC instance
  • Ability to disable a DCC instance
  • Ability to query the status of a DCC instance including current configuration, error information, interrupt status, and counter values
  • Ability to clear the pending interrupt(s)
  • Ability to readback the DCC static registers

Errors detected by the DCC module during operation are reported via ESM error (application will receive via ESM application callback).

SysConfig Features

  • None

Features NOT Supported

  • None

Important Usage Guidelines

  • The Input Source clock mapping for each DCC instance can be found in the DCC section of the TRM

Example Usage

The following shows an example of SDL DCC API usage by the application.

Include the below file to access the APIs

#include <sdl/sdl_dcc.h>

Initialize the ESM to report DCC errors

SDL_ESM_config DCC_Test_esmInitConfig_MCU =
{
.esmErrorConfig = {0u, 3u}, /* Self test error config - not used in this test*/
.enableBitmap = {0x00000007u, 0x00000020u, 0x00000000u},
/* ^ ^ */
/* Main ESM MCU DCC0 event enabled */
.priorityBitmap = {0x0000003u, 0x00000020u, 0x00000000u},
.errorpinBitmap = {0x00000003u, 0x00000020u, 0x00000000u},
};
SDL_ECC_init(SDL_ESM_INST_MCU_ESM0, &DCC_Test_esmInitConfig_MCU, SDL_ESM_applicationCallbackFunction, NULL);

Configure MCU DCC Instance 0 seed values and clocks

SDL_DCC_Config configParams;
/* Select Input0 to be CLOCK0[2] */
/* Select Input1 to be CLKSRC2 */
/* Not shown:
* Determine the clock frequencies for the sources
* Figure out the seed values for successful completion
* Check DCC example code for reference
*/
/* Assign the seed values for the clock selections */
configParams->clk0Seed = clk0_seed_value;
configParams->clk1Seed = clk1_seed_value;
configParams->clk0ValidSeed = clk0_valid_seed_value;
retVal = SDL_DCC_configure(SDL_DCC_INST_MCU_DCC0, &configParams);
Configure MCU DCC Instance 0 for continuous mode
\code{.c}
/* Select continuous mode */

Or, configure the MCU DCC Instance 0 for single-shot mode.

/* Select continuous mode */
retVal = SDL_DCC_configure(SDL_DCC_INST_MCU_DCC0, &configParams);

If configuring single-shot mode, also register and enablei the done interrupt. In single-shot mode, the completion (Done) interrupt will happen at the end of the test if there are no errors. If error happens, then ESM interrupt will occur as well as the DCC error interrupt.

int32_t status = SystemP_SUCCESS;
HwiP_Params hwiPrms;
/* Register interrupt */
HwiP_Params_init(&hwiPrms);
hwiPrms.intNum = APP_DCC_INTR_NUM;
hwiPrms.callback = &SDL_DCCAppDoneIntrISR;
status = HwiP_construct(&gDCCHwiObject, &hwiPrms);
/* Enable the Done interrupt for DCC instance */

The done interrupt handler should clear the interrupt

static void SDL_DCCAppDoneIntrISR(void *arg)
{
}

Enable DCC Instance

API

APIs for SDL Dual Clock Comparator(DCC)

SDL_DCC_INTERRUPT_DONE
#define SDL_DCC_INTERRUPT_DONE
Definition: dcc/v0/sdl_dcc.h:173
SDL_ESM_config
ESM init configuration.
Definition: sdl_esm.h:179
SDL_DCC_configure
int32_t SDL_DCC_configure(SDL_DCC_Inst instance, const SDL_DCC_Config *pConfig)
This API is used to configure DCC module.
SDL_DCC_MODE_CONTINUOUS
#define SDL_DCC_MODE_CONTINUOUS
Definition: dcc/v0/sdl_dcc.h:108
SDL_DCC_Config::clk0Seed
uint32_t clk0Seed
Definition: dcc/v0/sdl_dcc.h:197
sdl_dcc.h
HwiP_Params
Parameters passed during HwiP_construct.
Definition: HwiP.h:74
SDL_DCC_enableIntr
int32_t SDL_DCC_enableIntr(SDL_DCC_Inst instance, SDL_DCC_IntrType intr)
This API is used to Enable the interrupts.
SDL_DCC_INST_MCU_DCC0
@ SDL_DCC_INST_MCU_DCC0
Definition: sdl_soc_dcc.h:82
SDL_DCC_enable
int32_t SDL_DCC_enable(SDL_DCC_Inst instance)
This API is used to enable the DCC module.
HwiP_construct
int32_t HwiP_construct(HwiP_Object *obj, HwiP_Params *params)
Create a Hwi object.
SDL_DCC_CLK0_SRC_CLOCK0_2
#define SDL_DCC_CLK0_SRC_CLOCK0_2
Definition: dcc/v0/sdl_dcc.h:126
SDL_DCC_MODE_SINGLE_SHOT_2
#define SDL_DCC_MODE_SINGLE_SHOT_2
Definition: dcc/v0/sdl_dcc.h:106
HwiP_Params_init
void HwiP_Params_init(HwiP_Params *params)
Set default values to HwiP_Params.
SDL_DCC_Config::clk1Seed
uint32_t clk1Seed
Definition: dcc/v0/sdl_dcc.h:201
SDL_DCC_clearIntr
int32_t SDL_DCC_clearIntr(SDL_DCC_Inst instance, SDL_DCC_IntrType intr)
This API is used to clear the interrupts.
SystemP_SUCCESS
#define SystemP_SUCCESS
Return status when the API execution was successful.
Definition: SystemP.h:56
SDL_DCC_Config
Structure containing parameters for DCC module configuration.
Definition: dcc/v0/sdl_dcc.h:184
SDL_DCC_Config::clk1Src
SDL_DCC_ClkSrc1 clk1Src
Definition: dcc/v0/sdl_dcc.h:193
HwiP_Params::callback
HwiP_FxnCallback callback
Definition: HwiP.h:77
SDL_ESM_config::esmErrorConfig
SDL_ESM_ErrorConfig_t esmErrorConfig
Definition: sdl_esm.h:180
SDL_DCC_CLK1_SRC_CLOCKSRC2
#define SDL_DCC_CLK1_SRC_CLOCKSRC2
Definition: dcc/v0/sdl_dcc.h:145
SDL_DCC_Config::mode
SDL_DCC_Mode mode
Definition: dcc/v0/sdl_dcc.h:185
HwiP_Params::intNum
uint32_t intNum
Definition: HwiP.h:76
SDL_DCC_Config::clk0ValidSeed
uint32_t clk0ValidSeed
Definition: dcc/v0/sdl_dcc.h:199
SDL_ECC_init
int32_t SDL_ECC_init(SDL_ECC_MemType eccMemType, const SDL_ECC_InitConfig_t *pECCInitConfig)
Initializes ECC module for ECC detection.
SDL_DCC_Config::clk0Src
SDL_DCC_ClkSrc0 clk0Src
Definition: dcc/v0/sdl_dcc.h:189