Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that uses external interrupt #0, #1, and #5. Set up INT0 to sense any logic change, set up INT1 to sense falling

Write a program that uses external interrupt #0, #1, and #5. Set up INT0 to sense any logic change, set up INT1 to sense falling edges and set up INT5 to sense rising edges. Initialize a counting register (use R22) to hold a result from the Interrupt Service Procedures (ISPs) associated with INT0, 1 and 5. The ISP for INT0 should increment R22. The ISP for INT1 should increment R22. The ISP for INT5 should decrement R22.

INCLUDE

.DEF TEMP=R16

.CSEG ; The start of the code segment

.ORG 0X0000 ; Set the beginning of code at the reset interrupt vector

RJMP MAIN ;jump to main program from the reset interrupt

MAIN:

LDI TEMP, LOW(RAMEND) ; Setup Stack

OUT SPL, TEMP ; Set SPL to the low byte of RAMEND

LDI TEMP, HIGH(RAMEND) ;

OUT SPH, TEMP ; Set SPH to the high byte of RAMEND

;insert code here

LOOP: ; A continuous loop is an essential

; part of any embedded program

;insert code here

RJMP LOOP ; Start the LOOP over

Given an appropriate voltage input signal of 500 Hz and duty cycle of 10% is connected to the inputs for external interrupts #0, #1 and #5 (same signal for all 3), what would the value in R22 after 1 sec? ______________  

Step by Step Solution

3.46 Rating (159 Votes )

There are 3 Steps involved in it

Step: 1

Answer Question Write a program that uses external interrupt 0 1 and 5 Set up INT0 to sense any logic change set up INT1 to sense falling edges and set up INT5 to sense rising edges Initialize a count... 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

Introduction to Java Programming, Comprehensive Version

Authors: Y. Daniel Liang

10th Edition

133761312, 978-0133761313

More Books

Students also viewed these Finance questions

Question

6.64 Find zo such that P(z> zo) = 0.5.

Answered: 1 week ago

Question

=+c. Calculate and interpret the coefficient of determination.

Answered: 1 week ago

Question

=+c. Construct a plot of the residuals. What does it suggest?

Answered: 1 week ago