Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

image text in transcribed

image text in transcribed

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 IO 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 you've 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. MSP430FG4619IQZWR l: R-Tape & Reel Package Temp range ( -40 to 85, T =-40 to 105C) Family (Memory size & peripherals of similar function (1xx, 2xx, 3xx, 4xx, 5x0x) Optional: End Equipment Optimized (G=Medical, E-E-Meter) Memory Type (F-Flash, C-ROM, P-OTP Member of the 430 MCU Platform Mixed Signal Processor (XMS Experimental silicon) 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 check MSP430 Copyright 2011 by Chia-Tien Dan Lo 2. Familiar yourself with the IAR Kickstart IDE and its basic assembly programming structure. Walk through IAR-KickstarTutorial-Numbers.pdf, create a project named HelloWorldPrj", and a workspace called "DanLoWorkspace" like what's in the tutorial. In IAR, projects are contained ina 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 won't 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 instruction:s (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. the tutorial at http://ksuweb.kennesaw.edu/-dlo2/gLab/tutorial/ a) How many bytes in a word in MSP430? Check 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 VO http://ksuweb.kennesaw.edu/-dlo2/gLab/tutorial/IAR KickstartTutorial _MSP430x.pdf, VO 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 PIOUT 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. Copyright 2011 by Chia-Tien Dan Lo a) What does the instruction BIS.B do? check 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 S sign with the label without the colon. Debug the program. What do you find? Why is that? e) What does the instruction JMP do? Copyright 2011 by Chia-Tien Dan Lo 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 IO 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 you've 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. MSP430FG4619IQZWR l: R-Tape & Reel Package Temp range ( -40 to 85, T =-40 to 105C) Family (Memory size & peripherals of similar function (1xx, 2xx, 3xx, 4xx, 5x0x) Optional: End Equipment Optimized (G=Medical, E-E-Meter) Memory Type (F-Flash, C-ROM, P-OTP Member of the 430 MCU Platform Mixed Signal Processor (XMS Experimental silicon) 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 check MSP430 Copyright 2011 by Chia-Tien Dan Lo 2. Familiar yourself with the IAR Kickstart IDE and its basic assembly programming structure. Walk through IAR-KickstarTutorial-Numbers.pdf, create a project named HelloWorldPrj", and a workspace called "DanLoWorkspace" like what's in the tutorial. In IAR, projects are contained ina 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 won't 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 instruction:s (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. the tutorial at http://ksuweb.kennesaw.edu/-dlo2/gLab/tutorial/ a) How many bytes in a word in MSP430? Check 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 VO http://ksuweb.kennesaw.edu/-dlo2/gLab/tutorial/IAR KickstartTutorial _MSP430x.pdf, VO 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 PIOUT 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. Copyright 2011 by Chia-Tien Dan Lo a) What does the instruction BIS.B do? check 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 S sign with the label without the colon. Debug the program. What do you find? Why is that? e) What does the instruction JMP do? Copyright 2011 by Chia-Tien Dan Lo

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

OpenStack Trove

Authors: Amrith Kumar, Douglas Shelley

1st Edition

1484212215, 9781484212219

More Books

Students also viewed these Databases questions