This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to remember the number of power switch

How to remember the number of power switch,
Note:the power is main power,if the power off time is too long,MCU was stop working. sod ,off time less then 400ms,and MCU have a big cap to save power.
question:
if on/off power switch 1 times MCU output 500Hz on/off power switch 2 times MCU output 1000Hz ....................................
anyone have a method?
thx you .

Parents
  • Another way to do it is to NOT power the MCU down at all, just the rest of the circuit. You can put the CPU to sleep, so power use is next to zero and just keep the timer block running. If you can access the mains, you can also count zero crossings to determine the time as well.

    yo vipy mate.

    this idea is great , which I/O pin can be use? can you suggest?
    i want MCU working mode: when switch is pwoer off,mcu into sleep mode,and timer start.when power switch on. mcu into normal mode ,dispose continuance time from power off to power on . it is OK? thx you.

Reply
  • Another way to do it is to NOT power the MCU down at all, just the rest of the circuit. You can put the CPU to sleep, so power use is next to zero and just keep the timer block running. If you can access the mains, you can also count zero crossings to determine the time as well.

    yo vipy mate.

    this idea is great , which I/O pin can be use? can you suggest?
    i want MCU working mode: when switch is pwoer off,mcu into sleep mode,and timer start.when power switch on. mcu into normal mode ,dispose continuance time from power off to power on . it is OK? thx you.

Children