0% found this document useful (0 votes)
117 views13 pages

Laboratory 0: 1. Objectives

The document provides an overview of Laboratory 0 for a microcontrollers course. It introduces the MSP432P4111 Launchpad board that will be used, describes how to install Code Composer Studio v8.1.0 for programming and debugging the board, and guides setting up and running a sample "example-01" project to test that the board and software are functioning properly.

Uploaded by

Sara Gomez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
117 views13 pages

Laboratory 0: 1. Objectives

The document provides an overview of Laboratory 0 for a microcontrollers course. It introduces the MSP432P4111 Launchpad board that will be used, describes how to install Code Composer Studio v8.1.0 for programming and debugging the board, and guides setting up and running a sample "example-01" project to test that the board and software are functioning properly.

Uploaded by

Sara Gomez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Microcontrollers

2019/2020

LABORATORY 0
1. Objectives
The objective of this initial laboratory is threefold:
1) Get acquainted with the MSP432P4111 Launchpad board that will be used
throughout the laboratories.
2) Perform the installation of Code Composer Studio v.8.1.0 in your computer and
learn how to import, compile and debug a test project.
3) Test that the MSP432P4111 Launchpad board works correctly and that Code
Composer Studio v.8.1.0 can be used to program and debug the board.

2. MSP432P4111 Launchpad

2.1. Board overview


The MSP432P4111 Launchpad, depicted in the next Figure, is a development board
developed by Texas Instruments to showcase the MSP432P4111 microcontroller, which
features a 32-bit ARM Cortex-M4F processor running up to 48 MHz, together with 2
Mbytes of Flash memory, 256 kbytes of SRAM memory and 32 kbytes of ROM memory.

1
Microcontrollers
2019/2020

In addition to the microcontroller, the MSP432P4111 Launchpad contains:

 An XDS110-ET debugger to program and debug the MSP432P4111 processor.


The XDS110-ET also supports a back-channel UART for application
communication and EnergyTrace+ to measure real-time current consumption.
 Two buttons and two LEDs for user interaction.
 A LMT70 analog temperature sensor.
 A 320-segments LCD.
The main source of documentation for the MSP432P4111 are the datasheet (SLASEA0A),
the user manual (SLAU356H) and the Launchpad documentation (SLAU747A), which can
be found in the course website or online at the Texas Instruments website.

3. Code Composer Studio

3.1. Installation
You can download Code Composer Studio v8 from the following Texas Instruments
website: http://processors.wiki.ti.com/index.php/Download_CCS. You must select the
installer for your operating system (i.e. Windows, Mac OS or Linux). You can either select
the online or offline version, but it is recommended to use the online version since it will
only download the required components and, thus, complete faster.

Once you have downloaded the latest version of Code Composer Studio you have to
install it by running the executable. During the installation process you will be prompted
the directory to which you will install the software. It is recommended to use the default
value (i.e., C:/ti for Windows systems or /opt/ti for Linux systems).
Also, you will need to indicate the processor support that will be installed. For this
Microcontrollers class at Universitat de Vic you only need select the “SimpleLink
MSP432 low-power + performance MCUs” option.

2
Microcontrollers
2019/2020

Regarding the debugger probes, you only need to install the Texas Instruments XDS110
USB Debug Probe, but installing the remaining will not create any problem.

3.2. Import existing projects


To start, proceed to downloading and unzipping the “lab0_2018” project files from the
course website (Moodle).
Once you have downloaded and unzipped the “lab0_2018” files in your computer, you
can start Code Composer Studio v8 and import the projects to your Workspace.

3
Microcontrollers
2019/2020

During the start-up process Code Composer Studio will ask where the Workspace is
located. Use the default one or create to your liking.

Once Code Composer Studio finishes to start-up you will be presented with the following
screen.

4
Microcontrollers
2019/2020

After installing and starting Code Composer Studio you also need to install the
“SimpleLink MSP432 SDK” package, which contains the libraries for the MSP432P4111
microcontroller. To do so go to “View” menu and click on “Resource Explorer”. Once
there, scroll down to find the box named “SimpleLink MSP432 SDK” and click the

“Download and Install button” ( ) for the “Latest” version. Once the package is
installed restart Code Composer Studio as requested.

5
Microcontrollers
2019/2020

After installing the “SimpleLink MSP432 SDK” and restarting Code Composer Studio, you
can click on the “File” menu and select “Import” to import the project.

The following “Import” window will appear, and you need to select the “CCS Projects”
option and click on the “Next” button.

6
Microcontrollers
2019/2020

The following “Import CCS Eclipse Projects” window will appear, and you need to click
on the “Browse” and find the location of your projects. Once you have located the folder
where the projects are stored you need to click “Accept”.

Back in the “Import CCS Eclipse Projects” window you will now be able to select the
projects that have been discovered and that you want to import. Select the projects that
you want to import and click the “Finish” button.

Once the projects have been imported to Code Composer Studio they will appear in the
“Project Explorer” tab in the main window. You can leave all the projects open, but in
the following sub-section we will work only with the “example-01” project, so consider

7
Microcontrollers
2019/2020

closing the other projects in case they exist. To close a project right-click on the project
name and select the “Close Project” option from the drop-down menu.

3.3. Compile and debug a project


Once you have closed the remaining projects, proceed to opening the “main.c” file of
the “example-01” project.

To compile and link the “example-01” project click on the “Build” button ( ) in the
top menu. Alternatively, you can use the “CTRL+B” keyboard shortcut to compile and
link the project. Once the process completes you should see a “Build Finished” message
in the bottom Console.

Before starting to debug the project, you need to connect the target board
(MSP432P4111 Launchpad) to the computer where Code Composer Studio is being
executed using the USB port.

8
Microcontrollers
2019/2020

Once the compilation process has been successful and the target board has been
connected you can proceed to loading the binary to the MSP432P4111 Launchpad board

using the “Debug” button ( ) in the top menu. Alternatively, you can use the F11
keyboard button to start debugging the project.
During the process you may be asked two different questions:
1) whether you want to upgrade the firmware of the Texas Instruments XDS110 USB
Debug Probe. To that question you need to answer “Yes” and let the process finish
without disconnecting the debug probe from the computer.
2) whether you want to reuse (or not) the debug settings previously set, as depicted in
the next figure. In that case, please answer “No” to make sure the default debug settings
are used.

Once the process completes the Code Composer Studio perspective will change from
“CCS Edit” to “CCS Debug” and you will be able to see a screen like the following. Notice
how the “CCS Debug” perspective is divided in the following areas: Debug,
Variables/Expressions/Registers/Breakpoints, Code, Memory Browser, Console and
Terminal. In the following paragraphs we will describe the basic functionality of each
area to understand its capabilities during a debug session.

The Debug area shows the program that is being debugged, the JTAG probe (Texas
Instruments XDS110 USB Debug Probe, Cortex_M4) and the function at which the
debugger is currently stopped at. Notice how the Debug area also displays the function

9
Microcontrollers
2019/2020

call stack, i.e. that the “main” function is executed from the “_c_int00_noinit_noargs”
function.

The Variables/Expressions/Registers/Breakpoints area are depicted in the next images.


In the Variables area you can see the name, type, value and memory location of the
variables that belong to the function being executed. You can modify the value by
double clicking in the Value section.

In the Expressions area you can type expressions to be interpreted by Code Composer
Studio. These expressions can be either variables (to show their value) or arithmetic
expressions (to show their result).

In the Registers area you can explore and modify the value of the processor and the
peripherals registers. In the following image you can see the Core registers including the
PC (Program Counter), SP (Stack Pointer), LR (Link Register), xPSR (Processor Status
Register) and the regular registers (R0-R12).

10
Microcontrollers
2019/2020

Finally, in the Breakpoints area you can create, modify and delete breakpoints. A
breakpoint is a special instruction, either hardware or software, that is inserted by the
debug probe in the code and allows to stop the processor before a given instruction is
executed, thus allowing the programmer to explore (and change!) the contents of the
CPU registers and RAM memory. Since the MSP432P4111 is based on the ARM Cortex-
M4F only 4 hardware breakpoints are supported. The XDS110 USB Debug Probe can also
create additional software breakpoints, but the performance is affected as the debugger
must keep track of every instruction being executed.

The Code area displays (green) the line of code that is about to being executed. In this
example the debugger is stopped in line 13, waiting to execute the “P1->OUT &= ~BIT0”
line. Notice that you can create or remove breakpoints by double-clicking on the
appropriate number in the line numbers.

The Disassembly area contains the assembler version of the code. By default the
Disassembly area is not shown, but it can be enabled by clicking on “Window – Show
view – Disassembly”

11
Microcontrollers
2019/2020

The Memory Browser area allows to display the contents of the RAM and Flash memory
inside the MSP432P4111. As displayed in the next image, the contents of the address
0x2003FFF8 are 0x00004C55. Notice that you can use the drop-down menu to change
the memory contents format. For example, you can select “Character” to display arrays
of characters in a human-readable form.

Finally, the Terminal area allows to establish a Serial connection with the Target System.
In this case the Serial connection is established through the XDS110 USB Debug Probe
backchannel.

As displayed in the next image, by clicking the “Launch Terminal” button ( ) we can
create a Serial connection with the appropriate port, baud rate, data size, parity and
stop bytes.

12
Microcontrollers
2019/2020

Now that we have reviewed the different Debug areas we can start running the program
by pressing the “Run/Resume” button ( ) on the top menu. Alternatively, you can
start running the program by using the F8 keyboard button.
While running, you can pause or stop the program execution by pressing the “Pause” (
) or “Stop” ( ) buttons respectively. Alternatively, you can pause or stop the
program using the ALT+F8 and CTRL+F2 keyboard shortcuts.
When paused you can also execute the program code step-by step using the “Step Into”
( ), “Step Over” ( ) or “Step Return” ( ) buttons in the top menu. The meaning of
each button is described next:

 Step Into: Enters the next method call at the currently executing line of code.
 Step Over: Skips the next method at the currently executing line of code. Despite
the method is not stepped into, the code will execute normally.
 Step Return: Returns from a method which has been stepped into. The
remaining of the code in the method will be executed normally.
In addition to using the menu, these debugging functions can also be executed using the
keyboard by pressing the F5, F6 and F7 keyboard buttons.
It is also possible to step through the disassembled code in the Disassembly window by
using the “Assembly step into” ( ) and the “Assembly step over” ( ) buttons.
While the target is stopped it is also possible to restart the execution of the project by
pressing the “Restart” button ( ).
Once you have debugged the project return to the “CCS Edit” perspective by clicking the

icon on the top right are of the Code Composer Studio window.

13

You might also like