Skip to content

Commit de59a42

Browse files
committed
improved docs
1 parent 29914e8 commit de59a42

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

docs/info.md

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,21 @@ You can also include images in this folder and reference them in the markdown. E
1111

1212
This is a watchdog timer with a 32-bit counter and optional window feature.
1313

14-
WINDOW_CLOSE is how many cycles until the watchdog timer pulls the output interrupt high either low or high respectively. WINDOW_OPEN < WINDOW_CLOSE. WINDOW_OPEN can be 0.
14+
WINDOW_CLOSE is how many cycles until the watchdog timer triggers an interrupt.
15+
WINDOW_OPEN must be less than WINDOW_CLOSE. WINDOW_OPEN can be 0.
1516

16-
Remember to ENABLE the timer after setting WINDOW_CLOSE if you want the watchdog to start working.
17+
Remember to ENABLE the timer after setting WINDOW_CLOSE if you want the watchdog to start.
1718

18-
out[0] is an interrupt line pulled high
19-
out[1] is an interrupt line pulled low
20-
out[2] is a line pulled high for 1 cycle when PAT is set 1
19+
You can cancel a timer by setting ENABLE to 0. This can be done either before or after the timer has tripped.
20+
21+
`out[0]` is an interrupt line pulled high
22+
`out[1]` is an interrupt line pulled low
23+
`out[2]` is a line pulled high for 1 cycle when PAT is set 1
24+
`out[3]` is high if the watchdog is enabled
25+
`out[4]` is high if we're after the Start time of the window.
26+
`out[5]` is high if we're after the End time of the window.
27+
`out[6]` is unused
28+
`out[7]` is unused
2129

2230
## Register map
2331

@@ -36,8 +44,8 @@ The following registers are used to interact with the watchdog
3644
Set `WINDOW_CLOSE` to 100
3745
Set `ENABLE` to 1
3846
Wait 101 cycles
39-
`out[0]` should be high until reset
40-
`out[1]` should be low until reset
47+
`out[0]` should be high
48+
`out[1]` should be low
4149

4250
Set WINDOW_CLOSE to 100
4351
Set ENABLE to 1
@@ -50,7 +58,7 @@ The watchdog should not have triggered so check `out[0]` and `out[1]`
5058

5159
Notes:
5260

53-
* You can't configure the window open and close while the watchdog is enabled.
61+
You can set `WINDOW_OPEN` and `WINDOW_CLOSE` while the timer is running but that's untested and thus could result in a rip in the space time continuum. Set `ENABLE` to 0 first to safely change the window parameters with predictable behavior.
5462

5563
## External hardware
5664

src/peripheral.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ module tqvp_stevej_watchdog (
5656
if (data_write_n != 2'b11) begin
5757
watchdog_enabled <= data_in[0];
5858
end
59-
end else if (address == 6'h1) begin // Address 1 is WINDOW_START
59+
end else if (address == 6'h1) begin // Address 1 is WINDOW_OPEN
6060
if (data_write_n != 2'b11) begin
6161
if (!watchdog_enabled) window_open <= data_in;
6262
end

0 commit comments

Comments
 (0)