SysTick not working for PSoC61 device

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Psoc_students
Level 1
Level 1
First like given First like received First solution authored

I am attempting to use Systick on PSoc61(CY8C6144AZI-S4F) because I want the value in milliseconds. However, the interrupt is not occurring in the interrupt function set with Cy_SysTick_SetCallback(0, systick_isr), and the value of 'tick' is not increasing.

The same code runs without issues when executed on the [CY8CPROTO-063-BLE] kit.

The procedure for creating a project in ModusToolbox is as follows:

  •  Turn on CLK_TIMER in Device Configure.
  • Add the following content to main.c

Can you guys please tell me, what can be the issue?

0 Likes
1 Solution
Psoc_students
Level 1
Level 1
First like given First like received First solution authored

Hello @ADSW ,

Thank you for  Advice.


Systick clock source is enabled.

And, Cy_SysTick_Init() include  Cy_SysTick_Enable() function.

 

But, I solve this problem.

I changed clock source.

CY_SYSTICK_CLOCK_SOURCE_CLK_TIMER → CY_SYSTICK_CLOCK_SOURCE_CLK_CPU

 

Thank you

Psoc students

View solution in original post

3 Replies
ADSW
Moderator
Moderator
Moderator
250 sign-ins 50 solutions authored 25 likes received

Hello @Psoc_students , 

Please ensure the clock source for SysTick is enabled.
After initialize the SysTick ( set the clock source and interval ),  set the callback then enable the SysTick by calling Cy_SysTick_Enable() function.

Warm regards
Andri

0 Likes
Psoc_students
Level 1
Level 1
First like given First like received First solution authored

Hello @ADSW ,

Thank you for  Advice.


Systick clock source is enabled.

And, Cy_SysTick_Init() include  Cy_SysTick_Enable() function.

 

But, I solve this problem.

I changed clock source.

CY_SYSTICK_CLOCK_SOURCE_CLK_TIMER → CY_SYSTICK_CLOCK_SOURCE_CLK_CPU

 

Thank you

Psoc students

ADSW
Moderator
Moderator
Moderator
250 sign-ins 50 solutions authored 25 likes received

Hello @Psoc_students ,

Thanks for your update. 

Actually, You can choose the source clock based on which clock is active ( enabled ); between them

ADSW_0-1703651435827.png

And set the interval based on the clock source value and desired time interval.

Then I will close this thread, 
Thanks & regards
Andri