Complete the code to start the watchdog timer.
WDTCTL = [1];The watchdog timer control register needs to clear the counter to start the timer properly. WDTCNTCL does this.
Complete the code to reset the watchdog timer inside the main loop.
while(1) { [1]; // main program tasks }
Resetting the watchdog timer regularly prevents it from resetting the system. WDTCNTCL clears the timer count.
Fix the error in the watchdog timer initialization code.
WDTCTL = [1]; // Start watchdog timerWDTHOLD stops the watchdog timer. To start and clear it, use WDTCNTCL with the password WDTPW.
Fill both blanks to create a dictionary of task names and their watchdog reset status.
const char* tasks[] = {"Sensor", "Motor", "Display"};
int resetStatus[] = {1, 0, 1};
for(int i = 0; i < 3; i++) {
printf("Task: %s, Reset: %d\n", [1], [2]);
}To print each task and its reset status, use the indexed elements tasks[i] and resetStatus[i].
Fill all three blanks to implement a watchdog timer reset check with condition.
if([1] [2] 1000) { [3] = 0; // Reset watchdog timer counter }
The code checks if watchdogCounter is greater than 1000, then resets watchdogCounter to 0.