Window Watchdog (WWTD)¶
Function introduction¶
The clock for the window watchdog is derived from the APB clock (PCLK) through frequency division. If the software fails to “feed” the watchdog before the counter reaches the specified value, a reset or interrupt will be triggered. Additionally, the WWTD features a configurable window value: if the software attempts to feed the watchdog before the counter reaches the lower window limit or after it exceeds the upper window limit, an interrupt or reset will also occur. Therefore, the software must feed the watchdog within a specified time window.
The main features of the window watchdog are:
- Clock sourced from divided PCLK
- Supports window-based servicing
- Supports both normal mode and pre-warning alarm mode
- In normal mode, incorrect feeding timing, counter overflow, or invalid feed value immediately triggers a reset
- In pre-warning alarm mode, the first upper limit violation triggers an interrupt, the second triggers a reset; feeding at the wrong time or with an invalid value before the lower limit also triggers a reset
- Lock register to prevent accidental register operations
Register Mapping¶
The base address of WWTD register mapping is 0x40010000, and the specific register mapping is shown in Table W-1.
| Offset | Name | Bit Width | Type | Reset Value | Description |
|---|---|---|---|---|---|
| 0x00 | WDT_CTR | 32 | R/W | 0x00000000 | Control register |
| 0x04 | WDT_SCALE | 32 | R/W | 0x00000001 | Frequency division register |
| 0x08 | WDT_SRV | 32 | WO | - | Dog feeding value register |
| 0x0C | WDT_WLB | 32 | R/W | 0x00000000 | Window lower bound register |
| 0x10 | WDT_WUB | 32 | R/W | 0xFFFFFFFF | Window upper bound register |
| 0x14 | WDT_LOCK | 32 | R/W | 0x00000000 | Unlock command register |
| 0x18 | WDT_COUNT | 32 | RO | 0x00000000 | Count value register |
| 0x1C | WDT_STATUS | 32 | RO | 0x00000000 | Status register |
Control Register (WDT_CTR)¶
Offset: 0x00
Reset value: 0x00000000
| Bit Field | Name | Reset Value | Type | Description |
|---|---|---|---|---|
| 31:7 | Reserved | 0x00000000 | R/W | Reserved |
| 6 | INT_EN | 0 | R/W | Interrupt generation enable: 0: Disable 1: Enable |
| 5 | RST_EN | 0 | R/W | Reset generation enable: 0: Disable 1: Enable |
| 4 | WIND_EN | 0 | R/W | Window function switch: 0: feed the dog within the upper limit 1: feed the dog within the window |
| 3 | HALT_EN | 0 | R/W | Reserved |
| 2 | MODE | 0 | R/W | Working mode: 0: Normal mode 1: pre warning alarm mode |
| 1 | CLK_SEL | 0 | R/W | Clock selection: 0: clock after PCLK frequency division 1: external input clock |
| 0 | GLB_ENB | 0 | R/W | WWTD enable: 0: disable 1: enable |
Frequency Division Register (WDT_SCALE)¶
Offset: 0x04
Reset value: 0x00000001
| Bit Field | Name | Reset Value | Type | Description |
|---|---|---|---|---|
| 31:16 | Reserved | 0x0000 | R/W | Reserved |
| 15:0 | WDT_SCALE | 0x0001 | R/W | Frequency division register. When the clock after PCLK frequency division is selected as the timing reference clock, this register is used as the frequency division coefficient of PCLK. No frequency division when configured as 0 or 1 |
Dog Feeding Value Register (WDT_SRV)¶
Offset: 0x08
Reset value:-
| Bit Field | Name | Reset Value | Type | Description |
|---|---|---|---|---|
| 31:0 | WDT_SRV | - | WO | Dog feeding value register: Writing 0xABADC0DE to this register in the window means dog feeding. Writing other values will generate a reset request. If the interrupt request has been generated, writing 0xABADC0DE will clear the interrupt request |
Window Lower Bound Register (WDT_WLB)¶
Offset: 0x0C
Reset value: 0x00000000
| Bit Field | Name | Reset Value | Type | Description |
|---|---|---|---|---|
| 31:0 | WDT_WLB | 0x00000000 | R/W | Window lower bound register |
Window Upper Bound Register (WDT_WUB)¶
Offset: 0x10
Reset value: 0xFFFFFFFF
| Bit Field | Name | Reset Value | Type | Description |
|---|---|---|---|---|
| 31:0 | WDT_WUB | 0xFFFFFFFF | R/W | Window upper bound register |
Unlock Command Register (WDT_LOCK)¶
Offset: 0x14
Reset value: 0x00000000
| Bit Field | Name | Reset Value | Type | Description |
|---|---|---|---|---|
| 31:0 | WDT_LOCK | 0x00000000 | R/W | Unlock command register: Write 0x51ACCE55 to this register to write all the other registers related to the module, otherwise you cannot write all the other registers When reading this register: 0x00000000: cannot write all other registers 0x00000001: can write all other registers |
Count Value Register (WDT_COUNT)¶
Offset: 0x18
Reset value: 0x00000000
| Bit Field | Name | Reset Value | Type | Description |
|---|---|---|---|---|
| 31:0 | WDT_COUNT | 0x00000000 | RO | Count value register |
Status Register (WDT_STATUS)¶
Offset: 0x1C
Reset value: 0x00000000
| Bit Field | Name | Reset Value | Type | Description |
|---|---|---|---|---|
| 31:1 | Reserved | 0x00000000 | RO | Reserved |
| 0 | CNT_EXT | 0 | RO | Count value count out of range status: 1: Exceeded upper limit 0: Not exceeded upper limit |