Please answer the following questions about interrupts and m

Please answer the following questions about interrupts and microcontrollers:

Use the LST file excerpts shown below for Questions 8-10. some code left out in interest of space Suppose SP contains 0x03FE and the code is currently executing executing line 344 above - at that time an interrupt from TimerA occurs. What return address is saved on the stack, what is the new value in the PC as a result of the interrupt, and what is the new value of the SP as a result of the interrupt? Eventuall the ISR above completes and line 365 is executed. After line 365 completes execution, what are the new values of PC and SP? What is the starting address of the TimerA ISR? (give result in hexadecimal) Determine the slowest rate of timer interrupts (longest time between timer interrupt events) that is possible with the MSP430G2553 if the DCO clock is exactly 12 M Hz. Remember that you can divide the DCO clock by 8 in the clock module and by 8 again in the TimerA module. Assume that you are using the UP counting mode for the timer.

Solution

Find Answers below:

Given data:

                                Current value pointed in stack pointer = 0x3FE

8.            Currently line 344 is being executed and then TimerA interrupt occurs. So, CPU completes the execution of instruction at 344 and saves the address of next instruction in Stack.

Therefore, Stack will be pushed with the address of line 345 which is 0x00C196.

Now PC will be loaded with Address of Interrupt vector table 0x00E018.

Stack pointer points to the latest value pushed on to the stack. i.e., 0x00C196.

9.            Once the ISR execution gets completed, the return address which was saved in the Stack (0x003196) will be popped into Program Counter, SP will be decremented.

So, PC will contain 0x003196 and SP will point to 0x3FE

10.          The Starting address of TimerA ISR is 0x00FFF2

11.          Timer A module frequency is 12MHz/8/8 = 187.5 KHz

                In the UP counting mode, Timer starts at 0 and counts upto 0xFFFF which will take 65535 ticks to complete the count and reset back to 0. This will take 2 seconds. So Time gap is 2 seconds.

Please answer the following questions about interrupts and microcontrollers: Use the LST file excerpts shown below for Questions 8-10. some code left out in int

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site