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
Blackpill awakening
-
max.tisc
- Posts: 152
- http://meble-kuchenne.info.pl
- Joined: Thu Dec 10, 2020 5:40 pm
- Been thanked: 12 times
-
chipfryer27
- Valued Contributor
- Posts: 1882
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 410 times
- Been thanked: 633 times
Re: Blackpill awakening
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
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
-
chipfryer27
- Valued Contributor
- Posts: 1882
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 410 times
- Been thanked: 633 times
Re: Blackpill awakening
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
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
-
LeighM
- Valued Contributor
- Posts: 530
- Joined: Mon Dec 07, 2020 1:00 pm
- Has thanked: 94 times
- Been thanked: 287 times
Re: Blackpill awakening
No, I don't think it does.
But after a super search, OK it was a bit of AI
I found this ...
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 ...
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.
But after a super search, OK it was a bit of AI
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 upedit: 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
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?
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?
Re: Blackpill awakening
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