English
Language : 

ISDN Datasheet, PDF (6/14 Pages) Texas Instruments – ISDN Basic Rate Interface Software for the HPC16400E High Performance Data Communications Microcontroller
2 0 Functional Description (Continued)
Procedures The Terminal Device Driver interfaces the HPC
Once a task is started it continues to run until it does a
on-board UART to the ISDN Software Device initialization
Semaphore Wait ReadMail or Return or until a higher pri-
sequences service request tasks and accompanying inter-
ority task is put on the Ready Queue at which time the
rupt service routines are all defined in the I O Device Driver
scheduler has the opportunity to once again choose the
section of this document
task at the head of prioritized Ready Queue and run that
The Layer Protocol Tasks implement the ISDN DATA LINK
task
Layer 2 and the NETWORK Layer 3 requirements for the
A task may change the priority of any task including itself
HPC ISDN system These tasks are designed to be hard-
The priority change takes place immediately to the extent
ware configuration and application independent The Layer
that the target task’s TCB is updated with the new priority
2 Task provides both the ‘‘USER SIDE’’ and the ‘‘NET-
and the queue in which the target task’s TCB is waiting is
WORK SIDE’’ implementation of the CCITT Specification
resorted to reflect the new priority
Q 921 The Layer 3 Task provides the ‘‘USER SIDE’’ imple-
mentation of CCITT Specification Q 931
If the target task is in the Ready Queue and its new priority
is higher than the priority of the running task then the target
The Layer 2 Task has been designed to use many of the
task will run once all protected sections are exited See
same routines to implement the link access procedures on
Section 2 2 3 below
either the signaling D channel or the bearer B channel
(LAPD or LAPB) Design decisions have also been made to
facilitate the implementation of V 120 the rate adaption pro-
tocol that processes LAPD frames on a bearer B channel
The Management Entity Task and the Call Control Task are
Application (Specific) Tasks that are closely coupled to the
specific system hardware configuration and the Central Of-
fice Network Entity Software These tasks are provided for
demonstration purposes to drive the ISDN layer entities Ap-
te plication users must either replace or extensively rewrite
these tasks to match their particular ISDN Application envi-
ronment
The System Utilities include the power-up reset Main Task
the NMI handler the Timer interrupt handler and the
Watchdog Task
The Tracer utility provides the capability of on-line tracing of
le intertask mail messages and task states Tracer is primarily
a passive task it displays messages that it receives from
other tasks Tracer also provides a user interface for Tele-
phone Simulation
The remainder of this document is devoted to defining each
of the software elements at the functional level Where ap-
plicable specific ISDN standard documents such as CCITT
o Q 921 Q 931 and X 25 will be referenced rather than dupli-
cating the information here
2 2 HPC EXECUTIVE
The HPC Executive provides a multitasking environment
s within which the ISDN and applications tasks can run and it
provides various system services to those tasks The serv-
ices of the Executive are available to both tasks and inter-
rupt service routines
b 2 2 1 Tasks Priorities and the Ready Queue
A task is a subroutine which can be run (called) by the Exec-
utive Tasks are managed by the Executive as Task Control
Blocks (TCB’s) A task’s TCB contains all the parameters
needed by the Exeuctive to handle the task in particular
O the task’s priority and its current starting address
2 2 2 Semaphores
A semaphore is a global variable accessed through the Ex-
ecutive which can be Signaled (incremented) by one task
and Waited on by another task A semaphore is typically
used to manage the sharing between tasks of some re-
source e g an I O device mail messages etc At any mo-
ment the value of a semaphore may be positve negative or
zero A positive value indicates the number of resources
available a negative value indicates the number of tasks
waiting for resources and a zero value indicates that there
are no resources available and no tasks waiting for them
When a task Waits on a semaphore if the semaphore has a
nonzero positive value the task will immediately go on the
Ready Queue and the semaphore value will be decrement-
ed by one On the other hand if the semaphore has a zero
or negative value the task will be queued on the semaphore
and the semaphore value will be decremented by one
When a task Signals a semaphore the semaphore’s value
is incremented by one and the highest priority task waiting
on the semaphore is put on the Ready Queue
A common use for a semaphore is the management of a
non-shareable resource such as an I O device When the
device is available the associated semaphore has the value
a1 When a task wishes to obtain exclusive use of the de-
vice it Waits on the semaphore which is then decremented
to 0 with the task going immediately back on the Ready
Queue If another task then attempts to use the device its
Wait call will cause it to be placed on the Semaphore Queue
and the value of the semaphore will be decremented to b1
Other tasks may also Wait on the semaphore each decre-
menting its value by one The negative value of the sema-
phore indicates the number of tasks Waiting for the device
The waiting tasks are ordered in the semaphore queue ac-
cording to their priority When the first task is done with the
device it Signals the semaphore which moves the first wait-
ing task to the Ready Queue and increments the sema-
phore or if there are no waiting tasks returns the sema-
phore to its original value of a1
Tasks which are not blocked waiting for a semaphore or for
2 2 3 Preemptive Scheduling
mail are considered to be ready to run and their TCB’s are
queued on the Ready Queue in the order of the tasks’ prior-
ities The Task Scheduler runs the task at the head of the
Ready Queue i e the highest priority task that is ready to
run In this way the processor is always given to the highest
priority task that is ready to run
Preemptive scheduling enables the executive to respond
quickly to high priority events If a task that is waiting on a
Semaphore Queue modes to the Ready Queue and if that
task is of higher priority than the currently running task
then as soon as the currently running task emerges from all
critical sections and non-preempt sections the currently
running task will stop running The task that was moved to
the Ready Queue will run The preempted task will be
placed on the Ready Queue in the normal manner
5