Answered step by step
Verified Expert Solution
Question
1 Approved Answer
undefined 0 CDA3331C Intro to Microcomputers Lab Assignment Name/Semester: Grade: 15 [5] 0) This lab is designed to help students get acquainted with the MSP430
undefined
0 CDA3331C Intro to Microcomputers Lab Assignment Name/Semester: Grade: 15 [5] 0) This lab is designed to help students get acquainted with the MSP430 Launchpad microcontroller training kit. Type the following sample assembly language program which starts at address 0x0200 (&0200h), or simply $200. The program adds the contents of three consecutive memory locations starting at address $200. The sum is stored at location $206. In the following subsections, various commands are listed for you to explore. In the Code Composer, create a new Assembly Project and insert the following code into section label Main loop here. You can also copy the entire skeleton program from the text file provided on your Canvas course. LAB1 mov.W #01, &0200h mov.W #02, 80202h mov.W #03, 80204h ;set a number on location $0200 ;set a number on location $0202 ; set a number on location $0204 LINEA clr clr clr clr R7 R8 R9 R10 ;clear the entire R7 register ;clear the entire R8 register ; clear the entire R9 register ; clear the entire R10 register LINEB mov.W &0200h, R7 mov.W &0202h, R8 mov.W &0204h, R9 ;copy a word from &0200h to R7 ; copy a word from &0202h to R8 ;copy a word from &0204h to R9 LINEC mov.b R7, R10 add.b R8, R10 add.b R9, R10 mov.b R10, &0206h ; start accumulator in R10 with value form R7 ; add to it the content R8 ; add to it the content R9 ; now store the sum back in memory Mainloop jmp Mainloop ;Infinite Loop 0 CDA3331C Intro to Microcomputers Lab Assignment Name/Semester: Grade: 15 [1] 0.a) Exercise 1: Default program execution o Insert break point at the Mainloop line o Build and execute program o Record value of core registers when program stops at the breakpoint R7_ _R8 R9 R10 _, SR ,NZVC [2] 0.b) Exercise 2: Memory manipulation Soft Reset the micro o Insert break point at LINEB label o Insert break point at LINEC label o keep the break point at Mainloop line o Run the program so it stops at LINEB o Record Values of the following registers: R7 _, R8 R9 R10 SR NZVC Using the memory browser, modify the content of following memory locations by manually typing the new values over the initial values (in decimal notation): . 0x0200 = 02, 0x0202 = 03, 0x0204 = 10 o Run the code, and now it will stop at LINEC o Record the updated values of the registers: R7 R9 R10_ , SR NZVC o Run the code, and now it will stop at Mainloop o Record the values again: R8 R7 R8 R9 R10 SR NZVC [2] 0.c) Exercise 3: Register manipulation o Soft Reset the micro o Remove the break points at LINEB and keep the ones at LINEC and Mainloop o Execute program to stop at LINEC o Record the new values: R7 R10 SR_ NZVC o Manually modify the contents of Registers as follows: .R7 = 05, R8 = 01, R9 = 0 (decimal notation) o Run the code till it stops at the last breakpoint, Mainloop o Record the new values: _, R8 R9 R7 R8 R9 R10 _, SR ,NZVC 0 CDA3331C Intro to Microcomputers Lab Assignment Name/Semester: Grade: 15 [5] 0) This lab is designed to help students get acquainted with the MSP430 Launchpad microcontroller training kit. Type the following sample assembly language program which starts at address 0x0200 (&0200h), or simply $200. The program adds the contents of three consecutive memory locations starting at address $200. The sum is stored at location $206. In the following subsections, various commands are listed for you to explore. In the Code Composer, create a new Assembly Project and insert the following code into section label Main loop here. You can also copy the entire skeleton program from the text file provided on your Canvas course. LAB1 mov.W #01, &0200h mov.W #02, 80202h mov.W #03, 80204h ;set a number on location $0200 ;set a number on location $0202 ; set a number on location $0204 LINEA clr clr clr clr R7 R8 R9 R10 ;clear the entire R7 register ;clear the entire R8 register ; clear the entire R9 register ; clear the entire R10 register LINEB mov.W &0200h, R7 mov.W &0202h, R8 mov.W &0204h, R9 ;copy a word from &0200h to R7 ; copy a word from &0202h to R8 ;copy a word from &0204h to R9 LINEC mov.b R7, R10 add.b R8, R10 add.b R9, R10 mov.b R10, &0206h ; start accumulator in R10 with value form R7 ; add to it the content R8 ; add to it the content R9 ; now store the sum back in memory Mainloop jmp Mainloop ;Infinite Loop 0 CDA3331C Intro to Microcomputers Lab Assignment Name/Semester: Grade: 15 [1] 0.a) Exercise 1: Default program execution o Insert break point at the Mainloop line o Build and execute program o Record value of core registers when program stops at the breakpoint R7_ _R8 R9 R10 _, SR ,NZVC [2] 0.b) Exercise 2: Memory manipulation Soft Reset the micro o Insert break point at LINEB label o Insert break point at LINEC label o keep the break point at Mainloop line o Run the program so it stops at LINEB o Record Values of the following registers: R7 _, R8 R9 R10 SR NZVC Using the memory browser, modify the content of following memory locations by manually typing the new values over the initial values (in decimal notation): . 0x0200 = 02, 0x0202 = 03, 0x0204 = 10 o Run the code, and now it will stop at LINEC o Record the updated values of the registers: R7 R9 R10_ , SR NZVC o Run the code, and now it will stop at Mainloop o Record the values again: R8 R7 R8 R9 R10 SR NZVC [2] 0.c) Exercise 3: Register manipulation o Soft Reset the micro o Remove the break points at LINEB and keep the ones at LINEC and Mainloop o Execute program to stop at LINEC o Record the new values: R7 R10 SR_ NZVC o Manually modify the contents of Registers as follows: .R7 = 05, R8 = 01, R9 = 0 (decimal notation) o Run the code till it stops at the last breakpoint, Mainloop o Record the new values: _, R8 R9 R7 R8 R9 R10 _, SR ,NZVCStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started