14.06.2015 Views

Power ISA™ Version 2.03 - Power.org

Power ISA™ Version 2.03 - Power.org

Power ISA™ Version 2.03 - Power.org

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Version</strong> <strong>2.03</strong><br />

Time-out. No exception recorded in TSR WIS .<br />

Set TSR ENW so next time-out will cause exception.<br />

TSR ENW,WIS =0b00<br />

(2) SW Loop<br />

TSR ENW,WIS =0b10<br />

(1) Watchdog<br />

Interrupt<br />

Handler<br />

(2) Watchdog<br />

Interrupt<br />

Handler<br />

(3) SW Loop<br />

Time-out. WDT exception recorded in TSR WIS<br />

WDT interrupt will occur if enabled by<br />

TCR WIE and MSR CE<br />

TSR ENW,WIS =0b01<br />

TSR ENW,WIS =0b11<br />

Time-out<br />

If TCR WRC ≠00 then RESET, including<br />

TSR WRS ← TCR WRC<br />

TCR WRC ← 0b00<br />

Time-out. Set TSR ENW<br />

so next time-out will<br />

cause reset<br />

Figure 23. Watchdog State Machine<br />

Enable<br />

Next WDT<br />

(TSR ENW )<br />

WDT Status<br />

(TSR WIS )<br />

Figure 24. Watchdog Timer Controls<br />

Action when timer interval expires<br />

0 0 Set Enable Next Watchdog Timer (TSR ENW =1).<br />

0 1 Set Enable Next Watchdog Timer (TSR ENW =1).<br />

1 0 Set Watchdog Timer interrupt status bit (TSR WIS =1).<br />

If Watchdog Timer interrupt is enabled (TCR WIE =1 and<br />

MSR CE =1), then interrupt.<br />

1 1 Cause Watchdog Timer reset action specified by<br />

TCR WRC . Reset will copy pre-reset TCR WRC into<br />

TSR WRS , then clear TCR WRC .<br />

The controls described in the above table imply three<br />

different modes of operation that a programmer might<br />

select for the Watchdog Timer. Each of these modes<br />

assumes that TCR WRC has been set to allow processor<br />

reset by the Watchdog facility:<br />

1. Always take the Watchdog Timer interrupt when<br />

pending, and never attempt to prevent its occurrence.<br />

In this mode, the Watchdog Timer interrupt<br />

caused by a first time-out is used to clear TSR WIS<br />

so a second time-out never occurs. TSR ENW is not<br />

cleared, thereby allowing the next time-out to<br />

cause another interrupt.<br />

2. Always take the Watchdog Timer interrupt when<br />

pending, but avoid when possible. In this mode a<br />

recurring code loop of reliable duration (or perhaps<br />

a periodic interrupt handler such as the Fixed-<br />

Interval Timer interrupt handler) is used to repeatedly<br />

clear TSR ENW such that a first time-out<br />

exception is avoided, and thus no Watchdog Timer<br />

interrupt occurs. Once TSR ENW has been cleared,<br />

software has between one and two full Watchdog<br />

periods before a Watchdog exception will be<br />

posted in TSR WIS . If this occurs before the software<br />

is able to clear TSR ENW again, a Watchdog<br />

Timer interrupt will occur. In this case, the Watchdog<br />

Timer interrupt handler will then clear both<br />

TSR ENW and TSR WIS , in order to (hopefully) avoid<br />

the next Watchdog Timer interrupt.<br />

Chapter 7. Timer Facilities<br />

581

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!