|
本帖最后由 紫菁 于 2017-10-13 13:10 编辑 * L6 d! d6 _6 V6 b5 s
) {- B( H$ A7 j$ qPrequalification trials3 T" ~& z* o3 ~* W! h
Most of the common failures (unexpected reset and program counter corruption) can be reproduced by manually forcing a low state on the NRST pin or the Oscillator pins for 1 second.
3 B$ b/ Z: ]3 d2 D# o+ K9 C8 [* m0 M, ]
Datasheet 建議你重置試試,看 MCU 能不能重新跑起來,然後觀察會不會再度發生。
( Q: p! D) F/ F6 q1 \2 C" _4 u
4 Y# r* r) t+ `5 q2 i7 DTo complete these trials, ESD stress can be applied directly on the device, over the range of specification values. When unexpected behavior is detected, the software can be hardened to prevent unrecoverable errors occurring (see application note AN1015).
) D* G. M4 F) X9 L$ }' S/ O6 V7 r3 h7 [; E$ A
AN1015 教導你利用一些 Timer 和 WatchDog 等技巧,降低意外掛機的情況發生。
4 T3 s* O3 Y7 j" L3 E
9 ~' j& J& Y4 ]8 A1 M0 N& @6 m# x3.11.4 Independent watchdog (IWDG)
% |/ ~; [8 b6 b. XThe independent watchdog is based on an 8-bit prescaler and 12-bit downcounter with user-defined refresh window. It is clocked from an independent 40 kHz internal RC and as it operates independently from the main clock, it can operate in Stop and Standby modes. It can be used either as a watchdog to reset the device when a problem occurs, or as a free running timer for application timeout management. It is hardware or software configurable through the option bytes. The counter can be frozen in debug mode.; g% s% G5 I, n# `
2 c. z6 G3 k) P0 N- H看門狗(IWDG)使用 40KHz 獨立的時鐘源,較不容易受到其它因素的影響,可利用它來防止掛機,或是用來找出掛機的原因。# Y4 t; }5 \# C
; r4 g' y. S' u( q) B" G+ Y
) p2 W% a$ N' ?2 A# Y( ^+ \- j0 }
* P4 J) \5 ~4 p4 c1 Y& y5 n5 C6 B G5 L D3 B) c
1 G K7 @6 x. A% s, t! h
|
|