Limited Offer Get 25% off — use code BESTW25
No AI No Plagiarism On-Time Delivery Free Revisions
Claim Now

Watch Dog Timer Programming

2. (50 points) Watch Dog Timer Programming

A watch dog timer is used to recover from program malfunctions. During normal operation, a program regularly resets the watch dog timer to prevent it from expiring. During faulty operations (e.g. a program gets stuck in an infinite loop), the timer cannot be reset. So, when the timer expires, it gets out of the faulty situation by rebooting (restarting) the system.

a) (30 points) Add in timer functions to initialize the watchdog timer. Set the counter to generate an interrupt every 55msec (this is much longer than the run time for function build_a_product).

To get out of the infinite loop situation in part a, the program call a reboot function when the watch dog timer expires. This restarts the application. Write the assembly language program reboot.s to do this.

cat your programs (watchdog.c, timepack_sapc.c and reboot.s) and capture the run of your program in tutor VM in a typescript file named script_part_2b.

b) (10 points) For normal operations, you do not want to reboot your program every 55msec. To ensure this, the program resets the watch dog timer (“kick the dog”) to the original timer count when it finishes build_a_product.

Write the kick_watchdog() function to reset the timer so that it has to wait for another 55msec before generating another interrupt.

int main(void){

The post Watch Dog Timer Programming appeared first on My Assignment Online.

Plagiarism Free Assignment Help

Expert Help With This Assignment — On Your Terms

Native UK, USA & Australia writers Deadline from 3 hours 100% Plagiarism-Free — Turnitin included Unlimited free revisions Free to submit — compare quotes
Scroll to Top