You are on page 1of 5

Design of Digital Telephone System oriented for

Training
Bin Zhang DanHong Zhang Pan Yu Huajun Zhang
School of automation School of automation China Nuclear Control School of automation
Wuhan University of Technology Wuhan University of Technology System Engineering Co. Ltd Wuhan University of Technology
Wuhan, China Wuhan, China Wuhan, China Wuhan, China
shenlan922416@163.com zhangdh@whut.edu.cn panyu @ cncs.bj.cn zhanghj@whut.edu.cn

Abstract— In the enterprise training, a digital telephone


system with special functions is needed and there are no such II. SYSTEM FUNCTION AND INTEGRAL STRUCTURE DESIGN
products on the market. In this paper, a digital telephone system
for training is designed based on CAN (Controller Area Network) A. System function
bus and Ethernet. The SPC (Stored Program Controlled) The digital telephone system Oriented for training supports
telephone exchange is designed with distributed multi processors a total of 60 telephones, one of which is used in the coaches
which communicate by CAN. In the system, the SPC telephone station (hereinafter referred to as the host), the remaining 59
exchange sends call information to the upper computer for voice
(hereinafter referred to as the slave) distributed in the student
broadcast through the Ethernet and the upper computer sends
station. The coach telephone possesses 30 function numbers
control information to the SPC telephone exchange through the
same line. The structure and working principle of the digital
which are alias of the host and the slaves may call the host by
telephone system for training are elaborated and the design idea function phone numbers corresponding to different apartments.
of the system hardware circuit is introduced briefly. The design The coach station is equipped with monitoring software which
idea of the system software is introduced in detail and the flow is used to update telephone numbers and voice broadcast
charts of some programs are showed. Practice shows that the information of call received by the host. Telephone numbers of
digital telephone system oriented to training can work reliably. different length is supported in the system..

Keywords—SPC Telephone Exchange, MT8980D, training, B. Integral Structure Design


voice broadcast
The principle of digital telephone system oriented for
training is shown in Figure 1. According to the actual
I. INTRODUCTION functional requirements, training-oriented digital telephone
Since the early 70s when digital SPC telephone exchange system consists of two parts: SPC telephone exchange and
are introduced, program-controlled switching technology has upper computer.
developed rapidly. Compared to the traditional analog switches,
Digital SPC telephone exchange have the advantage of small 6WXGHQWURRP

size, good maintainability and more functions[1]. In recent years, 3&0FORFN


3&0FORFN

with the advancement of China's power grid, the rapid 6WXGHQW 2YHUYRO 6LJQDOWRQH
expansion of the size of naval vessels and the vigorous SKRQH WDJH
SURWHFW
development of nuclear power, the demand for digital LRQ 'LJLWDO
8VHU H[FKDQJH
telephone systems with special functions is getting stronger. FLUFXLW
LQWHUIDFH 3&0FRGH QHW

Most of the SPC Telephone Exchanges currently on the


'DWDEXV

market only have Basic dialing call function and can’t meet the
$GUHVV
EXV

needs of all users. For example, in power sector, factories and 1XPEHU
mines, telephone system with special functions is commonly UHFHSWLRQ
((3520 ([FKDQJH
used for personnel scheduling and student training but these 8VHUXQLW
FRQWURO
SURFHVVRU
functions can’t be achieved on a lot of ordinary SPC telephone SURFHVVRU &$1%86
exchange. If there is a set of digital telephone systems for
training which can simulate the actual operating environment.
It will greatly improve the status quo in the enterprise as an 9RLFHEURDGFDVW
important platform for operator training, learning and &RDFK
SKRQH
(WKHUQHW
QXPEHUXSGDWH
assessment. In this paper, a digital telephone system for
+RVWFRPSXWHU
training is designed for the current situation and the system can &RDFKFRQWUROVWDWLRQ

be used in industries such electric power and ship for


communication between coachers and students. Fig.1. Block diagram of digital telephone system

This research was supported by the Natural Science Foundation of Hubei Province (#2016CFB502 and #2015CFB586) and the Fundamental Research Funds
for the Central Universities (#163111005).
.

978-1-5386-3524-7/17/$31.00 ©2017 IEEE 1945


The SPC telephone exchange consists of eight user boards DTA(Data Acknowledgement) equals 1 indicates the last data
and one switchboard. Each user board supports five telephones has been processed by MT8980D and MT8980D is prepared
to connect to the SPC telephone exchange and may distribute for receiving new data[7].
in different rooms.
Distributed multiprocessor control is adopted to control the 'a' 3$a3$
SPC telephone exchange and each unit module has a high-
$a$ 3)a3)
performance processor[2]. The user unit processor in the system
completes the real-time processing of the interface circuit, and 07'
5: 3)
670),*7
the exchange control processor of central unit module realizes &6 &6
the coordination and dispatch management between the central
'7$ 3(
control unit and the user unit. The user unit and the central
control unit communicate by CAN bus[3]. '6 3(

The working principle of the communication between the


units in the system is as follows: the controller of the
Fig.2. MT8980D interface schematic
subscriber unit performs the scanning detection on the state of
each User loop of the unit, and sends the obtained data to the
central control unit by CAN bus; When the central control unit B. User interface and CAN bus network design
receives the data uploaded by other units, it processes the data The function of User interface board is relatively simple,
according to the control procedure preset by the system and it can be divided into five parts: the processor
software and sends corresponding control commands to the part(STM32F103RCT6 microcontroller), CAN bus interface,
subscriber unit which control the user loop in real time the user circuit, DTMF(Dual Tone Multi Frequency) number
according to the commands[4]. receiver and PCM timing circuit part from the function of the
In the host computer monitoring part, the host computer circuit. The user unit completes the tasks such as "feed",
receives information from the SPC telephone exchange through "overvoltage protection", "ringing control", "status detection",
the Ethernet, display the information and broadcast it with the "codec", "test control" and other functions of the user interface
host computer software. At the same time, the call history is circuit of digital switch.
recorded for the query. In addition, the host computer can also The central control unit and each subscriber unit in the
set the telephone number through the Ethernet. system are all nodes of the CAN network. The communication
function of each node is implemented by the processor, CAN
III. SYSTEM HARDWARE DESIGN controller and CAN transceiver. CAN bus network shown in
Figure 3.
A. Design of exchange control center 8VHU 8VHU
&38
The switchboard is the control center of the system. As the SURFHVVRU SURFHVVRU
central processing unit of the machine, it is mainly used to
complete the main processing and control functions, voice non- &$1 &$1 &$1
LQWHUIDFH LQWHUIDFH LQWHUIDFH
blocking digital exchange, processor communication interface
and other functions in the system[5]; The function modules of
switchboard consist of processor module, switching network, &$1%86
CAN bus interface, signal tone module and PCM(Pulse Code
Modulation) reference clock module[6].
Fig.3. CAN network block diagram
The exchange control processor is high performance
MCU(Microcontroller Unit) STM32F407IGT6. As the system
requires a highly accurate clock signal timing, PCM reference IV. SYSTEM SOFTWARE DESIGN
clock module is designed with CPLD(Complex Programmable The system software consists of SPC Telephone Exchange
Logic Device), which provides the system with a more software and Monitoring software.
accurate clock signal. Digital switching network is designed
with MT8980D, a PCM time-division multiplexed time A. Stored Program Controlled Telephone Exchange Software
converter produced by Mitel corporation, to achieve voice Design
switching function.
SPC Telephone Exchange software is mainly composed of
The interface between MT8980D and exchange control call processing program, CAN interrupt program and network
processor is shown in figure 2. D0 to D7 of MT8980D are data interface communication program.
lines through which the exchange control processor read data
from MT8980D memory or write commands into its The call processing program is divided into two levels of
registers.A0 to A5 of MT8980D are address lines. If A5 equals the cycle level and the base level. The periodic program is a
0, the control register is selected and all operations are for the monitor program and a program that must be executed at
control register. If A5 equals 1, the time slot number is selected regular intervals. In order to ensure the accuracy of their
by A4 ~ A0 to ensure the control of each time slot. that execution cycle, the SPC Telephone Exchange arrange a fixed

1946
clock interrupt to schedule the relevant procedures to do. The users in turn. The program first determine whether the user is
commonality of the basic program is that it requires less real- on the hook moment, if the user just hang up, status of each
time requirements, can be interrupted by an emergency or state of the user is cleared; Otherwise, if the user is in the off-
critical task. The execution time of basic program which is hook state, then go to the off-hook processing procedures for
mostly composed of programs that are executed only when off-hook analysis. When the call number is identified as a
they need to be executed is not strict. The periodic program function number, the number receiving program automatically
periodically scans the subscriber line status and generates change the call number to the host number and wait for the
various events for the basic program to receive and process. connection with the host[8].
The basic program receives event reports from the periodic
level, processes them accordingly, and issues various control EHJLQ
commands.
The overall block diagram of the call processing program is \HV +DQJXS
shown in Figure 4. LQVWDQWO\"
QR
V\VWHPLQLW &OHDUWKH
XVHUVWDWH QR
2IIKRRN"
([HFXWHWKH &DOOHG QR
\HV
SHULRGLFSURJUDP 'LVFRQQHFW VWDWH"
([HFXWHWKH WKHXVHU 2IIKRRN
SURFHVVLQJ \HV
EDVLFSURJUDP
6HWULQJ
Fig.4. Call processing block diagram

In the call processing program, there are six kinds of user


status, respectively, is “idle”, “waiting for the number”, UHWXUQ
“receiving number”, “listen to busy tone”, “ring” and
“connected”. Any input signal in each state can cause a state Fig.6. Basic program flow chart
transition.
The task of the CAN interrupt routine is to receive data
The periodic procedure is shown in Figure 5. When the frames from the CAN bus and parse them. The data frame is
200ms timer interrupt occurs, the interrupt program scans the divided into three types: data request frame, data response
status of each user in turn, make an analysis combined with the frame and command frame. After the different data frames are
last user status and send the user off-hook or on-hook events to analyzed, they are put into the corresponding message queue
the message queue of basic program, waiting for the basic waiting for processing. CAN interrupt program flow chart
program to process. shown in Figure 7.

PVDUULYHG *RWRWKH EHJLQ


QH[WXVHU
5HDGFXUUHQW &$1UHFFHLYH 6HQGWR
VXEVFULEHUOLQH DQGGDWD)UDPH GDWDBUHSBTXHXH
 DQDO\VLV
VWDWXV$
$ š%

 FRPPDQG QR
5HDGWKHODVW 'DWDUHTXLUH QR
VXEVFULEHUOLQH 6HQGXVHUKDQJXS IUDPH" IUDPH"
VWDWXV% HYHQWZDLWIRUWKH \HV
EDVHSURJUDPWR \HV
SURJUHVV 6HQGWR
 6HQGWR FRPPDQGBTXHXH
$š % GDWDBUHTBTXHXH

 $OOXVHUV QR
VFDQQHG 5HWXUQ
6HQGXVHURIIKRRN 'DWDUHVSRQVH QR
HYHQWZDLWIRUWKHEDVH \HV IUDPH"
SURJUDPWRSURJUHVV
UHWXUQ \HV

Fig.7. CAN interrupt program flow chart


Fig.5. Periodic program flow chart
Each queue corresponds to a management structure which
The basic program flow chart is shown in Figure 6. contains information such as queue length, record size, an array
Procedures do the basic level of analysis and processing for 40 for implementing ring buffers, pointer to the first data record to

1947
process, pointer to the first empty record, and relative statistic. The voice broadcast module is designed using the
The system periodically processes the data in each buffer Microsoft Speech SDK. The module receives the voice
queue. broadcast data frame from the SPC Telephone Exchange and
use TTS engine to voice broadcast it[11]. The flow chart of
The network port communication program which is voice broadcast module is shown in Figure 9.
designed based on the μIP protocol stack belongs to the
application layer procedure[9]. It runs as the client on the
switchboard. uIP is very effective in embedded systems for it
requires very small amounts of code and memory. It has been EHJLQ
3HUIRUPDYRLFH
ported to several platforms including ARM(Acorn RISC EURDGFDVW
Machine) platforms. As an interface, the entry function of &UHDWHWFS
network port communication program is defined as macro FRQQHFWLRQ
UIP_APPCALL() provided to the μIP protocol stack to call[10]. QR &ORVH
The network port communication program flow chart is shown FRQQHFWLRQ˛
in figure 8. 5HFHLYHYRLFH
EURDGFDVWGDWD \HV
EHJLQ
5HWXUQ

8LSB%XIIHU \HV 6HQGBIODJ QR


"
HPSW\"
Fig.9. voice broadcast module flow chart
\HV
QR
6HQGGDWDWR The format of voice broadcast data frame received from the
XSSHUFRPSXWHU
5HYBIODJ " QR SPC telephone exchange is shown in TABLE II. The frame
length is fixed to 17 bytes.
\HV UHWXUQ
8SGDWH7HOHSKRQH TABLE II. BROADCAST DATE FRAME FORMAT
QXPEHU2U6\VWHP
VHWWLQJV header command data checksum Frame tail

0x0A 1 byte 13 bytes 1 byte 0x0D

Fig.8. Network port communication program flow chart


Each frame starts with hexadecimal 0x0a and ends in
This program has two tasks: one is to receive number hexadecimal 0x0d. There are three commands: “calling”(0x01),
update data and system settings data from the host computer; “connected”(0x02) and “disconnected”(0x04). The data
Second, to send the voice broadcast information to the host segment occupies 13 bytes so that it is large enough to store the
computer. longest number sequence and the free bytes, if any, is filled
with zero. The checksum is equal to the sum of all the byte
B. Monitoring software design data in the command area and the data area.
Monitoring software is mainly composed of network port The operation interface is shown in figure 10.
number update module and the voice broadcast module. It runs
as a server process on the upper computer.
The network port number update module implements the
telephone number setting function. When the new numbers are
set in the operation interface, they are assembled into a number
of data frames. These frames are sent to the SPC telephone
exchange through Ethernet and the SPC telephone exchange
updates the number buffer in the SRAM and writes the data
into EEPROM in case of power down. The number data frame
format is shown as TABLE I.

TABLE I. NUMBER DATE FRAME FORMAT

header Telephone_id number checksum Frame tail

0x0A 1 byte 13 bytes 1 byte 0x0D


The telephone id segment indicates which phone the new
number corresponds to. Fig.10. operation interface of voice broadcast module

1948
Speed and volume adjustment is supported and history call [3] Yang Huawei, Wan Zhengquan. Application of CAN bus in ship
records can be queried easily. structure safety monitoring system, J. Journal of Electronic
Measurement and Instrumentation, vol. 5, pp. 553-559., May 2014.
[4] Zhi Jinning, Xiang Changle, Ma Yue. Design and Implementation of
V. CONCLUSION CAN Communication System for Distributed Electric Drive Vehicle, J.
Journal of North University of China(Natural Science Edition), vol. 36,
The digital telephone system designed in this paper is pp. 22-25, March 2015.
mainly oriented to training and scheduling. In this paper, the [5] Han Xiaoxia, Design of the Small Digital Program Controlled Exchange
demand for digital telephone system is analyzed, the basic Used in Electric Power Communication _____the whole design and the
functions of the system are determined, and the overall scheme realization of software program, D. BaoDing: HeBei University, pp. 25-
of the system is designed. Then, the hardware implementation 30. April 2005.
scheme of distributed digital telephone system based on CAN [6] Gao Xiue, Application of DTMF Special purpose Chip MT8880 in the
bus is described, and the working principle of each hardware Data Transmission of Communication Network, J. Modern Electronics
Technique, vol. 13, pp. 30-32, July 2004.
module is described. Finally, the system software is designed
[7] Li Yanxia, Liu Yurong. Research on Audio Signal Testing of Digital
in detail, and the algorithm flow chart of each software module HD Equipment Based on PCM Code, J. Computer and Modernization,
is presented, and the design idea is explained. After more than pp. 124-126, April 2015.
two years of operation, the system is stable and reliable. [8] Chen Wenyin, Sheng Zhanshi, Sheng Biqi. Design of number
identification and SMS sending device based on the STM32, J.
Information Technology, vol 39, pp. 152-154, October 2015.
REFERENCES [9] Qiao Liyan, Liang Yu, Zhao Haoran, Zhu Jianping. Design of Ethernet
interface based on W5300, J. Electronic Measurement Technology, vol.
7 , pp. 129-132. July 2012.
[1] Shi Bin, Design and Realization of the Small Digital Program [10] Tang Qiaoge, Gao Qiang, Liu Chao. Embedded Ethernet Positioning
Controlled Exchange, D. Nanjing Normal University, pp. 3-5, April System Based on STM32, J. Ordnance Industry Automation, vol 36, pp.
2003. 17-20, May 2017.
[2] Li Zhengwei, Study on Message Architecture of Distributed Real-Time [11] Wang Husheng, Li Jinhuan, Yuan Xianfeng, Zhang Shengchun. Design
Embedded System, D. ChongQing: Chongqing University, pp. 12-14. of an Embedded Speech Brodcast System Based on STM32, J. Journal
May 2009. of Beijing Union University(Natural Sciences), vol. 03, pp. 11-15.
September 2011.

1949

You might also like