



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Lab Grading:
out ddrc, r out ddrd, r capture: in r18, pina sts MEMNUM1, r in r19, pinb sts MEMNUM2, r add r18, r brvc no_ovrflw ovrflw: com r no_ovrflw: sts MEMSUM, r out portc, r sts MEMOVF, r out portd, r ldi r16, ZEROS jmp capture b) Use AtmelStudio to create lab1_122_AtmelStudio project. Debug your code, entering input (port) pin values through the I/O window, and making sure that registers, memory locations, overflow status bit, and output (port) pin values are correct. Take a screen capture (PrtScr) of two different results and include in your report, one with inputs at PORTA and PORTB that cause an overflow, and one with inputs that do not cause an overflow. For example, you may organize the relevant state of your machine to show in your screen capture as follows (making sure all your scree captures are readable and properly commented upon): Which lines in the code do not affect the machine state at all? c) Use Proteus to create lab1_122_Proteus project. Instantiate ATMEGA128 microcontroller, and as many DIPSW_8 (8-bit dip switch), LED-BIRG (green led), 4k7 (4.7 kΩ resistor), and RX (pack of 8 resistors) components as you need in order to design the full system described in previous sections, and wire the ports for parallel I/O as in UNI-DS6 development board. Load your debugged code from the previous section to the microcontroller in Proteus, and run the same two cases as in 1.2.2(b) to demonstrate that the LEDs in your system respond correctly to the inputs you provide through the switches. Take two screen captures (PrtScr) to show your system design, and simulated demonstration of correct operation with and without overflow. Instantiate voltage and current “probes” on the microcontroller output port wires in
order to measure voltage and current levels during the simulations. What are the voltage and current levels at the output pins of the microcontroller when the signal corresponds to logic ‘0’ and ‘1’? Measure the voltage drop across an LED when it is ON? What is this drop when LED is OFF? 1.2.3 What is the difference between RAM and ROM? Why is there a need for both a Flash Memory and an EEPROM? 1.2.4 What is the function of the control unit? How does the control unit get the instruction that it must execute? How does it know the number of bytes in an instruction? 1.2.5 Submit your answers to 1.2.2-1.2. 4 at the beginning of the lab as part of the preliminary lab report. Bring your AtmelStudio project directory from 1.2.2(b), including the .asm file, to the laboratory with you in a USB memory stick in order to demonstrate your AtmelStudio simulations to the lab assistant, and answer any questions. Bring your Proteus project directory from 1.2.2(c) to the laboratory with you in a USB memory stick in order to demonstrate your Proteus simulations to the lab assistant, and answer any questions. 1.3 EXPERIMENTAL WORK 1.3.1 Experimental Setup Verify to make sure your workbench has all of the following items: