PSoC Creator 4.4 FreeRTOS Tickless idle deepsleep sample project

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.
Max_Li
Employee
Employee
10 questions asked 50 sign-ins 10 replies posted

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