## How to compensate PSOC4100S Plus ILO accuracy is +/- 10%？

Level 5
Level 5
Distributor - Arrow(GC)

Dear  Infineon：
due to  in some application we need to keep the ILO frequency , We note datesheet  describle that API can improve the ILO accuracy, We see the code of CE210292_WatchDogTimer, but we don't down how to do it ;

we design the code ,   we don't know where  is mistake of code , can you help to advice it . TKS;

uint32 iloMatchCounts=0x00;

#define WAKEUP_PERIOD_IN_MS 500u
#define DESIRED_DELAY 500000u
#define ILO_MATCH_COUNTS ((WAKEUP_PERIOD_IN_MS * CY_SYS_CLK_ILO_DESIRED_FREQ_HZ)/ 1000)

uint32 iloMatchCounts = ILO_MATCH_COUNTS;

//开始测量
CySysClkIloStartMeasurement();

//补偿ILO的值;
if(CYRET_SUCCESS == CySysClkIloCompensate(DESIRED_DELAY, &tempIloCounts))
{
iloMatchCounts = (uint32)tempIloCounts;
}

// 写值到WDT>>这个需要吗？

//读取WDTCount
CY_delay();

//算误差;
count0 = Count2-cunt1;

CySysClkIloStopMeasurement();

1 Solution

## Re: How to compensate PSOC4100S Plus ILO accuracy is +/- 10%？

Moderator
Moderator

CySysClkIloCompensate() 的校准原理是在 IMO精准时钟下开辟一个 1ms 的时间窗，然后在这 1ms 里对 ILO 进行计数测量，然后根据函数中的两个测试参数，

// 写值到WDT>>这个需要吗？

//读取WDTCount
CY_delay();

//算误差;
count0 = Count2-cunt1;

3 Replies

## Re: How to compensate PSOC4100S Plus ILO accuracy is +/- 10%？

Moderator
Moderator

CySysClkIloCompensate() 的校准原理是在 IMO精准时钟下开辟一个 1ms 的时间窗，然后在这 1ms 里对 ILO 进行计数测量，然后根据函数中的两个测试参数，

// 写值到WDT>>这个需要吗？

//读取WDTCount
CY_delay();

//算误差;
count0 = Count2-cunt1;

## Re: How to compensate PSOC4100S Plus ILO accuracy is +/- 10%？

Level 5
Level 5
Distributor - Arrow(GC)

HI   Infineon:

CySysClkIloCompensate(DESIRED_DELAY, &tempIloCounts));  该函数中的DESIRED_DELAY 中范围是有什么标准吗？ 只要uint32 的范围就可以吗？ 例子用的是#define DESIRED_DELAY 500000u

## Re: How to compensate PSOC4100S Plus ILO accuracy is +/- 10%？

Moderator
Moderator

/* WDT match value is updated in order to obtain periodic interrupts */