The watchdog timer is one of the new features on the BT820B. It helps improve the reliability and robustness of the application by resetting the BT820B if an issue prevents the coprocessor from operating normally.
The watchdog timer continually counts down towards 0 from starting value. During normal operation, the coprocessor will periodically set the counter back to the starting value. If an error occurs which prevents the coprocessor from doing this, the counter will reach 0 and the BT820B will be reset, restoring it to a known state.
If a watchdog timeout occurs:
- The interrupt INT_CMDFLAG is set in REG_INT_FLAGS. An interrupt can also be generated.
- The host MCU can then read the string from the RAM_REPORT area of memory to determine the cause of the interrupt.
- The RAM_REPORT will contain the value “watchdog timeout” in this case
The MCU should do the following to recover:
- Set REG_CMD_READ to zero
- Wait for REG_CMD_WRITE to be zero
- The command FIFO is now empty and the coprocessor is ready to accept commands
Note that to use the watchdog, it must be enabled via a bit in REG_BOOT_CFG which can only be written using the SETBOOTCONFIG host command.