Description of the Watchdog Algorithm Implemented on EVM
34
SLDU028A – January 2018 – Revised March 2020
Copyright © 2018–2020, Texas Instruments Incorporated
TPS65313-EVM User’s Guide
11
Description of the Watchdog Algorithm Implemented on EVM
This section provides an overview of Q&A functional mode 0 implementation done on the MSP430 MCU
on the EVM. To start, follow these steps:
Step 1.
Initialize wait times.
Step 2.
Make sure the value of the MCU answer counter matches the value of the device answer
counter.
If the counter values do not match, the MCU sends answers until a new watchdog window starts and
then continues with
Step 3.
Read the question, and then wait.
Step 4.
Send Answer3, and then wait.
Step 5.
Send Answer2, and then wait.
Step 6.
Send Answer1, and then wait.
Step 7.
Send Answer0, and then wait.
Step 8.
Repeat
through
.
The pseudo-code description of the Q&A functional mode 0 algorithm implemented on EVM is as follows:
// Initialize wait times for each answer. These values work for default WDT window settings-
wait_time=[30, 30, 30, 30, 25]
mcu_answer_cnt = 3
// wdt_step is the current status of the WDT routine
// wdt_step=0: read the question
// wdt_step=1: send answer3
// ...
// wdt_step=4: send answer0
wdt_step = 0
// Main loop
loop:
// Use timer to wait specified amount of time
Wait (wait_time[wdt_step]) ms
// Make sure MCU is synchronized with TPS65313 WDT status
// If not synchronized, send enough commands to force TPS65313 to start a new watchdog window
tps65313_answer_cnt = RD_WDT_STATUS[6:5]
if (mcu_answer_cnt != tps65313_answer_cnt):
Loop (tps65313_ans1) times:
WR_WDT_ANSWER = 0x00
end loop
wdt_step=0
mcu_answer_cnt=3
else:
// Read the question
if wdt_step = 0:
question = RD_WDT_QUESTION_VALUE
wdt_step = 1
// Write the answers, calculated by Table 6-10 in device datasheet
else if wdt_step = 1:
WR_WDT_ANSWER = calculate_answer3(question)
wdt_step = 2
mcu_answer_cnt = 2
else if wdt_step = 2:
WR_WDT_ANSWER = calculate_answer2(question)
wdt_step = 3
mcu_answer_cnt = 1
else if wdt_step = 3:
WR_WDT_ANSWER = calculate_answer1(question)
wdt_step = 4
mcu_answer_cnt = 0
else if wdt_step = 4: