Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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 (INT0-INT7) in AVR. Which of the three interrupt pins are these I/O devices connected to and what is the immediate value needed in line (1)?

(b) Which I/O devices 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-4 of the code. Fill in the missing instructions in lines 2-4 so that the code will work correctly.

(e) Suppose DevB requires that no interrupts are detected while it is being serviced. Fill in lines 5-6 with the necessary code to clear any latched interrupts at the end of ISR_DevB.

(f) Suppose a signal that transitions from high to low is detected on all three interrupt pins at the same time. Which subroutine (ISR_DevA, ISR_DevB, or ISR_DevC) will be executed first?

.include m128def.inc

.def mpr = r16

START:

.org $0000

RJMP INIT

.org $0004

RJMP ISR_DevA

.org $0006

RJMP ISR_DevB

.org $000E

RJMP ISR_DevC

INIT:

ldi mpr, 0b00101100

sts EICRA, mpr

ldi mpr, 0b00100000

out EICRB, mpr

ldi mpr, _________________(1)

out EIMSK, mpr

ldi mpr, $00

out DDRD, mpr

________________________(2)

ldi mpr, 0b01000100

________________________(3)

________________________(4)

Sei

MAIN:

{

do something

}

ISR_DevA:

{

RETI

}

ISR_DevB:

_______________________(5)

_______________________(6)

RETI

ISR_DevC:

{

RETI

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 23rd European Conference Adbis 2019 Bled Slovenia September 8 11 2019 Proceedings Lncs 11695

Authors: Tatjana Welzer ,Johann Eder ,Vili Podgorelec ,Aida Kamisalic Latific

1st Edition

3030287297, 978-3030287290

More Books

Students also viewed these Databases questions

Question

How We Listen?

Answered: 1 week ago