Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Assignment 3 Part 2: Summative (will be graded) Part 2: Follow the procedure described in the labs to use AVR studio to create a project

image text in transcribedimage text in transcribed

Assignment 3 Part 2: Summative (will be graded) Part 2: Follow the procedure described in the labs to use AVR studio to create a project called A3P2.aps. 1. Use a loop to write decrementing hexadecimal numbers into consecutive memory locations in the data memory, starting at memory address Ox200. The starting number, which is between OxO (inclusive) and OxFF (inclusive) should be placed into a register (R16). That starting number needs to be stored in the first data memory location. Then the number will be decremented by 1 and stored in the next consecutive memory location. This process of decrementing and storing will continue until the number is the final value stored. After each number is stored in memory, output the binary equivalent of the number on the LEDs attached to Ports Land B, with the least significant bit on Port L: bit 7. Here is the pseudo- code: number = /* choose a number in (0x00, 0xFF] */ ; count = 0; while (number > 0) { dest[count++] = number; * Output number on LEDs * * delay 0.5 second * number --; Observe that your documentation *should* include the above pseudo code. 2. The fifth line of the above pseudo code (* Output number on LEDs * ) is described as follows: after each number is placed in memory, display the number, in binary on the LEDs on the board that are attached to Ports L and B. Recall from lab 4 that the number must be spread out on every other bit to output to the port. For example, to output the number OxB = Ob1011 on port L, each of those 4 bits must be followed by another bit, lets use 0, such that the binary number becomes Ob10001010. Observe that the 4 underlined bits were the original bits. The conversion from (for shifting it to the proper location and then using an OR operation to combine the bits together. 3. The sixth line of the above pseudo code (* delay 0.5 second * ). Please place the following lines in your code where the delay should occur: rjmp delay: after: inext instruction following lines in your code where the delay should occur: rjmp delay: after: ;next instruction Then place the following at the very end of your code segment (i.e., after done: jmp done.) ; The delay code, which is placed *after* the done: jmp done delay: ldi r24, 0x2A ; approx. 0.5 second delay outer: ldi r23, 0xFF middle: ldi r22, 0xFF inner: dec r22 brne inner dec r23 brne middle dec r24 brne outer rjmp after (Academic Integrity altert: Always give credit to an author who agrees to let you use their code. For example, consider adding "Credit: L. Jackson for the writing the following 9 lines:") Test your code on the simulator in the AVR studio, then upload it onto an Arduino 2560 board in the ECS 249 lab and test. Critical Grading Action!! After completing testing, place a semi-colon; in front of the line rjmp delay: This allows the teaching team to automate the running of your code. Submit your fully documented code file, A3P2. asm, that was created by the AVR studio Assignment 3 Part 2: Summative (will be graded) Part 2: Follow the procedure described in the labs to use AVR studio to create a project called A3P2.aps. 1. Use a loop to write decrementing hexadecimal numbers into consecutive memory locations in the data memory, starting at memory address Ox200. The starting number, which is between OxO (inclusive) and OxFF (inclusive) should be placed into a register (R16). That starting number needs to be stored in the first data memory location. Then the number will be decremented by 1 and stored in the next consecutive memory location. This process of decrementing and storing will continue until the number is the final value stored. After each number is stored in memory, output the binary equivalent of the number on the LEDs attached to Ports Land B, with the least significant bit on Port L: bit 7. Here is the pseudo- code: number = /* choose a number in (0x00, 0xFF] */ ; count = 0; while (number > 0) { dest[count++] = number; * Output number on LEDs * * delay 0.5 second * number --; Observe that your documentation *should* include the above pseudo code. 2. The fifth line of the above pseudo code (* Output number on LEDs * ) is described as follows: after each number is placed in memory, display the number, in binary on the LEDs on the board that are attached to Ports L and B. Recall from lab 4 that the number must be spread out on every other bit to output to the port. For example, to output the number OxB = Ob1011 on port L, each of those 4 bits must be followed by another bit, lets use 0, such that the binary number becomes Ob10001010. Observe that the 4 underlined bits were the original bits. The conversion from (for shifting it to the proper location and then using an OR operation to combine the bits together. 3. The sixth line of the above pseudo code (* delay 0.5 second * ). Please place the following lines in your code where the delay should occur: rjmp delay: after: inext instruction following lines in your code where the delay should occur: rjmp delay: after: ;next instruction Then place the following at the very end of your code segment (i.e., after done: jmp done.) ; The delay code, which is placed *after* the done: jmp done delay: ldi r24, 0x2A ; approx. 0.5 second delay outer: ldi r23, 0xFF middle: ldi r22, 0xFF inner: dec r22 brne inner dec r23 brne middle dec r24 brne outer rjmp after (Academic Integrity altert: Always give credit to an author who agrees to let you use their code. For example, consider adding "Credit: L. Jackson for the writing the following 9 lines:") Test your code on the simulator in the AVR studio, then upload it onto an Arduino 2560 board in the ECS 249 lab and test. Critical Grading Action!! After completing testing, place a semi-colon; in front of the line rjmp delay: This allows the teaching team to automate the running of your code. Submit your fully documented code file, A3P2. asm, that was created by the AVR studio

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions

Question

6 0 8 . .

Answered: 1 week ago