Part Number: TMS320F2800137
Hi,
customer has question to our example code in sysctl.c:
do
{
//
// Keep clearing the counter until it is no longer saturated
//
while(HWREG(CLKCFG_BASE + SYSCTL_O_X1CNT) > 0x1FFU)
{
HWREG(CLKCFG_BASE + SYSCTL_O_X1CNT) |= SYSCTL_X1CNT_CLR;
}
//
// Wait for the X1 clock to saturate
//
while(HWREGH(CLKCFG_BASE + SYSCTL_O_X1CNT) != SYSCTL_X1CNT_X1CNT_M)
{
//
// If your application is stuck in this loop, please check if the
// input clock source is valid.
//
localCounter++;
if(localCounter>2500000)
{
if(loopCount == 3U)
status = false;
break;
}
}
if(loopCount == 3U &&
(HWREGH(CLKCFG_BASE + SYSCTL_O_X1CNT) == SYSCTL_X1CNT_X1CNT_M))
{
status = true;
}
//
// Increment the counter
//
loopCount++;
localCounter = 0U;
}while(loopCount < 4U);
Why was the value 0x1FFU be chosen for clearing the counter? Any special reason or can another value be used?
Regards, Holger
