Philips Semiconductors

 

 

 

 

 

 

 

 

User’s Manual - Preliminary -

WATCHDOG TIMER

 

 

 

 

 

P89LPC901/902/903

Watchdog

 

 

 

 

 

 

 

 

 

Oscillator

÷32

÷2

÷2

 

÷2

÷2

÷2

÷2

÷2

 

PCLK

 

 

 

 

 

 

 

 

 

 

 

÷32

÷64

÷128

÷256

÷512

÷1024

÷2048

 

÷4096

 

WDCLK after a

 

 

 

 

 

 

 

 

 

 

watchdog feed

 

 

 

 

 

 

 

 

 

 

sequence

 

 

 

 

 

 

 

 

TO

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

WATCHDOG

 

 

000

 

 

 

 

 

 

 

DOWN

 

 

 

 

 

 

 

 

 

COUNTER

 

 

001

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(after one

 

 

010

 

 

 

 

 

 

 

PRE2

 

 

 

 

 

 

 

 

prescaler

 

011

 

 

 

 

 

 

 

 

DECODE

 

 

 

 

 

 

 

count delay

PRE1

100

 

 

 

 

 

 

 

 

 

101

 

 

 

 

 

 

 

 

PRE0

 

110

 

 

 

 

 

 

 

 

 

111

 

 

 

 

 

 

 

 

Figure 12-1: Watchdog Prescaler

Feed Sequence

The watchdog timer control register and the 8-bit down counter (Figure 12-3) are not directly loaded by the user. The user writes to the WDCON and the WDL SFRs. At the end of a feed sequence, the values in the WDCON and WDL SFRs are loaded to the control register and the 8-bit down counter. Before the feed sequence, any new values written to these two SFRs will not take effect. To avoid a watchdog reset, the watchdog timer needs to be fed (via a special sequence of software action called the feed sequence) prior to reaching an underflow.

To feed the watchdog, two write instructions must be sequentially executed successfully. Between the two write instructions, SFR reads are allowed, but writes are not allowed. The instructions should move A5H to the WFEED1 register and then 5AH to the WFEED2 register. An incorrect feed sequence will cause an immediate watchdog reset. The program sequence to feed the watchdog timer is as follows:

CLR

EA

; disable interrupt

MOV

WFEED1,#0A5h

; do watchdog feed part 1

MOV

WFEED2,#05Ah

; do watchdog feed part 2

SETB

EA

; enable interrupt

This sequence assumes that the P89LPC901/902/903 interrupt system is enabled and there is a possibility of an interrupt request occuring during the feed sequence. If an interrupt was allowed to be serviced and the service routine contained any SFR writes, it would trigger a watchdog reset. If it is known that no interrupt could occur during the feed sequence, the instructions to disable and re-enable interrupts may be removed.

In watchdog mode (WDTE = 1), writing the WDCON register must be IMMEDIATELY followed by a feed sequence to load the WDL to the 8-bit down counter, and the WDCON to the shadow register. If writing to the WDCON register is not immediately followed by the feed sequence, a watchdog reset will occur.

For example: setting WDRUN = 1:

MOV

ACC,WDCON

; get WDCON

SETB

ACC.2

; set WD_RUN=1

MOV

WDL,#0FFh

; New count to be loaded to 8-bit down counter

CLR

EA

; disable interrupt

MOV

WDCON,ACC

; write back to WDCON (after the watchdog is enabled, a feed must occur

 

 

; immediately)

2003 Dec 8

84

Page 84
Image 84
Philips P89LPC901, P89LPC903, P89LPC902 user manual Feed Sequence

P89LPC903, P89LPC902, P89LPC901 specifications

The Philips P89LPC901, P89LPC902, and P89LPC903 are a series of 8-bit microcontrollers designed for embedded system applications. These models, which belong to the LPC900 series, are notable for their affordability and versatility, making them an attractive choice for both hobbyists and professional developers.

One of the core features of the P89LPC901, P89LPC902, and P89LPC903 microcontrollers is their powerful 8-bit architecture. Operating at clock speeds up to 20 MHz, they deliver efficient performance suited for a range of tasks. Each model includes a comprehensive instruction set that supports various data manipulation and arithmetic functions, enabling extensive programming capabilities.

These microcontrollers come with built-in memory, with configurations that vary among the three models. The P89LPC901 typically features 4 KB of Flash memory and 256 bytes of RAM, while the P89LPC902 and P89LPC903 offer enhanced memory options. This Flash memory allows for reprogrammability, making it easier to update and modify applications as needed.

Another significant characteristic of the LPC900 series is their integrated peripherals. These models are equipped with a variety of I/O ports, allowing for easy interfacing with other devices and components. The P89LPC901 supports up to 32 I/O pins, while the P89LPC902 and P89LPC903 provide additional features such as analog-to-digital converters (ADCs), timers, and serial communication interfaces. This broad range of peripherals empowers developers to design complex applications without needing extra hardware.

Power consumption is also a key consideration for microcontroller applications. The P89LPC901, P89LPC902, and P89LPC903 are designed with low power consumption in mind, making them ideal for battery-operated devices and energy-efficient projects. They can operate in various power modes, allowing for greater flexibility in deployment.

In terms of technology, these microcontrollers utilize advanced CMOS technology, ensuring high reliability and durability. Their design offers a robust solution for numerous applications, including consumer electronics, industrial controls, and automation systems.

In summary, the Philips P89LPC901, P89LPC902, and P89LPC903 microcontrollers present an attractive combination of performance, integrated peripherals, low power consumption, and versatility. Their features cater to a wide array of applications, keeping them relevant in a rapidly evolving technology landscape. For hobbyists and professionals alike, these microcontrollers represent a reliable foundation for embedded system development.