Clk lab, college study notes - Lab work for the clk, Study notes of Operating Systems

Study Material. This lab module will help you become familiar with the TI DSP/BIOS CLK module and system clock. CLK Lab, Connexions Web site. http://cnx.org/content/m36664/1.1/, Jan 7, 2011. David, Waldo, Lab, Module, Prerequisites, Reading, Laboratory, Scheduling, Insert TSK, Code, composer, Task, Function, Test, Clock, Simulator.

Typology: Study notes

2011/2012

Uploaded on 10/20/2012

christina
christina 🇺🇸

4.6

(23)

393 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Connexions module: m36664 1
CLK Lab
David Waldo
This work is produced by The Connexions Project and licensed under the
Creative Commons Attribution License
Abstract
This module is the lab work for the CLK module.
1 Introduction
This lab module will help you become familiar with the TI DSP/BIOS CLK module and system clock.
2 Lab Module Prerequisites
None
3 Reading
SPRU423 TMS320 DSP/BIOS Users Guide. Read the section on Timers, Interrupts, and the System
Clock
4 Laboratory
DSP/BIOS provides two methods of tracking time, the high and low resolution clock managed by the CLK
module and the system clock. In this lab the default conguration for the CLK module and system clock
will be used. In this case the system clock and the low resolution clock will be the same.
In this section you are going to nd the number of counts per millisecond for the CLK module. You will
also measure how long it takes a loop in your program to loop 100 times. Then you will measure how long
it takes a loop in your program to loop 1000 times.
This description assumes you are using CCS v4 or higher and a simulator for the hardware. The simulator
is the C6713 Device Cycle Accurate Simulator.
Follow the procedure in Code Composer Studio v4 DSP/BIOS Project
1
to create a new CCS DSP/BIOS
project. Name the project
clklab
. Your project should have a DSP/BIOS conguration le named
clklab.tcf
.
Add a task to the conguration le. This is part of the TSK module but you don't need to know about
the module to be able to do this lab. Add a task by right clicking on
Scheduling-
>
TSK
and selecting
Insert TSK
. A new task should be added called
TSK0
.
Version 1.1: Jan 7, 2011 12:19 pm US/Central
http://creativecommons.org/licenses/by/3.0/
1
"Code Composer Studio v4 DSP/BIOS Project" <http://cnx.org/content/m36660/latest/>
http://cnx.org/content/m36664/1.1/
pf2

Partial preview of the text

Download Clk lab, college study notes - Lab work for the clk and more Study notes Operating Systems in PDF only on Docsity!

Connexions module: m36664 1

CLK Lab

David Waldo

This work is produced by The Connexions Project and licensed under the Creative Commons Attribution License †

Abstract This module is the lab work for the CLK module.

1 Introduction

This lab module will help you become familiar with the TI DSP/BIOS CLK module and system clock.

2 Lab Module Prerequisites

None

3 Reading

  • SPRU423 TMS320 DSP/BIOS Users Guide. Read the section on Timers, Interrupts, and the System Clock

4 Laboratory

DSP/BIOS provides two methods of tracking time, the high and low resolution clock managed by the CLK module and the system clock. In this lab the default conguration for the CLK module and system clock will be used. In this case the system clock and the low resolution clock will be the same. In this section you are going to nd the number of counts per millisecond for the CLK module. You will also measure how long it takes a loop in your program to loop 100 times. Then you will measure how long it takes a loop in your program to loop 1000 times. This description assumes you are using CCS v4 or higher and a simulator for the hardware. The simulator is the C6713 Device Cycle Accurate Simulator.

  • Follow the procedure in Code Composer Studio v4 DSP/BIOS Project^1 to create a new CCS DSP/BIOS project. Name the project clklab. Your project should have a DSP/BIOS conguration le named clklab.tcf.
  • Add a task to the conguration le. This is part of the TSK module but you don't need to know about the module to be able to do this lab. Add a task by right clicking on Scheduling->TSK and selecting Insert TSK. A new task should be added called TSK0. ∗Version 1.1: Jan 7, 2011 12:19 pm US/Central †http://creativecommons.org/licenses/by/3.0/ (^1) "Code Composer Studio v4 DSP/BIOS Project"

http://cnx.org/content/m36664/1.1/

Connexions module: m36664 2

  • Specify the function the task will run by right clicking on TSK0 and bringing up its properties. On the Function tab next to Task Function type in the function name _testClock. This will specify the C function testClock as the function it will call.
  • Create a main.c le and add a main function that does nothing and a function testClock. Include this le in your project. The structure of the le is

#include #include #include

main() { }

testClock() { /* your code here */ }

  • Create a LOG object called trace. In the conguration le, right click on Instrumentation->LOG and select Insert LOG. This will create a LOG object which you can rename trace. Use the default length of 64 and the logtype circular. All text prints will be performed using the function LOG_printf and the trace object.
  • In the testClock function add code that does the following:
  1. Get the number of counts per millisecond and then print the value to the trace LOG object.
  2. Get the period register value and then print the number.
  3. Write a for loop that loops 100 times. Find and print the number of high resolution ticks it takes to run the loop. Do this by getting the clock value before the loop and after the loop and subtracting them to get the dierence. Inside the loop multiply the loop counter by a constant and put it in a variable. This is just to do something in the loop.
  4. Write another for loop that loops 1000 times. Find and print the number of high resolution ticks it takes to run the loop.Do this by getting the clock value before the loop and after the loop and subtracting them to get the dierence. Inside the loop multiply the loop counter by a constant and put it in a variable. This is just to do something in the loop.
  • Start the debug session. In order to see the print results to the LOG objects you need to select Tools->RTA->Printf Logs. This will open a window that shows the output to the LOG objects.
  • Run the program and record the results.
  • Verify that the counts per ms are what you expected.

5 Laboratory Write-up

  • Show the calculations for the counts per millisecond. Compare the calculations to the output of the program.
  • How long did the 100 loop take in ms? How long did the 1000 loop take in ms? Compare the times and see if they make sense.

http://cnx.org/content/m36664/1.1/