Answered step by step
Verified Expert Solution
Question
1 Approved Answer
[25 pts] 1- The AVR code below (with some information missing) is designed to initialize and service interrupts from three I/O devices (DevA, DevB, and
[25 pts] 1- 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. Which of the three interrupt pins are these IO devices connected to and what is the immediate value needed in line (1)? (b) Which I/O device's interrupt is detected on a falling edge? (c) The interrupt pins referred to in part (a) are connected to two of the 7 ports (PORTA-PORTG) in AVR. Which ports are they? (d) There are important instructions missing in lines 2-3 of the code. Fill in the missing instructions in lines 2-3 so that the code will work correctly necessary code to clear any latched interrupts at the end of ISR_DevA. (ISR_DevA, ISR_DevB, or ISR_DevC) will be executed first? (e) Suppose DevA requires that no interrupts are detected while it is being serviced. Fill in lines 4-5 with the (f) Suppose interrupts are detected from all three interrupt pins at the same time. Which subroutine .include "m128def.inc" START: .org $0000 .org $0002 .org $0008 .org $000c INIT: RJMP INIT RJMP ISR DevA RJMP ISR DevB RJMP ISR DevC ldi mpr, 0b10000011 sts EICRA, mpr ldi out EICRB, mpr ldi mpr out EIMSK, mpr ldi mpr, $00 out DDRD, mpr mpr, Ob00001100 ldi mpr, 0b00001000 3 sel MAIN: .do something... ISR DevA: RETI ISR DevB: RETI ISR DevC: RETI [25 pts] 1- 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. Which of the three interrupt pins are these IO devices connected to and what is the immediate value needed in line (1)? (b) Which I/O device's interrupt is detected on a falling edge? (c) The interrupt pins referred to in part (a) are connected to two of the 7 ports (PORTA-PORTG) in AVR. Which ports are they? (d) There are important instructions missing in lines 2-3 of the code. Fill in the missing instructions in lines 2-3 so that the code will work correctly necessary code to clear any latched interrupts at the end of ISR_DevA. (ISR_DevA, ISR_DevB, or ISR_DevC) will be executed first? (e) Suppose DevA requires that no interrupts are detected while it is being serviced. Fill in lines 4-5 with the (f) Suppose interrupts are detected from all three interrupt pins at the same time. Which subroutine .include "m128def.inc" START: .org $0000 .org $0002 .org $0008 .org $000c INIT: RJMP INIT RJMP ISR DevA RJMP ISR DevB RJMP ISR DevC ldi mpr, 0b10000011 sts EICRA, mpr ldi out EICRB, mpr ldi mpr out EIMSK, mpr ldi mpr, $00 out DDRD, mpr mpr, Ob00001100 ldi mpr, 0b00001000 3 sel MAIN: .do something... ISR DevA: RETI ISR DevB: RETI ISR DevC: RETI
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started