EasyManua.ls Logo

Texas Instruments TMS320 User Manual

Texas Instruments TMS320
288 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #178 background imageLoading...
Page #178 background image
Timers, Interrupts, and the System Clock
4-74
To do the same thing on C28x platforms with a 40 MIPS processor using the
CPU to drive the clock, the period register value is:
Period = 0.001 sec * 40,000,000 cycles per second = 40,000
4.9.2 System Clock
Many DSP/BIOS functions have a timeout parameter. DSP/BIOS uses a
system clock to determine when these timeouts should expire. The system
clock tick rate can be driven using either the low-resolution time or an external
source.
The TSK_sleep function is an example of a function with a timeout parameter.
After calling this function, its timeout expires when a number of ticks equal to
the timeout value have passed in the system clock. For example, if the
system clock has a resolution of 1 microsecond and we want the current task
to block for 1 millisecond, the call should look like this:
/* block for 1000 ticks * 1 microsecond = 1 msec */
TSK_sleep(1000)
Note:
Do not call TSK_sleep or SEM_pend with a timeout other than 0 or
SYS_FOREVER if the program is configured without something to drive the
PRD module. In a default configuration, the CLK module drives the PRD
module.
If you are using the default CLK configuration, the system clock has the same
value as the low-resolution time because the PRD_clock CLK object drives
the system clock.
There is no requirement that an on-device timer be used as the source of the
system clock. An external clock, for example one driven by a data stream
rate, can be used instead. If you do not want the on-device timer to drive the
low-resolution time, destroy the CLK object named PRD_clock in the
configuration script. If an external clock is used, it can call PRD_tick to
advance the system clock. Another possibility is having an on-device
peripheral such as the codec that is triggering an interrupt at regular intervals,
call PRD_tick from that interrupt’s HWI. In this case, the resolution of the
system call is equal to the frequency of the interrupt that is calling PRD_tick.

Table of Contents

Other manuals for Texas Instruments TMS320

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments TMS320 and is the answer not in the manual?

Texas Instruments TMS320 Specifications

General IconGeneral
BrandTexas Instruments
ModelTMS320
CategoryComputer Hardware
LanguageEnglish

Summary

IMPORTANT NOTICE

Read This First

About This Manual

Describes the DSP/BIOS v5.40, its purpose, and companion documents.

Notational Conventions

Explains the document's typographical and symbolic conventions for clarity.

Chapter 1 About DSP/BIOS

DSP/BIOS Features and Benefits

Details the advantages of DSP/BIOS, including reduced code size and improved performance.

DSP/BIOS Components

Overviews the DSP/BIOS architecture including Configuration Tool and Analysis Tools.

Naming Conventions

Defines naming rules for modules, objects, operations, and data types in DSP/BIOS.

For More Information

Points to additional resources for further information on DSP/BIOS and related topics.

Chapter 2 Program Generation

Creating and Building a CCSv4 Project for DSP/BIOS Applications

Guides through the process of creating and building DSP/BIOS projects in CCSv4 IDE.

Converting CCSv3.3 Projects to CCSv4 Projects

Provides instructions for migrating existing CCSv3.3 DSP/BIOS projects to CCSv4.

Configuring DSP/BIOS Applications Statically

Explains how to configure DSP/BIOS objects and properties statically for optimal performance.

Creating DSP/BIOS Objects Dynamically

Details how to create and delete DSP/BIOS objects dynamically at runtime for flexibility.

Files Used to Create DSP/BIOS Programs

Lists and describes the various files involved in creating a DSP/BIOS application.

Using Makefiles to Build Applications

Explains how to build DSP/BIOS executables using makefiles as an alternative to CCS projects.

Using DSP/BIOS with the Run-Time Support Library

Discusses the integration and usage of DSP/BIOS with the C run-time support library.

DSP/BIOS Startup Sequence

Describes the step-by-step process of DSP/BIOS application startup and initialization.

Using C++ with DSP/BIOS

Addresses issues and considerations for developing C++ applications with DSP/BIOS.

User Functions Called by DSP/BIOS

Outlines conventions for user functions called by DSP/BIOS objects to ensure proper operation.

Calling DSP/BIOS APIs from Main

Guides on which DSP/BIOS APIs can be safely called from the main routine during initialization.

Chapter 3 Instrumentation

An Overview of Real-Time Analysis

Introduces real-time analysis concepts and its importance in system operation.

Real-Time Analysis Tools in CCStudio v4.x

Describes the Real-Time Analysis (RTA) tools available within CCStudio for debugging.

Runtime Object Viewer (ROV)

Explains the ROV tool for inspecting application state information at stop points.

Instrumentation Performance

Discusses the impact of instrumentation on application performance and optimization techniques.

Instrumentation APIs

Details the LOG, STS, and HST API modules for gathering and controlling instrumentation data.

Implicit DSP/BIOS Instrumentation

Explains how DSP/BIOS automatically provides instrumentation for analysis tools like CPU load.

Instrumentation for Field Testing

Discusses using DSP/BIOS instrumentation for production systems and field diagnostics.

Real-Time Data Exchange

Covers RTDX for real-time, continuous visibility into DSP application operation.

Chapter 4 Thread Scheduling

Overview of Thread Scheduling

Introduces threads, their types, priorities, and interaction within DSP/BIOS applications.

Hardware Interrupts

Details how hardware interrupts handle critical processing and manage hardware interactions.

Software Interrupts

Explains software interrupts (SWI) for handling tasks with less severe real-time deadlines.

Tasks

Describes DSP/BIOS task objects (threads) managed by the TSK module for dynamic scheduling.

The Idle Loop

Explains the idle loop as the background thread for low-priority, non-critical tasks.

Power Management

Covers the DSP/BIOS Power Manager (PWRM) module for reducing application power consumption.

Semaphores

Details semaphores for intertask synchronization and communication based on resource availability.

Mailboxes

Explains mailboxes for structured sending and receiving of variable length messages.

Timers, Interrupts, and the System Clock

Discusses on-device timers, system clock, and timing methods in DSP/BIOS.

Periodic Function Manager (PRD) and the System Clock

Covers scheduling periodic functions based on I/O availability or programmed events using PRD.

Chapter 5 Memory and Low-level Functions

Memory Management

Details the Memory Section Manager (MEM module) for managing named memory segments and allocation.

System Services

Describes the SYS module for basic system services like halting execution and error handling.

Queues

Explains the QUE module for managing lists of queue elements, often used for FIFO lists.

Chapter 6 Input/Output Methods

I/O Overview

Introduces application-level I/O handling via streams, pipes, message queues, and host channels.

Comparing Pipes and Streams

Compares the pipe and stream models for data transfer supported by DSP/BIOS.

Comparing Driver Models

Details the IOM and SIO/DEV device driver models for communicating with DSP peripherals.

Data Pipe Manager (PIP Module)

Explains the PIP module for managing block I/O, including writer/reader ends and data notification.

Message Queues

Covers the MSGQ module for structured sending and receiving of variable length messages, especially for multi-processor systems.

Host Channel Manager (HST Module)

Describes the HST module for streaming data between the target and host files via SIO streams.

I/O Performance Issues

Discusses performance considerations for I/O operations, including HST data transfer.

Chapter 7 Streaming I/O and Device Drivers

Overview of Streaming I/O and Device Drivers

Introduces device drivers using the DEV_Fxns model and the SIO module for streaming I/O.

Creating and Deleting Streams

Explains how to create and delete streams statically in configuration or dynamically at runtime.

Stream I/O—Reading and Writing Streams

Details the standard and Issue/Reclaim models for streaming data read/write operations.

Stackable Devices

Covers the SIO module's capabilities for creating virtual I/O devices by stacking drivers.

Controlling Streams

Explains how to control streams using SIO_ctrl, SIO_idle, and SIO_flush for device communication.

Selecting Among Multiple Streams

Describes SIO_select for waiting on I/O operations across multiple streams without blocking.

Streaming Data to Multiple Clients

Discusses efficient multi-cast data transmission to multiple clients using SIO streams.

Streaming Data Between Target and Host

Covers configuring host channel objects (HST) for streaming data between target and host files.

Device Driver Template

Presents an example device driver template (Dxx) with C code and pseudocode for operations.

Streaming DEV Structures

Details the DEV_Fxns and DEV_Frame structures used by SIO and device drivers for buffer management.

Device Driver Initialization

Explains the Dxx_init function for performing hardware initialization and static driver setup.

Opening Devices

Guides on opening Dxx devices using SIO_create and Dxx_open, including parameter handling.

Real-Time I/O

Describes the DEV_STANDARD and DEV_ISSUERECLAIM models for real-time I/O operations.

Closing Devices

Explains how to close devices using SIO_delete, which calls Dxx_idle and Dxx_close.

Device Control

Details the SIO_ctrl function for performing control operations on a device via Dxx_ctrl.

Device Ready

Explains Dxx_ready called by SIO_select to determine if a device is ready for I/O operations.

Types of Devices

Differentiates between terminating and stackable devices and their implementations.

Related product manuals