Question: Vdd Figure shows that a high voltage source is connected to the GPIO pin of ARM Cortex Mo via a push button. It also shows

Vdd Figure shows that a high voltage source is connected to the GPIO pin of ARM Cortex Mo via a push button. It also shows the partial contents of the interrupt vector table of Cortex MO. The following code is flashed into ROM at address Ox100. The numbers in bold on the left of each line -W Interrupt Vector Table 0000h Ooh Ooh 0002h 20h 20h 0004h 04h 0006 01h Ooh ooh ARM Cortex MO Button GPIO show the addresses. At the beginning of the procedure named "init, there is code to configure Cortex Mo to generate an EXT interrupt 0 on the rising edge of the GPIO pin (not shown in the code). 0050h 100h 102h 104h MOVS RO, #100 Binit 0052h MOVS RO, LR init PROC ... ; GPIO and external interrupt initialization code here 0054h 106h 0056h. 0058h 120h MOVS R1, #3 122h loop CMP R1, #0 124h BNE loop 126h CPSIDI 128h Bloop ENDP a) (10 points) Write Button ISR in ARM Cortex MO assembly which does the following: 1. Reads the value of PC (program counter). 2. Calculates the last two hexadecimal digits of the read PC value. 3. Then, it does one of the following: a. If the resulting number in step 2 is bigger than or equal to unsigned Ox80, it increments register RO by 300. b. If the resulting number in step 2 is less than or equal to 0x80, it decrements register RO by 300. 4. Finally, it decrements register R1 by 1. These four steps must be performed at each button press. You need to comment your code sufficiently to explain which part of the algorithm is handled by which instructions. b) (10 points) Place the Button ISR at an appropriate place in ROM and fill in the rest of the vector table to handle the EXT interrupt 0. c) (10 points) What will be the final value of register RO after Cortex MO is reset, the user waits 1 second and presses the button 5 times in a row with 1 second intervals (i.e., after the reset, 1 second elapses, the button is pressed and released, 1 second elapses, the button is pressed and released again, and so on)? Please write down your calculations. Note: Assume the button is perfect and does not bounce. Vdd Figure shows that a high voltage source is connected to the GPIO pin of ARM Cortex Mo via a push button. It also shows the partial contents of the interrupt vector table of Cortex MO. The following code is flashed into ROM at address Ox100. The numbers in bold on the left of each line -W Interrupt Vector Table 0000h Ooh Ooh 0002h 20h 20h 0004h 04h 0006 01h Ooh ooh ARM Cortex MO Button GPIO show the addresses. At the beginning of the procedure named "init, there is code to configure Cortex Mo to generate an EXT interrupt 0 on the rising edge of the GPIO pin (not shown in the code). 0050h 100h 102h 104h MOVS RO, #100 Binit 0052h MOVS RO, LR init PROC ... ; GPIO and external interrupt initialization code here 0054h 106h 0056h. 0058h 120h MOVS R1, #3 122h loop CMP R1, #0 124h BNE loop 126h CPSIDI 128h Bloop ENDP a) (10 points) Write Button ISR in ARM Cortex MO assembly which does the following: 1. Reads the value of PC (program counter). 2. Calculates the last two hexadecimal digits of the read PC value. 3. Then, it does one of the following: a. If the resulting number in step 2 is bigger than or equal to unsigned Ox80, it increments register RO by 300. b. If the resulting number in step 2 is less than or equal to 0x80, it decrements register RO by 300. 4. Finally, it decrements register R1 by 1. These four steps must be performed at each button press. You need to comment your code sufficiently to explain which part of the algorithm is handled by which instructions. b) (10 points) Place the Button ISR at an appropriate place in ROM and fill in the rest of the vector table to handle the EXT interrupt 0. c) (10 points) What will be the final value of register RO after Cortex MO is reset, the user waits 1 second and presses the button 5 times in a row with 1 second intervals (i.e., after the reset, 1 second elapses, the button is pressed and released, 1 second elapses, the button is pressed and released again, and so on)? Please write down your calculations. Note: Assume the button is perfect and does not bounce
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
