Texas Instruments TMS320 User Manual page 108

Dsp/bios v5.40
Hide thumbs Also See for TMS320:
Table of Contents

Advertisement

Overview of Thread Scheduling
4.1.2
Choosing Which Types of Threads to Use
4-4
❏ Data notification functions. Performed when you use pipes (PIP) or
host channels (HST) to transfer data. The functions are triggered when a
frame of data is read or written to notify the writer or reader. These
functions are performed as part of the context of the function that called
PIP_alloc, PIP_get, PIP_free, or PIP_put.
The type and priority level you choose for each thread in an application
program has an impact on whether the threads are scheduled on time and
executed correctly. DSP/BIOS static configuration makes it easy to change a
thread from one type to another.
Here are some rules for deciding which type of object to use for each task to
be performed by a program:
❏ SWI or TSK versus HWI. Perform only critical processing within
hardware interrupt service routines. HWIs should be considered for
processing hardware interrupts (IRQs) with deadlines down to the
5-microsecond range, especially when data may be overwritten if the
deadline is not met. Software interrupts or tasks should be considered for
events with longer deadlines—around 100 microseconds or more. Your
HWI functions should post software interrupts or tasks to perform lower-
priority processing. Using lower-priority threads minimizes the length of
time interrupts are disabled (interrupt latency), allowing other hardware
interrupts to occur.
❏ SWI versus TSK. Use software interrupts if functions have relatively
simple interdependencies and data sharing requirements. Use tasks if the
requirements are more complex. While higher-priority threads can
preempt lower priority threads, only tasks can wait for another event, such
as resource availability. Tasks also have more options than SWIs when
using shared data. All input needed by a software interrupt's function
should be ready when the program posts the SWI. The SWI object's
mailbox structure provides a way to determine when resources are
available. SWIs are more memory efficient because they all run from a
single stack.
❏ IDL. Create background functions to perform noncritical housekeeping
tasks when no other processing is necessary. IDL functions do not
typically have hard deadlines. Instead, they run whenever the system has
unused processor time.
❏ CLK. Use CLK functions when you want a function to be triggered directly
by a timer interrupt. These functions run as HWI functions and should take
minimal processing time. The default CLK object, PRD_clock, causes a
tick for the periodic functions. You can add additional CLK objects to run
at the same rate. However, you should minimize the time required to
perform all CLK functions because they run as HWI functions.

Advertisement

Table of Contents
loading

Table of Contents