SLDU028A January 2018 – March 2020 TPS65313-Q1
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:
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_answer_cnt+1) 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:
WR_WDT_ANSWER = calculate_answer0(question)
wdt_step = 0
mcu_answer_cnt = 3
end if
end if
end loop