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

PSoC™ 6

Max_Li
Employee
5 questions asked First solution authored 10 sign-ins
Employee

In case some budys is going to use PSoC6 and FreeRTOS implement tickless idel, i would like to post my experience here.

I use creator 4.4 found  CE223508_PSoC6_BLE_MultiSlave_RTOS already implemented tickless idel. Key 2 points are:

defined #define configUSE_TICKLESS_IDLE 1 //in FreeRTOSConfig.h

implmented void vApplicationSleep(TickType_t ) in tickless_idle.c

 

Whith these implementation. when OS get into idel task, it set MCWDT's counterMatchValue according xExpectedIdleTime.

then put PSoC in deepsleep mode. waiting MCWDT's  interrupt. After exit from deepsleep, it Correct the RTOS Kernel's tick count to account for the time spent in the Deep Sleep mode

Use this CE223508, the default/maximum deepsleep time is (0xffff/32kHz) is about 2 second.

if you want a longer deepsleep time. you can modify the MCWDT.  I use cascade C0C1. get a 1kHz Counter1. (this is equal to current 1ms systick in OS)

Then modify the relate code in tickless_idle.c (attachment)  . As this we get a maximum deepsleep time 65 second.

MCWDT.png

1 Reply
Roy_Liu
Moderator
Moderator 500 solutions authored 5 questions asked First question asked
Moderator

Nice sharing🙂 thank you

Roy Liu
0 Likes
Top labels