Question: CS 3224 Lab 7 MSP430 Assembly Programming Basics In this lab, you will be designing assembly programs running on MSP430 hardware using the IAR Kickstart

CS 3224 Lab 7 MSP430 Assembly Programming Basics In this lab, you will be designing assembly programs running on MSP430 hardware using the IAR Kickstart IDE tool, a free tool for IAR for programming MSP430. You will learn basic assembly programming, debugging techniques, MSP430 general purpose I/O along with number conversions. This lab worksheet along with your assembly program design and simulation will be inspected by the instructor in the lab for grading. Note that you will be using your own MSP430 for the lab. Most of the materials are hosted at http://ksuweb.kennesaw.edu/~dlo2/gLab.

1. Understand your MSP430 hardware. Depends what MSP430 chips youve got, you may have a slightly different hardware setting. Most of the hardware manufacturers encode chip numbers according to chip attributes such as capacity, features, etc. The following figure shows MSP430 nomenclature. First of all, read the chip number on your MSP430 and write it down to the following box. Yo may need a magnifier to read it because the code is pretty small. Note the MPS430 is sitting on the far end to the USB plug, and the following figure may not reflect the actual shape of your MSP430. 2. Familiar yourself with the IAR Kickstart IDE and its basic assembly programming structure. Walk through the tutorial at http://ksuweb.kennesaw.edu/~dlo2/gLab/tutorial/ IAR_KickstartTutorial_Numbers.pdf, create a project named HelloWorldPrj and a workspace called DanLoWorkspace like whats in the tutorial. In IAR, projects are contained in a workspace. Each of the projects may have different settings according to what the target hardware is. Therefore, each project is basically independent, but the project wizard wont create a dedicated directory for every project. It is your responsibility to create one folder for every project in the workspace. An assembly program for MSP430 is composed of instructions (one instruction per one line) and other information for the assembler. Each line is divided into three columns: label, instruction, and operands. Comments are identified by a semicolon. Each instruction has two versions: byte (.B) and word (.W). Answer the following questions.

a) How many bytes in a word in MSP430? b) What does the MOV.W instruction do? c) Show the instructor how to convert decimal 1234 to hexadecimal in IAR. d) Show the instructor how to convert octal 1234 to decimal in IAR. 3. Walk through the tutorial about MSP430 I/O at http://ksuweb.kennesaw.edu/~dlo2/gLab/tutorial/IAR_KickstartTutorial_MSP430x.pdf. I/O ports in MSP430 are controlled by three registers, e.g., P1OUT, P1IN, and P1DIR. Each of the registers has 8 bits. The first bit (P1.1) in P1OUT is connected to an LED. If P1.1 is set, the LED light up; otherwise, the LED is off. The port is bi-directional, and controlled by P1DIR. In order for the MSP430 to set the P1.1, the first bit of P1DIR has to be set to 1 (output mode). When we need to read input signal from the port, P1IN is used and its corresponding bit will be set to 0 (input mode). Based on the above knowledge, answer the following questions. a) What does the instruction BIS.B do? b) What does the instruction XOR.B do? c) What happened if XOR.B is replaced with XOR.W? d) Add a label loop: in front of XOR.B, and change the $ sign with the label without the colon. Debug the program. What do you find? Why is that? e) What does the instruction JMP do?

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!