Question: QUESTION 1 [ 2 5 ] The following AVR program is a student's counter that counts the number of students in a class room and

QUESTION 1
[25]
The following AVR program is a student's counter that counts the number of students in a class room and displays on a remote unit with a USART interface running HyperTerminal. Only one person can enter and exit at a time. The initially empty class room has a maximum capacity of 99 students, one entry and one exit point equipped with entry and exit sensors that generate a LOW when activated. The code shown in Figure Q1 below is not complete. Assume all the registers are defined.
The ATmega 32 parameters are as follows: A 8MHz clock. USART baud rate of 1200bps, one start bit, 8 data bits, no parity and one stop bit. The code is not complete. Assume all the registers are defined.
a) Draw a block level schematic diagram representing the modules required to build the system, their functions and how they are interconnected including the remote unit. Indicate the pin connections used and the reason for the choice.
6
b) Determine the hexadecimal values missing at the following:
4
i.) Line 3.
ii.) Line 5.
c) Write the code to be placed at the following:
9
i.) Line 9, configuring the interrupts.
ii.) Line 10, configuring the USART protocol.
iii.) Line 16 and Line 19.
d) What would happen if Line 17 is omitted?
[2]
e) What could be wrong with Line 24? How would you correct the problem?
4
Note: In all cases show the working.
\table[[.0rg000,;Line 1],[rimp Init,;Line 2],[. org 0xdots....,;Line 3],[rimp INTO_ISR,;Line 4],[org0xdotsF,;Line 5],[rimp INT1_ISR,;Line 6],[.org 0100,;Line 7],[Initstack,;Line 8],[;configure Interrupts,:Line 9],[;configure USART,;Line 10],[Idi Num_Stds, Ox...,;Line 11],[Start:,;Line 12],[rcall transmit,;Line 13],[jjmp Start,;Line 14],[INTO_ISR:,;Line 15],[;process line,;Line 16],[reti,;Line 17],[INT1_ISR:,;Line 18],[;process line,;Line 19],[reti,;Line 20],[TRANSMIT:,;Line 21],[sbis UCSRA, UDRE,;Line 22],[rjmp TRANSMIT,;Line 23],[out UDR, Num_Stds,;Line 24],[ret,;Line 25]]
Figure Q1
 QUESTION 1 [25] The following AVR program is a student's counter

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!