Lab 7d – Creating a CDC Push Button App
Lab 7d – Creating a CDC Push Button App
We have experimented with three example USB applications. It’s finally time to build one from
“scratch”. Well, not really from scratch, since we can start with the “Empty USB Example”.
The goal of our application is to send the state of the Launchpad button to a virtual serial (CDC)
comm port in Windows. Thus, we’ll use a CDC class driver. This application will borrow from a
number of programs we’ve already written:
GPIO – We will read the push button and light the LED when it is pushed. Also, we’ll send
“DOWN” when it’s down and “UP” when it’s up.
Timer – We’ll use a timer to generate an interrupt every second. In the Timer ISR we’ll set a flag.
When the flag is TRUE, we’ll read the button and send the proper string to the host.
CDC Simple Send Example – we’ll borrow a bit of code from the CDC example we just ran to
‘package’ up our string and send it via USB to the host.
Finally, we’re going to start by following the first 3 steps provided in TI Resource Explorer for the
Empty USB Example.
Import Empty USB Project Steps
1. Import the Empty USB Project.
As it states in the Resource Explorer, DO NOT RENAME the project (yet).
MSP430 Workshop - USB Devices 7 - 41