Skip to main content
yhak.1
Associate II
June 29, 2021
Question

Hi, I am using a STM32H7 microcontroller. I want to implement a waking up from sleep mode as a result of receiving a pulse that his width is bigger than a predefined value.

  • June 29, 2021
  • 4 replies
  • 1864 views

No other details.

This topic has been closed for replies.

4 replies

waclawek.jan
Super User
June 29, 2021

Run some low power clock (LPTIM, RTC). Wake up on the leading edge of pulse, store time to memory and go back to sleep. Wake up on the trailing edge of the pulse, from current and stored time determine the pulse width, if it's long enough, keep doing whatever you wanted to do after the wakeup, otherwise go back to sleep.

JW

yhak.1
yhak.1Author
Associate II
June 29, 2021

The problem is that if my line is noisy, the microcontroller will wake up a lot of unnecessary times.

TDK
June 29, 2021

There's no way to do this without waking up the CPU.

If you want to change hardware, you could implement an RC charging circuit and wake up when the threshold is passed.

Some timers have glitch filters which could be used, but only for a very limited selection of pulse values.

"If you feel a post has answered your question, please click ""Accept as Solution""."
yhak.1
yhak.1Author
Associate II
June 30, 2021
Hi, I got your suggestion, and I am trying to implement MCU COMP to detect a voltage threshold cross. The threshold should be any value. For that, I used "COMP_Interrupt" example while configuring the inverting input as "COMP_INPUT_MINUS_DAC1_CH1". I also configured DAC1 CH1 as same as presented in "DAC_SimpleConversion" example. However, I saw that despite the noninverted input (PB0) crosses inverted input (PA4), no comparator interrupt is created. The code is attached. Please rename the file extension from rar1 to rar. Could you kindly help me with it? Regards, Yair Hakak FW engineer, Pointer A PowerFleet(r) Brand www.pointer.com<> [O] +972 35723112 [M] +972 544992614
waclawek.jan
Super User
June 30, 2021

Are you sure analog peripherals such as DAC and comparator are available in sleep? Check in PWR chapter of RM.

It should be possible to upload zipped projects directly here, by clicking on the "paperclip" icon below the editor window.

JW

yhak.1
yhak.1Author
Associate II
June 30, 2021
Hi, [Are you sure analog peripherals such as DAC and comparator are available in sleep?] I think so, pleaes see the bellow quote from the reference manual: [cid:image002.png@01D76DBF.387BD660] [It should be possible to upload zipped projects directly here, by clicking on the "paperclip" icon below the editor window.] I do see any paperclip here. However, I tried to re-attach the project. I also can not enter "My support request" on your site. I got an error message. If you have some other option, it will be very helpful. However, do you have some other option for how my CPU could wake up from hibernation due to voltage change? Regards, Yair Hakak FW engineer, Pointer A PowerFleet(r) Brand www.pointer.com<> [O] +972 35723112 [M] +972 544992614