E71 Lab 3 - C2000  Intro

The goal this week is to become familiar enough with a Texas Instruments TMS320F2806 Piccolo processor and the Code Composer development system to be able to compile, download and run programs.  You may want to start the lab while Ed Jaoudi and I are here in case there are any problems getting the hardware and software operating.

The only file you will need to edit is the one called "E71Shell.c."  Change any of the other files at your own risk.

Task 1: Getting hardware and software to work

Don't edit any files for this task.  The goal is just to familiarize yourself with the hardware/software environment.

  1. Connect the C2000 peripheral explorer board to any of the PC's in Hicks 310 and make sure it is turned on (an LED should be on - if not toggle the power switch).
  2. Download the file "E71C2000Lab1.zip" onto the desktop, right click on it and select "ExtractAll..."
  3. Start Code Composer Studio (there should be an icon on the desktop). If your are asked for an administrator password to continue, get Ed Jaoudi to help you out.  The program can take some time to start.
  4. The first thing Code Composer needs is for you to select a workspace. This is a folder where all the necessary files will be stored. Create a folder and select it.
  5. After code composer starts, you will get the Welcome screen with the label "Getting Started". Click on "Import Project".
  6. Make sure the "Copy projects into workspace" box is checked (this will copy files onto your project folder- if you don't do this you will have problems later). Choose the folder labelled "E71C2000Lab1" within the folder you unzipped your files into in step 2, then hit "Finish". Note: on my computer this was a subfolder withing the top level folder.
  7. To run the code, select "Project→Build Active Project." This takes quite a while the first time because all components of the program must be compiled, but is faster subsequently.
  8. Open the file "C28069.ccxml" in the left pane of the debugger by double clicking on it.
  9. In the window labeled "Basic," for "Connection" choose "Texas Instruments XDS100v1 USB Emulator" use the pull-down menu to find "Experimenter's Kit - Piccolo F28069," and fill in the check box.   Hit "Save" on the right side of the window.
  10.  Switch to the "Debug" perspective (in the upper right of the screen, there should be two choices, Debug and C/C++. If there are not click on the "Open Perspective" icon () and choose "Debug."
  11.  Go to "Target→Debug Active Project," this will send the compiled program to the C2000 board.
  12. Go to "Target→Run." The program is now running. The middle (of three) LED's on the control card should be blinking at 1Hz.
  13. Connect headphones to the "headphone out" jack. You should hear a tone near middle C in the left earpiece. The volume changes at a 1Hz rate.
  14. Attach the output to an oscilloscope and display the signal.  Measure its frequency (the scope will do this for you).  Save the oscilloscope display (showing signal frequency) for your report.

Task 2: Programming the AIC

Edit only the file "E71Shell.c" for this task.

  1. Change the AIC initialization code (i.e., the function "InitAIC23") so that the sampling rate is 8kHz.  (AIC23 folder, data sheet)
  2. Measure  (roughly) at what rate the middle LED is blinking.  Record this result.
  3. Change the function "E71func" to get a 200 Hz square wave and display it on the oscilloscope.  Record this result as before.

Task 3: Sampling and Aliasing

Edit only the file "E71Shell.c" for this task.

  1. Before connecting to the "Peripheral Explorer Board," connect a signal generator to the oscilloscope and set it to be a 1kHz sine wave, 1V peak to peak, and centered around ground (make sure the scope is "dc coupled").
  2. Change the AIC initialization code so that the sampling rate is back to 44.1kHz.
  3. Change the function "E71func" so that the values read from the ADC are sent out to the DAC.  ADC values are read in the function "MRINTA_ISR" in the file "DefaultIsr.c."  Change "DefaultIsr.c" at your own risk!
  4. Display and record the input and output signals at 125 Hz, 1.25 kHz, 6 kHz, 12.5 kHz and 25 kHz..
  5. Keep the sampling rate at 44.1 kHz, but change the function "E71func" so that only every 2nd value from the ADC is sent to the DAC (this essentially changes the sampling rate to 22.05 kHz).  Repeat the previous measurements at the different frequencies.
  6. Keep the sampling rate at 44.1 kHz, but change the function "E71func" so that only every 8th value from the ADC is sent to the DAC.  Again, repeat the previous measurements again, for the last time.
  7. Record direct evidence (i.e., not related to aliasing) from the oscilloscope screen to show that the sampling rate is as you expect.  For the slower sampling rates, the output should exhibit distinct steps.
  8. Slowly sweep the frequency from 10 kHz to 20 kHz with the scope set at 500μS/div and observe the input and output waveforms.  What happens to the output signal as the frequency of the input signal increases?

To Turn in:

In general I don't expect a lot of prose in the report, but you should strive to be clear.

Task 1: 

Task 2:

Task 3: