Question: Problem 5. A PIC32MX795F512L microcontroller has an 80 MHz SYSCLK and a 20 MHz PBCLK. Timer is to be used to create a time slice

Problem 5. A PIC32MX795F512L microcontroller has an 80 MHz SYSCLK and a 20 MHz PBCLK. Timer is to be used to create a time slice of up to 10 ms for a cooperative time-slice scheduler. The tasks are implemented as functions task1, task2, and task3) (a) Code the forever loop to be executed each time slice. This should execute in sequence the three tasks. The code for the timer event at the top of the loop will be determined in part (c) for now it should be indicated by the commenttimer event code goes here (b) Show the C code used to initialize the timer. It should use the smallest time resolution possible and be able to time a time-slice of up to 10 ms. The value in the period register is defined as MAXCOUNT and will be determined in part (c) (c) Assume the Timer 1 interrupts are configured and enabled. Code an ISR to implement the timer event at the top of the time-slice loop. Each timer event initiates execution of the three tasks. (The three tasks should not be in the ISR). Show the code that wil be used in place of the commenttimer event code goes heren part (a). What value should be used in a #def for MAXCOUNT to realize il 2 ms time slice
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
