Question: Write an assembly program for the ATMega 3 2 that does the following: 1 . Display a decimal up - count on 7 - segment

Write an assembly program for the ATMega32 that does the following:
1. Display a decimal up-count on 7-segment display connected to Port D
2. When the count overflows restart from zero; continue forever.
The following restrictions apply:
1. The 7-segment display is connected in an active high configuration.
2. Use Timer 1 to implement a visualization delay as follows:
a. Timer 1 mode: Normal
b. Timer 1 clock source: Prescaler system clock (Use prescaler of 8 with assumption system clock
is 1MHz)
c. Use polling of the Timer 1 Overflow Flag to implement a 2 second delay.
d. This delay routine must be a callable subprogram.
e. The subprogram is called when needed from the main loop.
3. Explicitly Set or Clear bits in the appropriate I/O registers. Assume that all bit values are initially wrong.
4. Structure your program very clearly and logically into blocks of code.
5. Comment every code block indicating the purpose of the code.
.include "m32def.inc"
.cseg
.org 0x0000
rjmp setup
.org 0x0010
; 0,1,2,3,4,5,6,7,8,9
mydata: .db 0x40,0x79,0x24,0x30,0x19,0x12,0x02,0x78,0x00,0x10
enddata:
.org 0x0050
setup:
Mark breakdown:
MCU setup section [10]
Main loop [5]
Delay subroutine [5]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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!