2021-06-29 01:20 AM
2021-06-29 01:23 AM
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
2021-06-29 01:34 AM
The problem is that if my line is noisy, the microcontroller will wake up a lot of unnecessary times.
2021-06-29 06:46 AM
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.
2021-06-30 03:11 AM
2021-06-30 04:15 AM
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
2021-06-30 05:11 AM
2021-06-30 07:13 AM
2021-07-01 01:42 AM