In this lab you will write a program that, using the D/A converter subsystem of the Atmega32, measures and displays the voltages applied to PortA pins PA0 and PA1 from an external power supply (on the lab bench). Your program will be interrupt-driven; that is, these conversions will only take place when external interrupts (caused by pushbuttons INT0 and INT1) occur.
Your "main" program should be placed in a file named Lab7.asm, and implement subroutines that
Since the INT0, INT1, and A/D interrupts occur arbitrarily (and the associated ISR's execute very quickly), the main program that causes the LEDs to bounce back and forth should never appear to pause to any significant extent, although you may observe slight hesitation in the progress of the bouncing LEDs as the ISR's execute.
The flowchart for the program looks something like this:
You'll also be implementing new functionality into your LCD display library display_dd.asm: You must add a new subroutine, named displayValue16, that (at the current cursor location) outputs the hexadecimal representation the value contained in the 16-bit X register (thus the X register is the "argument" to this new subroutine). As an example, if the X register contains the value 1, then 0x0001 should appear on the display. Similarly, if the X register contains the value 1000, then 0x03E8 should appear.
You must demonstrate your working program on your board before the lab next week.
For your submission, you need only supply your working, fully commented Lab7.asm and display_dd.asm.
Upload your submission through
Blackboard (assignment "Lab 7").
Be sure to keep copies of all your files, in case something gets lost.
Your lab grade will be determined by the following factors:
Program - comments and formatting are important aspects of assembly language programming! And it has to work correctly.
Timeliness of submission as stated in the course policies.