Question: Note: I strongly recommend that you reference the ATmega128 datasheet when solving these questions. Problem #1 (25 pts] The AVR code below (with some information

 Note: I strongly recommend that you reference the ATmega128 datasheet when

Note: I strongly recommend that you reference the ATmega128 datasheet when solving these questions. Problem #1 (25 pts] The AVR code below (with some information missing) is designed to initialize and service interrupts from three I/O devices (Deva, DevB, and DevC). (a) There are 8 external interrupt pins (INTO-INT7) in AVR. Based on the code provided, which three interrupt pins are these I/O devices connected to and what is the immediate value needed in line 1? (b) Which 10 device's interrupt is triggered by a falling edge on the corresponding input pin? C) Assume that pins 4 and 2 on PORTA are connected to an additional output device (DevD). Fill in lines 2-3 such that the corresponding pins are specified as outputs. Do not configure any other pins on the port as outputs. (d) Suppose DevA requires that no interrupts are detected while it is being serviced. Fill in lines 4-5 with the necessary code to clear any latched external interrupts at the end of ISR_DEVA. (e) Suppose the interrupt vector at $000C is triggered a total of 5 times. How many times will the NOP instruction on line 0) be executed? .include "2128 def.inc .de mpr = r16 START: .org $0000 JME INIT $0004 RCALL ISR_DEVA RETI .org $0000 RJMP ISR_DevB NOP (0) $0010 RJME ISR_Devc INIT: idi mor, Ob00110000 EICRA, mor idi mor, Ob11101000 out EICRB, mp idi mpr out EIMSK, mp ldi mpr, 900 out DDRD, mpe out DDRE, mor .029 (1) (2) sei MAIN: { ...do something.. ISR_DEVA: (5 RET ISR DevB: RETI ISR_Devc: RETI Note: I strongly recommend that you reference the ATmega128 datasheet when solving these questions. Problem #1 (25 pts] The AVR code below (with some information missing) is designed to initialize and service interrupts from three I/O devices (Deva, DevB, and DevC). (a) There are 8 external interrupt pins (INTO-INT7) in AVR. Based on the code provided, which three interrupt pins are these I/O devices connected to and what is the immediate value needed in line 1? (b) Which 10 device's interrupt is triggered by a falling edge on the corresponding input pin? C) Assume that pins 4 and 2 on PORTA are connected to an additional output device (DevD). Fill in lines 2-3 such that the corresponding pins are specified as outputs. Do not configure any other pins on the port as outputs. (d) Suppose DevA requires that no interrupts are detected while it is being serviced. Fill in lines 4-5 with the necessary code to clear any latched external interrupts at the end of ISR_DEVA. (e) Suppose the interrupt vector at $000C is triggered a total of 5 times. How many times will the NOP instruction on line 0) be executed? .include "2128 def.inc .de mpr = r16 START: .org $0000 JME INIT $0004 RCALL ISR_DEVA RETI .org $0000 RJMP ISR_DevB NOP (0) $0010 RJME ISR_Devc INIT: idi mor, Ob00110000 EICRA, mor idi mor, Ob11101000 out EICRB, mp idi mpr out EIMSK, mp ldi mpr, 900 out DDRD, mpe out DDRE, mor .029 (1) (2) sei MAIN: { ...do something.. ISR_DEVA: (5 RET ISR DevB: RETI ISR_Devc: RETI

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To solve this problem well reference the ATmega128 datasheet to determine how external interrupts wo... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!