CS 350 Ohio State University TI Code Composer Studio Computer Programming Task
Overview
In this lab, you will use TI Code Composer Studio (CCS) to program the TC CC3220x LAUNCHXL to send a Morse code message via the LED using a synchronous state machine. This work will build on the concepts you learned during your activities in the zyBook this week.
During this milestone, you will use CCS to edit, compile, and load code into the CC32xx board. You will then proceed to use it for debugging. Throughout this process, you explore the components of a CCS project and the CCS code generator (system config). You will also be able to learn more about the timer and interrupt drivers.
Goal: Your objective is to blink the green, yellow, and red LEDs in the lower right corner of the board (the corner opposite the USB connector). Design a synchronous state machine that creates a pattern of blinking lights from the LEDs. This pattern should contain a message in Morse code. When a button is pressed, the Morse code message of the blinking LEDs should change.
Prompt
Begin your work by accessing the
Milestone Three Timer Interrupt Lab Guide PDF
document. While this document was written for a Windows interface, the tools can be used on Mac or Linux as well. You may also watch the
Project Example Video
or its
transcript Word Document
to gain a better understanding of what you are creating. Note that to accomplish the work outlined in the guide, you will need the following:
TI CC3220x LAUNCHXL
TI Code Composer Studio (installed)
USB connection between the PC and board
Specifically, you must address the following rubric criteria:
Develop code for all of the specified functionality. The goal of this criteria is for the code to result in the expected functionality (note how this is different from the state machine functionality). This includes functionality of both the state machine and the button change.
Create code that initializes the timer and uses it to drive the state machine.
Discuss the lab questions. Address all the questions thoroughly and thoughtfully, with supporting evidence from your work.
Apply coding best practices in formatting, commenting, and functional logic.
CS 350 Milestone Three Timer Interrupt Lab Guide
1. Open TI Code Composer Studio (CCS). If you have not installed CCS, please install CCS by following
installation guidance in Module One of your course. After CCS is installed, you can open it by clicking
Code Composer Studio xxxx, which can be found in the Texas Instruments folder. The CCS installer
also added a Code Composer Studio icon on your desktop. It looks like a red die. You can click on
that icon to open CCS as well.
2. Select a workspace then click Launch. It is very important that you take note of your workspace
location. You will need the information later in order to turn in your project.
3. Open the Getting Started window in CCS. CCS takes about 30 seconds to fully open (it’s written in
Java). You can review the loading process by looking at the lower right corner of the screen. You will
see green progress bars popping up. After about 30 seconds, CCS should be fully loaded and you will
not see any green progress bars.
4. Open the Resource Explorer by clicking on the Resource Explorer box (with the compass). In the
Resource Explorer, find Software in the left pane. Click on the arrow to expand Software. Then, find
the SimpleLink CC32xx SDK and expand it. Next, similarly locate and expand Examples, Development
Tools, CC3220S Launchpad, and TI Drivers.
5. You should already have the SDK installed, which is indicated by a check mark by the SimpleLink
CC32xx SDK.
6. Import the gpiointerrupt project. To accomplish this, begin by expanding the SimpleLink CC32xx SDK,
then the Examples folder, Development Tools, CC3220S LaunchPad, and finally TI Drivers. From
here, locate the gpiointerrupt folder. Then the No RTOS sub-folder followed by the CSS Compiler. In
here you will find the gpiointerrupt item illustrated with a red die icon.
7. Click on the three dots icon next to gpiointerrupt, then click Import to CCS IDE. From the Select a
Target window that appears, choose CC3220S and click Apply to load the example into the CCS
workspace.
8. Review the project. Note that you will only need to change the contents of gpiointerrupt.c for this
lab.
9. Next, build the code by selecting Project from the top menu options. Then click Build All.
10. Add a timer driver to the project using system config. TI provides a tool called system config for
adding and configuring drivers in your project. To open the tool, double-click on the
gpiointerrupt.syscfg file in the project.
11. To add the timer driver to the project, click the plus sign next to Timer in the TI Drivers list.
12. For this project, we will need a timer that is 32 bits. The default will likely say 16 bits, and if that is
the case, click the drop down next to Timer Type. Then select 32 bits.
13. Rebuild the code following the same process outlined in step 9. Then integrate the following code
into gpiointerrupt.c.
#include
void timerCallback(Timer_Handle myHandle, int_fast16_t status)
{
}
void initTimer(void)
{
Timer_Handle timer0;
Timer_Params params;
Timer_init();
Timer_Params_init(¶ms);
params.period = 1000000;
params.periodUnits = Timer_PERIOD_US;
params.timerMode = Timer_CONTINUOUS_CALLBACK;
params.timerCallback = timerCallback;
timer0 = Timer_open(CONFIG_TIMER_0, ¶ms);
if (timer0 == NULL) {
/* Failed to initialized timer */
while (1) {}
}
}
if (Timer_start(timer0) == Timer_STATUS_ERROR) {
/* Failed to start timer */
while (1) {}
}
14. After working through this process, you will need to address the following questions:
x What is the purpose of the timerCallback() function?
x What does period mean in this context?
x How does the Timer_CONTINUOUS_CALLBACK parameter impact the driver?
x What is gpioButtonFxn0() used for?
x What is the purpose of GPIO_CFG_IN_INT_FALLING?
15. Now it is time to modify gpiointerrupt.c and the code provided in step 13. Your code will need to
accomplish the following:
x Call your state machine every 500000 us.
x Continuously blink SOS in Morse code on the green and red LEDs.
x If a button is pushed, toggle the message between SOS and OK. Pushing the button in the
middle of a message should NOT change the message until it is complete. For example, if
you push the button while the ‘O’ in SOS is being blinked out, the message will not change
to OK until after the SOS message is completed. Remember in a previous module your work
with UART included an example of how to turn an LED on or off (as opposed to toggle).
16. You may wish to perform your own research on how Morse code works to help better inform your
work. The following guidance will help provide a base for the functionality you are creating:
x Dot = red LED on for 500ms
x Dash = green LED on for 1500ms
x 3*500ms between characters (both LEDs off)
x 7*500ms between words (both LEDs off), for example SOS 3500ms SOS
17. Remember, if a button is pushed at any time during a message, the new message will not start until
the end of the 7*500ms gap between messages. The following example assumes the button is
pushed during the first SOS and during the last 3500ms.
SOS 3500ms OK 3500ms OK 3500ms OK 3500ms SOS
18. Make sure you pay attention to the button you select for this work. The button next to the USB
cable is the reset button and should not be pressed. Instead, select either of the buttons located
opposite each other near the middle of the board. The LEDs are located in the corner diagonally
opposite the USB cable.
19. As you work, remember: the easiest method for executing your code is to use the debug icon (green
bug). Clicking the debug icon will load the code into the board and put the tool into debug mode.
Once in debug mode, six additional icons become live.
Debug your code
Execute your code
Exit debug mode
Step into
Step over
Step out
Halt the code
20. You will need to create a state machine in order to successfully complete this work. Remember, part
of your submission will also involve creating a video that demonstrates the functionality you have
constructed. Make sure you push the button during the video so you can show what happens.
21. You will also need to zip your workspace and submit the ZIP file. Your workspace is the directory you
selected when opening CCS. In the provided example, you would zip the workspace_v10 folder and
submit the resulting ZIP file.
22. Congratulations! You have now completed this lab guide. Remember to refer to the Milestone Three
Guidelines and Rubric in your course to ensure you have all the necessary components for your
required submission to Brightspace.
Top-quality papers guaranteed
100% original papers
We sell only unique pieces of writing completed according to your demands.
Confidential service
We use security encryption to keep your personal data protected.
Money-back guarantee
We can give your money back if something goes wrong with your order.
Enjoy the free features we offer to everyone
-
Title page
Get a free title page formatted according to the specifics of your particular style.
-
Custom formatting
Request us to use APA, MLA, Harvard, Chicago, or any other style for your essay.
-
Bibliography page
Don’t pay extra for a list of references that perfectly fits your academic needs.
-
24/7 support assistance
Ask us a question anytime you need to—we don’t charge extra for supporting you!
Calculate how much your essay costs
What we are popular for
- English 101
- History
- Business Studies
- Management
- Literature
- Composition
- Psychology
- Philosophy
- Marketing
- Economics