Blackpill awakening

For general Flowcode discussion that does not belong in the other sections.
Post Reply
max.tisc
Posts: 152
http://meble-kuchenne.info.pl
Joined: Thu Dec 10, 2020 5:40 pm
Been thanked: 12 times

Flowcode v10 Blackpill awakening

Post by max.tisc »

Hi,
is it possible to wake up the Blackpill cyclically from a sleep mode condition, for example every 5 minutes with the internal RTC? or any other suggestions?
thank's

chipfryer27
Valued Contributor
Posts: 1882
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 410 times
Been thanked: 633 times

Re: Blackpill awakening

Post by chipfryer27 »

Hi

I haven't used the Blackpill but from p434 (17.3.4) of the datasheet it documents wake ups from uS to 36 Hours.

Regards

max.tisc
Posts: 152
Joined: Thu Dec 10, 2020 5:40 pm
Been thanked: 12 times

Re: Blackpill awakening

Post by max.tisc »

but using FC10 components?

chipfryer27
Valued Contributor
Posts: 1882
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 410 times
Been thanked: 633 times

Re: Blackpill awakening

Post by chipfryer27 »

Hi

I would have thought so as it would most likely be a C-Block to set the registers. Page 434 gives details of how to use. Never having used the ST before I can only guess that you would use C-Blocks to set registers and to make it "Sleep".

Regards

max.tisc
Posts: 152
Joined: Thu Dec 10, 2020 5:40 pm
Been thanked: 12 times

Re: Blackpill awakening

Post by max.tisc »

yes but I wanted to know if FC10 had something ready to use

LeighM
Valued Contributor
Posts: 530
Joined: Mon Dec 07, 2020 1:00 pm
Has thanked: 94 times
Been thanked: 287 times

Re: Blackpill awakening

Post by LeighM »

No, I don't think it does.
But after a super search, OK it was a bit of AI :roll: I found this ...

Code: Select all

// Example to enter Sleep Mode
HAL_SuspendTick(); // Stop SysTick to prevent immediate wakeup
HAL_PWR_EnterSLEEPMode(PWR_MAINREGULATOR_ON, PWR_SLEEPENTRY_WFI);
HAL_ResumeTick();  // Resume SysTick after waking up
and had a bit of a play, so here's an example using the user LED and user key to put it in and out of sleep ...
STM32F411BP_SLEEP_DEMO.fcfx
(9.94 KiB) Downloaded 4 times
edit: oops, this was created in V11, should load OK but with a warning?
I've not had chance yet to look at the RTC interrupt.

LeighM
Valued Contributor
Posts: 530
Joined: Mon Dec 07, 2020 1:00 pm
Has thanked: 94 times
Been thanked: 287 times

Re: Blackpill awakening

Post by LeighM »

As for waking up every 5 minutes, this should be possible with a timer interrupt.
Specifically with TIM2 and TIM5 that have 32 bit auto-reload counters.
However I'm struggling to discover how to change these from the 16 bit value limit, using parameters in the device FCD.
Matrix, is it possible to increase the Rollover Value to 32 bit?

max.tisc
Posts: 152
Joined: Thu Dec 10, 2020 5:40 pm
Been thanked: 12 times

Re: Blackpill awakening

Post by max.tisc »

ok thanks everyone for the suggestions, the TIMER1 and 5 issue is worth looking into in more detail for battery systems that require the greatest energy savings

Post Reply