0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

AVRマイコンでWDTを使って長期スリープ

Posted at

低消費電力で長期間スリープしたい

タイマーにクロックを供給すると消費電力が大きいので、WDTで復帰したい。

方法

WDTがタイムアウト時に、リセットではなく割り込みを起こす。
割り込みの中でソフトウェアカウンタを回し、期待する時間まで再度スリープする。

はまりどころ

WDTのタイムアウト時に、リセットフラグも同時に上がる。
割り込みの中か、直後にリセットフラグを落とさないと、システムがリセットされる。
つまり、長時間のスリープができない。

どうするか

割り込みの中でフラグを落とす。
RSTFLRをクリアする。また、WDTCSRを再設定する。

以上

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?