<< Chapter < Page Chapter >> Page >
A lab that introduces a student to assembly language programming.

In this lab you will be introduced to assembly programming. The specific assembly language instruction set of the MSP will be explained. Setting up and executing assembly projects in Crossworks will also be explained. Finally you will implement the blinking lights program from the previous lab in assembly.

Read the following modules before you begin lab exercises:

  • CPU Registers in the MSP430
  • Structure of an Assembly Program

Formulate instructions to do the following things:

  • Set bit 3 to 1 at the memory address 0xd640 while leave bits 0-2 and 4-16 unaffected.
  • Jump to the instruction labeled POINT if the carry bit is set.
  • Shift register R6 right one place while preserving the sign.

Got questions? Get instant answers now!

Examine this loop: ... more instructions... Mov.w&I, R4 Cmp.w #0x0000, R4JZ After_loop Start_loop:Dec.w #0x0001, R4 JZ After_loopBR #Start_loop After_loop:...more instructions...

  • How many times will this loop execute?
  • Why do we use the BR instruction with a #Start_loop, but with the JZ we use a plain After_loop?
  • What does the first JZ instruction do? If we did not have this initial Cmp and JZ, what (possibly) inadvertent effect might occur?

Got questions? Get instant answers now!

Re-write the blinking light program from Lab 2, now using assembly code. The program should do the following:

  • When the program starts all three LED’s should light up for about a second then turn off.
  • Next, the green LED should blink for about 1/2 second on, 1/2 second off while the other two LED’s are off.
  • Pushing Button 1 should cause the green LED to stop blinking and cause the red LED to start the blinking pattern.
  • Pushing the button again should continue the pattern with the yellow LED, and pushing it more times should repeat the green, red, yellow pattern. Note that the current LED that's blinking should stop as soon as the button is pressed and the next LED should begin immediately.

Got questions? Get instant answers now!

Questions & Answers

what is biology
Hajah Reply
the study of living organisms and their interactions with one another and their environments
AI-Robot
what is biology
Victoria Reply
HOW CAN MAN ORGAN FUNCTION
Alfred Reply
the diagram of the digestive system
Assiatu Reply
allimentary cannel
Ogenrwot
How does twins formed
William Reply
They formed in two ways first when one sperm and one egg are splited by mitosis or two sperm and two eggs join together
Oluwatobi
what is genetics
Josephine Reply
Genetics is the study of heredity
Misack
how does twins formed?
Misack
What is manual
Hassan Reply
discuss biological phenomenon and provide pieces of evidence to show that it was responsible for the formation of eukaryotic organelles
Joseph Reply
what is biology
Yousuf Reply
the study of living organisms and their interactions with one another and their environment.
Wine
discuss the biological phenomenon and provide pieces of evidence to show that it was responsible for the formation of eukaryotic organelles in an essay form
Joseph Reply
what is the blood cells
Shaker Reply
list any five characteristics of the blood cells
Shaker
lack electricity and its more savely than electronic microscope because its naturally by using of light
Abdullahi Reply
advantage of electronic microscope is easily and clearly while disadvantage is dangerous because its electronic. advantage of light microscope is savely and naturally by sun while disadvantage is not easily,means its not sharp and not clear
Abdullahi
cell theory state that every organisms composed of one or more cell,cell is the basic unit of life
Abdullahi
is like gone fail us
DENG
cells is the basic structure and functions of all living things
Ramadan
What is classification
ISCONT Reply
is organisms that are similar into groups called tara
Yamosa
in what situation (s) would be the use of a scanning electron microscope be ideal and why?
Kenna Reply
A scanning electron microscope (SEM) is ideal for situations requiring high-resolution imaging of surfaces. It is commonly used in materials science, biology, and geology to examine the topography and composition of samples at a nanoscale level. SEM is particularly useful for studying fine details,
Hilary
cell is the building block of life.
Condoleezza Reply
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Microcontroller and embedded systems laboratory. OpenStax CNX. Feb 11, 2006 Download for free at http://cnx.org/content/col10215/1.29
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Microcontroller and embedded systems laboratory' conversation and receive update notifications?

Ask