cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

Contributor II

Hello,

I downloaded the "CE210292_WDT_P4S_Example" for PSoC4S.

I can see to be used "CySysClkIloStartMeasurement()" and "CySysClkIloCompensate()".

There is the "CySysClkIloCompensate()" API that effectively compensating for the ILO inaccuracy and allowing a

more accurate WDT interrupt generation.

It doesn't say how much it will improve the accuracy in characteristics.

Q1: What is the percentage within?

Certainly there is no description of compensating when looking at the AC Electrical Characteristics.

pastedImage_0.png

Please see the code below

Q2: I think that "CySysPmDeepSleep" API is an example.

      So, it does not mean that ”CySysPmDeepSleep” API  is absolutely necessary between "CySysClkIloStopMeasurement" and "CySysClkIloStartMeasurement".

Is this correct?

        if(CYRET_SUCCESS == CySysClkIloCompensate(DESIRED_DELAY, &tempIloCounts))

        {

            iloMatchCounts = (uint32)tempIloCounts;

            /* Once the counts are ready - stop the ILO measurement and put the device to deepsleep */

            CySysClkIloStopMeasurement();

               

            if(CLEAR == interruptFlag)

            {

                /* Device will wakeup through WDT ISR */

                CySysPmDeepSleep();

            }   

            /* Start the ILO measurement after wake up */

               CySysClkIloStartMeasurement();

        }

Best regards,

Yocchi

0 Likes
Reply
1 Solution
Moderator
Moderator

Hello Yocchi-san,

>>"Q1: What is the percentage within?"

--> The default accuracy of LFCLK is +/- 60% without compensation.

--> After compensating using the Trim APIs the ILO can be compensated upto +/- 10% accuracy of the source clock with which it is being compensated. The source clock is IMO which itself is +/- 2% accurate. So the overal accuracy will be (+/-10% * +/-2% = +/- 2.2%).

>>"Q2: I think that "CySysPmDeepSleep" API is an example. So, it does not mean that ”CySysPmDeepSleep” API  is absolutely necessary between "CySysClkIloStopMeasurement" and "CySysClkIloStartMeasurement". Is this correct?"

--> Yes. Calling DeepSleep API is not necessary. It is just to put the CPU in deep sleep to reduce power consumption.

>>"And even if the accuracy of MatchValue increases, it is necessary to reset three times

unhandled interrupt, so I think that the time to reset is not compensated."

--> Yes. If you are not compensating the Match value by writing the new match value everytime using the API CySysWdtWriteMatch(CySysWdtReadMatch() + iloMatchCounts); there will not be any accuracy in the reset time.

Hope this helps !

Thanks

Ganesh

View solution in original post

0 Likes
Reply
3 Replies
Contributor II

Hello,

I observed "tempIloCounts" value under below condition.

There were two observations(obtained1 and obtained2).

pastedImage_2.png

#define DESIRED_DELAY           819200u

#define ILO_MATCH_COUNTS        (0x8000)  // 32768

CySysWdtSetIgnoreBits(1);

        if(CYRET_SUCCESS == CySysClkIloCompensate(DESIRED_DELAY, &tempIloCounts))

        {

            iloMatchCounts = (uint32)tempIloCounts;

            /* Once the counts are ready - stop the ILO measurement and put the device to deepsleep */

//            CySysClkIloStopMeasurement();

               

//            if(CLEAR == interruptFlag)

//            {

                /* Device will wakeup through WDT ISR */

//                CySysPmDeepSleep();

//            }   

            /* Start the ILO measurement after wake up */

//               CySysClkIloStartMeasurement();

        }

Best regards,

Yocchi

0 Likes
Reply
Contributor II

Hello,

Unfortunately, There were restrictions on "cystatus argument "uint32 desiredDelay" in "CySysClkIloCompensate(uint32 desiredDelay , uint32* compensatedCycles)".

In this condition, The limit is approximately below. No more overflows.

    - #define DESIRED_DELAY           675000u      // Limit value that causes overflow

    - #define ILO_MATCH_COUNTS        (27000)  // Limit value that causes overflow

 - CySysWdtSetIgnoreBits(1);

And even if the accuracy of MatchValue increases, it is necessary to reset three times

unhandled interrupt, so I think that the time to reset is not compensated.

pastedImage_3.png

What do you think?

Best regards,

Yocchi

0 Likes
Reply
Moderator
Moderator

Hello Yocchi-san,

>>"Q1: What is the percentage within?"

--> The default accuracy of LFCLK is +/- 60% without compensation.

--> After compensating using the Trim APIs the ILO can be compensated upto +/- 10% accuracy of the source clock with which it is being compensated. The source clock is IMO which itself is +/- 2% accurate. So the overal accuracy will be (+/-10% * +/-2% = +/- 2.2%).

>>"Q2: I think that "CySysPmDeepSleep" API is an example. So, it does not mean that ”CySysPmDeepSleep” API  is absolutely necessary between "CySysClkIloStopMeasurement" and "CySysClkIloStartMeasurement". Is this correct?"

--> Yes. Calling DeepSleep API is not necessary. It is just to put the CPU in deep sleep to reduce power consumption.

>>"And even if the accuracy of MatchValue increases, it is necessary to reset three times

unhandled interrupt, so I think that the time to reset is not compensated."

--> Yes. If you are not compensating the Match value by writing the new match value everytime using the API CySysWdtWriteMatch(CySysWdtReadMatch() + iloMatchCounts); there will not be any accuracy in the reset time.

Hope this helps !

Thanks

Ganesh

View solution in original post

0 Likes
Reply