DTMF控制遥控开关

合集下载

基于固定电话线的远程控制与防盗报警器的设计与制作

基于固定电话线的远程控制与防盗报警器的设计与制作

基于固定电话线的远程控制与防盗报警器的设计与制作刘方威(陕西理工学院物理与电信工程学院通信工程专业,2009级1班,陕西汉中 723003)指导教师:龙光利[摘要]为了利用现有的电话线路对家庭中设备和电器进行远程控制,采用单片机和DTMF解码芯片,设计并制作了一种基于固定电话线的远程控制器。

控制器包含硬件和软件两部分,硬件电路由MT8880电话电路、摘机挂机电路、响铃检测电路、红外检测电路、触发开关电路、液晶显示电路、I2C存储电路、继电器输出控制电路、键盘控制电等电路组成;软件由主程序、振铃检测计数程序、DTMF解码处理程序、键盘扫描程序、语音控制程序、EEPROM 读写程序、LCD显示等子程序组成。

软件用C语言编程,利用Keil软件编译,通过后将生成的HEX文件下载到单片机STC89C52上,Proteus硬件仿真通过后,用Altium Designer设计PCB板,手工制作PCB板,将单片机和其它相关元器件焊接在PCB板上,和固话连接,上电,当家中发生警情时, 此时家中设定的无线模块或者其他传感器模块会发出异常信号给单片机, 单片机接受到信号后立即发出现场声光报警信号来威慑侵入者, 同时将单片机自动拨打预先存储在存储芯片中的电话号码给主人或者小区物业报警, 以便及时采取防盗措施避免财产损失。

通过拨打连接的固定电话的号码,可控制家用电器开启和关闭,液晶显示有关号码,通过蜂鸣器报警。

[关键词] 电话线;控制器;防盗报警;单片机;双音多频;红外感应Design and production of remote controller based on the fixed telephone lineLiu Fangwei(Grade09,Class1,Major of Communication Engineering,School of Physics and telecommunication Engineering , Shaanxi University of Technology, Hanzhong 723003,Shaanxi)Tutor: Long GuangliAbstract:In order to control devices and appliances which based the line of fixed telephone,a remote controller based on the fixed telephone line was designed and production by using MCU and DTMF decoder.The implementation of the controller includes hardware design and software design,hardware was composed of MCU minimum system,ringing circuit,simulation of off-hook and on-hook,drive circuit of appliances,decoder of DTMF, LCD,keyboard and EEPROM Cell;software was composed of main program,program which could count the number of ringing,DTMF decode program,keyboard-scan program,voice program,EEPROM reading and writing program,display program.The software was based on programmed with C language,using Keil C51 for developing program,compiled HEX file and downloaded to the MCU AT89S52,circuit simulation by Proteus.The board of PCB was designed by the sofware which named Altium Designer and was welded manually with other electronic components,which will be used.After connecting with the line of fixed telephone and power on,the home appliances is controlled to turn on or turn off,the password is showed on the LCD,the tip of voice is played when the telephone number was called.Key words:Telephone line;Controller;Appliances;MCU目录引言 (1)1 方案论证与选择 (3)1.1 基于FPGA的电话远程控制器 (3)1.2 基于PLC的电话远程控制器 (3)1.3 基于单片机的电话的远程控制器 (3)1.4 方案选择 (4)2 硬件电路设计 (5)2.1 单片机最小系统设计 (5)2.2 振铃检测电路的设计 (6)2.3 模拟摘机及电话接口电路的设计 (7)2.4 DTMF解码和语音录放电路设计 (9)2.4.1 DTMF解码电路设计 (9)2.4.2 语音录放电路设计 (9)2.4.3 功率放大电路设计 (10)2.5 显示、输入和存储电路设计 (11)2.6家电驱动电路及电源模块 (13)3 软件设计 (14)3.1 主程序设计 (14)3.2 子程序设计 (14)3.2.1 振铃检测及模拟摘机程序设计 (14)3.2.2 DTMF解码程序设计 (15)3.2.3 EEPROM读写程序设计 (15)3.2.4 语音录放程序设计 (16)3.2.5 LCD1602液晶显示及键盘扫描程序设计 (16)3.3 程序编译 (17)3.4 程序下载 (17)4 仿真、制作和调试 (19)4.1 Proteus仿真 (19)4.2 PCB板设计与制作 (21)4.3 硬件制作调试 (23)4.3.1 元器件的检测和焊接 (23)4.3.2 硬件调试 (23)结论27致谢28参考文献 (29)附录A 英文文献原文 (30)附录B 英文文献翻译 (40)附录C 系统总体原理图 (48)附录D 源程序 (50)附录E 元器件清单 (67)1引言近年来,随着网络通信技术、电子技术和计算机技术的迅猛发展,以及社会经济的飞速发展和人民生活水平的日益提高,人们对其住宅的要求也越来越高,大家不仅希望居室温馨、舒适,而且对其安全性、智能化方面也提出了更高的要求。

icom2820H使用说明

icom2820H使用说明

ICOM IC-2820H 深度使用技巧功能键介绍● V/MHz(Scan):短按该键则进入VFO频率设置模式,多按几下则会让您从十兆位置开始输入,长按则进入扫描状态(VFO模式下长按扫描频率、MR频道模式下长按扫描频道)。

● M/Call(MW):短按该键进入存储频道模式,再按一下进入CALL频道,再按则进入WX天气频道(如果您机器通过跳线或扩频设置到美国区域版本,才有此项),长按进入频道存储,同时这时候的功能键将出现第五种功能。

1. SEL:按下该键后,我们进入频道群组选择,再按一下进入频道命名,再按则返回频率状态。

这里需要注意的是,频道群组和频道命名都需要通过按下EDIT对应的功能键后进行更改。

2. S.MW:通过长按此键,我们可以把频道的所有相关数据存入指定的频道位置(含归属频道群组和频道命名数据等信息)。

3. CLR:长按此键可以删除当前频道。

4. EDIT:编辑功能,可以用来编辑频道群组和频道名称。

按下后进入第6种功能键的功能,其中左右箭头分别代表光标左右移动改变输入的位置。

5. Back:确定并返回上一层。

● DUP(MONI):短按此键可切换频率正或负频率偏移方向,或关闭频率偏移。

长按则打开静噪和进入倒频工作状态。

● TONE(DTMF):模拟或数字亚音频信令的调用,长按此键进入名人堂:众名人带你感受他们的驱动人生马云任志强李嘉诚柳传志史玉柱DTMF存储拨号控制菜单,这里可以打开或关闭DTMF的储存快速拨号功能,存储DTMF号码到指定储存位置中去。

● LOW(PRIO):短按此键可切换3档输出功率,长按则启动优先扫描功能。

这个功能需要注意的是,启动该功能后,每隔几秒便会返回到优先频道,守候几秒钟后,再回到当前守候频率。

在通话时会造成好像无故掉话的现象,这时,您就要检查是否启动了优先频道扫描功能。

● F键:短按此键可切换不同功能键的功能,并让其显示在屏幕或功能键表面上,长按则能够锁定主机的主要功能。

电器开关原理揭秘:如何实现远程控制功能

电器开关原理揭秘:如何实现远程控制功能

电器开关原理揭秘:如何实现远程控制功能电器开关是我们日常生活中经常用到的设备,可以控制电力的开启和关闭。

随着科技的发展,远程控制的功能也越来越普及,那么电器开关是如何实现远程控制功能的呢?下面就让我们揭秘一下电器开关的原理。

电器开关的远程控制功能是通过无线通讯技术来实现的。

常见的无线通讯技术有蓝牙、Wi-Fi、红外线等。

不同的无线通讯技术具有不同的特点和应用场景,我们可以根据需要选择合适的无线通讯技术来实现远程控制。

首先,我们来介绍一下蓝牙技术。

蓝牙技术是一种短距离无线通信技术,通常用于手机、电脑等设备之间的数据传输。

通过在电器开关和远程控制器上分别添加蓝牙模块,可以实现两者之间的通讯。

当远程控制器发送指令时,蓝牙模块会接收到指令,并将指令传输给电器开关,电器开关会根据指令进行相应的操作。

其次,我们来介绍一下Wi-Fi技术。

Wi-Fi技术是一种无线局域网技术,可以实现设备之间的网络连接。

通过在电器开关和远程控制器上分别添加Wi-Fi模块,可以实现两者之间的连接。

远程控制器可以通过连接到互联网的方式,将指令发送给电器开关,电器开关接收到指令后进行相应的操作。

再次,我们来介绍一下红外线技术。

红外线技术是一种近距离无线通信技术,通常用于电视遥控器、空调遥控器等设备。

通过在电器开关和远程控制器上分别添加红外线模块,可以实现两者之间的通讯。

当远程控制器发送指令时,红外线模块会将指令通过红外线信号发送给电器开关,电器开关接收到红外线信号后进行相应的操作。

除了以上介绍的几种无线通讯技术外,还有其他的一些技术可以实现远程控制,如Zigbee、Z-Wave等。

这些技术各有特点,可以根据具体的需求选择合适的技术来实现远程控制功能。

总结来说,电器开关的远程控制功能是通过无线通讯技术来实现的。

通过在电器开关和远程控制器上添加对应的无线通讯模块,可以实现两者之间的通讯。

当远程控制器发送指令时,无线通讯模块会接收到指令,并将指令传输给电器开关,电器开关会根据指令进行相应的操作。

基于DTMF的智能电话控制器

基于DTMF的智能电话控制器
维普资讯
应 用 天 地
基于 D H 的智能电话撞螂 TF
一 西安工业学 院 谭 宝 成 王 鹏
介 绍一 种 基 于 DTMF ( 音 多频 ) 信 号 和 RS485 的远 程 智 能控 制 器 。 它 具 有振 铃 捡 测和 模 拟 双 墙 覃 摘 机 、D TMF 信 号 解 调 、 虹 外 遥 控 鳊 码 自学 习和 发射 多路 虹 外 遥 控 信 号 的功 能 。 奉 文对 该控 制 器 的 组 成 、 硬 件 配 置 、 软 件 设 计 、 工 作 原 理 、 功 能 厦 技 术 性 能进 行 了详 细 论 述 。 该 控 制 器 在 远 程 控 制 的 数 据 终 端 系 统 中使 用后 . 证 明 其 方 便 、 可 靠 和 有 实 用 价 值 。
图 1 原 理 框 图
收 并 输 入 到 单 片 机 中 进 行 核 对 . 核 对 正 确 则 提 示 输 入 控 制 命 令 键 , 单 片机 对 命 令 进 行 分 析 判 断 , 并根 据 命 令 要 求 完 成 相 应 的 操 作 。 当输 入 “ ・ ” 键 后 , 自动 实 现 电 话 挂 机 , 从 而 完 成 一 次 远 程 控 制 。擒 机 后 3 内 若 不 输 人 命 令 或 密 码 , 电路 会 自 动挂 机 ; 0s 同 样 . 若 输 入 按 键 超 过 8个 键 也 自动 挂 机 。 该 控 制 器 还 可 通 过 Rs 8 4 5串行 通 信 电路 实 现 远
程信 息采集 .控制 若干 开关量和 具有红外遥控 功能 的 设 备 ;还 可 通 过 远 程 电 话 或 计 算 机 设 置 定 时 开
机或 关 机等 功 能 。
22 硬 件 电路 组成
22 1 振 铃 检 测 、 摘 机 电 路 振铃 检 测 电路 是 由 光 耦 T 2 - 和 7 LS 2 5 11 4 1 3构成 的 当有 电话 呼 人 时 ,2 、9 振 铃 信 号 由整 5 Hz 0 V 流 桥 整 流 后 经 光 电 隔 离 输 出 脉 冲 信 号 。 该 脉 冲 输 入 到 7L 13 , 7L 13 小脉 冲整 形成 大方 波信号 , 4 S2 中 4 S2 将 送 人 单 片 机 中 计 数 。 当计 数 达 到 设 定 次 数 时 , 单 片 机 控 制 输 出 高 电 平 . 使 三 极 管 导 通 , 从 而 继 电器 吸

创优虎数字振频控制器光电开关工作方式的设置

创优虎数字振频控制器光电开关工作方式的设置

光电开关的工作方式设置:
光电开关是一种感应器,能够检测物体的存在或离开,通常通过光线的中断来判断。

它通常包括发射器和接收器两部分,发射器发射光束,接收器检测光束是否被遮挡。

光电开关的设置可能包括以下步骤:
安装位置选择:根据您的应用需要,选择合适的位置安装光电开关,确保光线可以正常照射到接收器。

调整灵敏度:光电开关通常具有灵敏度调节功能,您可以根据物体的特性和距离调整灵敏度,以确保正确的检测。

检测模式设置:一些光电开关可能支持不同的检测模式,如全反射模式、透射模式等。

根据您的应用,选择合适的检测模式。

输出配置:配置光电开关的输出方式,例如当检测到物体时触发一个电信号。

您可以设置输出信号的类型和电平。

数字振频控制器的工作方式设置:
数字振频控制器是用于控制振动设备的设备,通过调整振幅、频率等参数来实现控制。

设置数字振频控制器可能涉及以下步骤:
连接振动设备:将振动设备与数字振频控制器连接,确保连接正确稳定。

电源供应:提供适当的电源供应,以确保数字振频控制器正常工作。

参数调整:根据您的需要,调整数字振频控制器的参数,如振幅、频率、工作模式等。

控制方式设置:配置数字振频控制器的控制方式,可能包括手动、自动、远程控制等。

保护设置:设置数字振频控制器的保护参数,如过载保护、过热保护等,以确保设备和人员的安全。

请注意,具体的设置步骤可能因产品型号和厂家而异。

在进行设置时,最好参考产品的用户手册或联系厂家获取详细的操作指南。

IC-2720中文说明书

IC-2720中文说明书
● 显示“MAIN”的为主波段。
使用 HM-133 手咪, 用 BAND 键切换主工作波段
P. IX
3, 选择操作频率波段 IC-2720 的左右 2 个工作段均具备 2 米和 70 厘米波段,可以进行 V/V U/U 使用。 按住 [MAIN•BAND] 一秒钟,然后用 [DIAL] 旋钮。ቤተ መጻሕፍቲ ባይዱ
● 按 [MAIN•BAND] 随时返回频率显示。 4, 调整频点
◇ 直流稳压电源连接 请使用具备至少 15A 输出电流的 13.8V 直流电源。
确认电源的地线安全接地。
P. VII
◇ 天线安装 ● 天线位置
为了令电台获得最高的性能,选用高品质的天线并将其安装在一个理想的位置上。当使用无方向性 天线时,应使用磁吸盘。
● 天线接头
P. VIII � 首次通连
现在已经将 IC-2720 安装完毕,你可能兴奋的希望进行发射。我们将指导一些基本操作用于第一次通连。 1, 开机
P. II
◇ 安装位置 选择一个可以承受机体重量且不妨碍驾驶的位置,可参考以下推荐位置图。 禁止将主机或控制面板安装在可能影响驾驶或造成身体伤害的位置。 禁止将主机或控制面板安装在可能影响放撞气囊工作的位置。 不要将主机或控制面板安装在可能被冷气、热风直吹的地方。 避免阳光直射。
◇ 使用安装架 � 在要装安装架的位置钻 4 个孔。
重要信息 - 对于美国版本 在分离电缆中加入一个磁环。把加有磁芯的电缆插头如下图连到主单元的[控制头]插座里。
◇ 手咪连接 IC-2720H 有两个连接点可供选择,一个在控制面板侧面,另一个在主机正面。 如下图所示,麦克风可以插到到任一插座里。
P. VI
◇ 电池连接 禁止取下电源连接线上的保险管。 禁止将设备直接连接到 24V 电池。 不要使用点烟器插座对设备进行供电(详细请参考 P. 6) 在电源线穿过金属板的位置加装橡胶环,以防止短路。

基于DTMF的无线抢答器遥控计分系统的设计与实现

基于DTMF的无线抢答器遥控计分系统的设计与实现
K e wor s: DTM F; r ls o ts ns rn s sem ; lc rc cr ui y d wiee sc n e ta we i g; y t e e ti ic t
U 日 J I

射机 , 每支参赛队各持一个遥控计分系统的接收机.
2 每 支参赛 队一 个 抢答 按 钮 , 钮 编号 与选 手 ) 按 编号 相 同. 主持 人有 控制 开关 , 以手动清 零 复位. 可 3 抢答 器具 有 优先 抢 答 功能 , 按 按 钮 的选 手 ) 先
中 图分 类号 : H 12 1 T 6 . 文献标识码 : A
De i n a d e l a i n f a wie e s c n e t a we i g s s e s d o sg n r a i to o r ls o t s ns r n y t m ba e n DTM F z
总第 16期 8 21 0 2年 6月




S m. 16 u 8
SOUTHERN METAL S
Jn 2 1 ue 02
文章编号 : 09— 7 0 2 1 )3— 0 7— 4 10 90 (0 2 0 0 4 0
基 于 D MF的 T 无 线 抢 答 器 遥 控计 分 系统 的设 计 与 实 现
输入 电路 , 禁止其他选手抢答 , 优先抢答选手的编号
显 示一 直保持 到 主持人将 系统 清零 时 为止.
4 抢答器具 有定时抢答功 能 , 时间 由主持 人 ) 抢答
抢答器和主机两部分组成 , 两者通过 D M T F编码脉
冲实 现通 信. 同 的抢 答器 除编码 不 同外 , 余 电路 不 其 完全 相 同. 主机 电路 一 般 由接 收译 码 显 示 、 规 指 犯

基于单片机的电话远程控制家电系统-毕业设计

基于单片机的电话远程控制家电系统-毕业设计

黑龙江科技学院2011届本科毕业论文(设计)论文题目:基于单片机的电话远程控制系统目录1绪论 (4)2系统设计原理 (6)2.1 硬件功能分析 (6)2.2 软件模块分析 (8)3 系统硬件电路设计 (9)3.1振铃检测电路 (9)3.1.1电路工作原理 (9)3.1.2 电路图设计 (9)3.2 摘挂机控制电路 (9)3.2.1电路工作原理 (9)3.2.2 电路图设计 (10)3.2.3 核心AT89C2051芯片介绍 (11)3.3 双音频DTMF解码电路 (12)3.3.1 电路工作原理 (12)3.3.2 电路图设计 (13)3.3.3 核心MT8870芯片介绍 (13)3.3.4 MT8870解码表 (14)3.4 家用电器控制电路 (15)3.4.1 电路工作原理 (15)3.4.2 电路图设计 (15)3.4.3 核心74LS273芯片介绍 (16)3.5 信息反馈电路 (17)3.5.1 电路工作原理 (17)3.5.2 音乐集成电路芯片介绍 (18)3.5.3音乐集成电路使用中的注意事项 (18)4系统软件设计 (19)4.1 软件设计原理 (19)4.2 系统程序设计流程图 (19)5结束语 (20)参考文献 (21)附录一电路总图 (22)附录二程序清单 (23)基于单片机的电话远程控制系统摘要:随着通讯产业的迅速发展,电话机已经走进了千家万户,但是利用电话机进行远程控制的技术却没有多少实质性的进展.如何将电话远程控制用于日常生活中正是本文所要研究的课题,众所周知,近几年通信和电子信息技术行业有了长足发展,本文设计了一种电话远程控制系统,该系统以AT89C2051单片机和MT8870双音多频解码集成电路为核心,借助公共电话网络,通过电话实现对远程设备智能化控制。

文章介绍了系统的组成、工作原理及程序设计方法。

对“振铃检测、模拟摘挂机控制、双音频解码,语音提示及家用电器控制”等电路作了详细的说明。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

Application ReportSLAA178 – August 2003 DTMF-Controlled Remote Switching Application Using theMSP430 Arthur Musah MSP430ABSTRACTThis reference design demonstrates how the MSP430 ultra-low power, mixed signalprocessor can be used to perform the real-time signal processing necessary to implementa dual tone multi-frequency (DTMF) decoding application. A DTMF decoding algorithm,which uses wave digital filters to process electrical signals sampled from a telephone line,forms the core of the remote touch-tone phone controlled switch application whoseconstruction and function are discussed in this report. The ADC10 peripheral available onthe MSP430F1232 is used to perform the sampling and conversion of telephone linevoltages, while the Timer_A peripheral is used to generate square waves to outputnotification tones onto the telephone line.1 IntroductionThis MSP430 application connects to an ordinary analog telephone line in parallel to a userphone and allows the user to control eight electric switches by making a call to the phone towhich the MSP430 device is attached and punching in an access code and simple instructionsequence to turn any of the eight lines on or off. In other words, one could remotely turn on the sprinklers in one’s lawn or the air conditioning at home, or turn off the lights mistakenly left on in one’s apartment if they are each connected to one of the telephone-controlled switching outputs on the MSP430 application.The requirements for building an application like the one described previously include hardware to form the interface between the telephone line and the MSP430 microcontroller, signalprocessing capabilities, provided by the MSP430, for deciphering information encoded aselectrical signals on the telephone line, and a control program for the MSP430.2 DecodingDTMF2.1 DTMFDual tone multi-frequency (DTMF) is a scheme for encoding 16 characters using the sums ofsinusoidal signals of two distinct, harmonically unrelated frequencies. The following table shows how the 16 characters are each represented by one frequency from a low frequency group(ranging from 697 Hz to 941 Hz) and one from a high frequency group (ranging from 1209 Hz to 1633 Hz).1SLLA178 – August 2003Table 1. The DTMF encoding schemeFrequency 1209 Hz 1336 Hz 1477 Hz 1633 Hz697 Hz 1 2 3 A770 Hz 4 5 6 B852 Hz 7 8 9 C941 Hz * (E) 0 # (F) DDTMF is widely used in telecommunication systems. To transmit a particular character on atelephone line, the two frequencies representing that character are generated as electricalsignals, added and sent down the line. A specified period of silence (40 milliseconds or more) separates one transmitted DTMF character from another. A receiving device decodes thecharacter being transmitted by identifying the two frequencies present in each sum it receives.2.2 Identifying DTMF SignalsTo identify the DTMF character received by the MSP430 application, the analog voltage signal on the telephone line is sampled and converted to a digital value using the 10-bit analog-to-digital converter (ADC10) peripheral on the MSP430F1232 chip. The sampling frequency used is 3640 Hz, which is more than two times the highest DTMF frequency. This satisfies the Nyquist criterion and therefore ensures that the integrity of the signal is preserved after sampling. The sampled signal is then passed through each of 8 wave digital filters to identify which two DTMF frequencies, if any, are present in the sampled signal.2.3 Wave Digital FiltersThe digital processing of voltage signals eliminates the need for additional circuitry external to the MSP430 for implementing analog filters. Wave digital filters are used, which areimplemented in software and have many desirable features such as response stability and good dynamic range.A DTMF decoding algorithm for the MSP430 [1] makes use of 8 wave digital filters, which areconveniently implemented with shift-and-add multiplications to eliminate the need for a hardware multiplier. Each of the filters is designed to have a resonant frequency corresponding to one of the DTMF frequencies. Thus, a signal whose frequency matches the resonant frequency of the filter it is passed through will be magnified by a known factor characteristic to the filter, whilenoise and signals of all other frequencies will be significantly attenuated. The output of a filter can then be analyzed to determine if a particular frequency was present in a signal or not.2DTMF-Controlled Remote Switching Application Using the MSP430SLLA178 – August 2003 3 Hardware3.1 Function of Circuit ComponentsThe circuit schematic in Figure 1 shows the hardware that interfaces the tip and ring telephone lines with the MSP430, the JTAG interface, and 8 LEDs for demonstrating the switching action of the application.The interface between the phone line and the MSP430 consists of four functional parts:•Ring detection: U3 combines the ring detect function and a solid-state relay for implementing the telephone hookswitch in one IC. The capacitor C1 dc-filters the 15-Hz ringsignal from the telephone line, which is then passed through the current-limiting resistor R1into the ring detect portion of U3. When there is no ring signal on the phone line, the ringdetect output maintains a logic high. A logic low value on the output indicates a detectedtelephone ring. The ring detect output of U3 is connected to an MSP430 I/O pin (pin 10) togenerate an interrupt to the MSP430 on each telephone ring.•Hookswitch: A dedicated I/O pin (pin 21) on the MSP430 is connected to the relay control pin of U3. It is used to turn the solid-state relay portion of U3 on or off, to close or open thecircuit on the primary side of the transformer T1.•DTMF input line: This comprises the secondary side of the transformer T1, feeding into the operational amplifier (op amp) input and from the op amp output to pin 8 (ADC channel A0)of the MSP430. Since DTMF signals are ac signals, they are propagated from the telephoneline on the primary side of T1 to the secondary side. The signal path through R8 and C3 topin 23 of the MSP430 is blocked to DTMF signals by placing I/O pin 23 in a high impedancemode when receiving DTMF. DTMF signals thus pass through the dc-filtering capacitor C2,are amplified by U4 and sampled at pin 8 of the MSP430. The op amp U2 also biases theamplified DTMF signals at VCC/2 to enable the analog-to-digital converter to convertsamples from the upper as well as the lower half-cycles of the ac signal.•Notification tone output line: This is the path for square wave signals generated as user notification tones by the MSP430 Timer_A peripheral. The op amp U4 is shut down bydriving the shutdown pin on the op amp low and the op amp outputs are placed in a highimpedance mode, when a user notification tone is being output. The square wave goesthrough C3, R8 and the secondary side of T1, and is propagated to the primary side and tothe telephone line, which transmits it to the user’s earpiece.The JTAG interface provides the appropriate signal connections for in-system programming of the MSP430 [2] via a PC parallel port. The jumper switch S1 provides the option of powering the board either from the on-board battery V1, or from a PC connected via the JTAG interface.The eight LEDs, D7 to D14, are connected to MSP430 output pins through current limitingresistors R12 to R19. They can be turned on or off by the MSP430 to demonstrate the switching function of the application.DTMF-Controlled Remote Switching Application Using the MSP430 3SLLA178 – August 20034DTMF-Controlled Remote Switching Application Using the MSP430SLLA178 – August 2003 DTMF-Controlled Remote Switching Application Using the MSP430 5SLLA178 – August 20033.2 Parts listTable 2. Bill of MaterialsDesignator Part Type Part Ratings Part NumberC1 Capacitor 0.47uF, 250VC2 Capacitor 15nFC5 Capacitor 0.1uFC3,C4 Capacitor 10nFC6 Capacitor 10uFD7 to D14 LED 3mA HLMP-D150AJ1 14-pin header 2514-6002UBOV1 Varistor 150VR12 to R19 Resistor 1.6KR1 Resistor 21.5KR9 Resistor 13KR10 Resistor 1KR8 Resistor 1.5KR2 Resistor 2KR3 Resistor 3KR4 Resistor 27KR5, R6, R11 Resistor 100KS1 3-pin headerT1 Transformer MIDCOM, 671-8005U1 Mixed signal processor TI, MSP430F1232TLV2760 U4 Opamp TI,U3 SSR, ring detect IC Clare, TS117V1 Battery 3VX1 Watch crystal 32768 Hz4 Software4.1 Main Program for Controlling the MSP430The MSP430 CPU is run at a frequency between 4.4 MHz and 5.4 MHz by setting the on-chip digitally controlled oscillator (DCO) to run at the maximum settings (see the data sheet for the MSP430F1232 device[5]). This CPU frequency is adequate for the application, since thesampling frequency is obtained from a more precise 32768-Hz ACLK signal. Counter variables are cleared and the CPU is turned off to wait for ring interrupts. A ring counter is incremented in the ring interrupt service routine. Most standard ring cadences have a 6-second period (thisapplication was tested with a typical ring cadence of 2 seconds on and 4 seconds off). Thereturn from the ring interrupt service routine (inside of which ring interrupts are disabled) isdelayed for 4 seconds using the watchdog timer available on the MSP430. This delay ensures that a single ring is not counted multiple times due to a fluctuating ring detect signal with multiple falling edges causing multiple ring interrupts to be generated.6DTMF-Controlled Remote Switching Application Using the MSP430SLLA178 – August 2003 Ring signals are counted until the specified number is obtained (5, in this implementation). The application then seizes the telephone line and confirms this to the user with a tone. The user has one chance to enter a correct password, and if there is a password match, the application runsin switch mode, where it accepts and executes valid DTMF signals representing switch actions requested.On the demonstration board, 8 LEDs are turned on or off to show the switching action. In a real-world product the 8 outputs can be used to turn low current solid-state relays to turn isolated circuits on or off.DTMF-Controlled Remote Switching Application Using the MSP430 7SLLA178 – August 2003Figure 2. Flow Chart of Control Program8DTMF-Controlled Remote Switching Application Using the MSP430SLLA178 – August 2003 4.2 DTMF Decoding Algorithm [1]Timer_A triggers the analog-to-digital converter on the MSP430 to sample the voltage level on channel A0 at intervals of 274.7µs. In the time between two samples, the current sample is used to calculate the 8 filter outputs to identify two maximum values from the high and low frequency groups in the DTMF table. Twenty filtering cycles are carried out to allow all the filters to reach a steady state and the various frequencies to go through their peak amplitudes. (20 cyclescorrespond to 20 x 0.2747 ms = 5.494 ms, which is longer than the largest DTMF signal period of 1.435 ms for the 697-Hz wave.) After consolidating these 20 samples, a check is performed to determine that the two maximum filter output values chosen both lie above the natural noiselevel. Another check is performed to make sure that the difference between the two values is not excessive.Each time a valid DTMF frequency combination is thus identified, a signal length counter isincremented until the required signal length is reached. This means 8 iterations of this procedure are required to ensure that the 40 ms must-recognize DTMF specification is met. A flag is setwhen a DTMF tone of appropriate length is identified.When no DTMF tone is recognized after a set of 20 filter runs, the signal length counter isdecremented. The DTMF flag is cleared when the signal length reaches 0, and this indicates a valid pause between DTMF characters.For an in-depth description of the DTMF decoding algorithm for the MSP430, refer to Generation and Recognition of DTMF Signals with the Microcontroller MSP430[1].DTMF-Controlled Remote Switching Application Using the MSP430 9SLLA178 – August 2003Figure 3. Flow Chart of Algorithm for Decoding DTMF10DTMF-Controlled Remote Switching Application Using the MSP430SLLA178 – August 2003 Figure 4. Recognition of DTMF from Calculated Filter ValuesDTMF-Controlled Remote Switching Application Using the MSP430 11SLLA178 – August 20034.3 Password, Switch Action and Termination Command ImplementationBefore calling the DTMFDecode subroutine in the main control program, an operation mode is selected by moving the constant 0 or 1 into a ModeControl variable. This selects the number of DTMF characters to decode and save in memory before returning from the subroutine.To decode DTMF in password mode, 0 is placed in ModeControl. A sequence of four password characters is stored, which is compared to the software-programmed password upon exiting the decoding subroutine. (The password length was specified as 4 in the demonstration program, but can be changed in software.)To decode DTMF in switch mode, a 1 is placed in ModeControl, which causes the decodingsubroutine to return after storing a sequence of 2 DTMF characters. The first character should be within the range 0 through 7 to indicate which line is to be switched. A valid second character in switch mode is either a 0 (to switch the selected line OFF), or a 1 (to switch the selected line ON).In either mode, the identification of the DTMF character */E (the termination character) results in an abrupt termination of the DTMFDecode subroutine. The character is stored at the start of the decoded DTMF sequence before returning so as to indicate to the calling program that a hang-up/termination request was received.4.4 Timeout FunctionalityThe telephone-controlled switch application hangs up after 8 seconds of not receiving DTMFtones. To implement this function, a timeout counter is incremented each time the Timer_Asignals the ADC10 to start a new sample. This means that the timeout counter is incremented every 0.2747 ms and the function can be implemented by executing the timeout action when the counter reaches a value of 29120 (29120 x 0.0002747 s = 7.999 s).The idle-time timeout counter is cleared every time a new DTMF character is recognized. After every DTMF decoding cycle (of 20 filter calculations), the timeout counter is compared to thetimeout value. If the timeout value is reached, the termination character (*/E) is stored at thebeginning of the decoded DTMF sequence in memory and DTMF decoding ceases. The control program checks for this character when the DTMF decoding subroutine returns.4.5 Audible Tone GenerationNotification tones are used to provide feedback to the user about the status of the DTMFdecoder application. Two distinct notification tones within the human audible frequency range,20 Hz to 20,000 Hz, are produced by the MSP430. The higher frequency tone is theconfirmation tone. This is used for off-hook notification and to indicate that user input, such as a password sequence or a switch command sequence, is valid. The lower frequency tone is the error tone and indicates that invalid user input was received. This is also the hang-up (on-hook) notification tone.12DTMF-Controlled Remote Switching Application Using the MSP430SLLA178 – August 2003 Timer_A on the MSP430 chip is used to output a square wave of a selected frequency on P1.2 placed in output direction. This square wave is dc-filtered through capacitor C3 and passedthrough the secondary side of the transformer T1. (The op amp is shutdown and its outputs are placed in a high impedance mode during this process.) The signal appears on the primary side and is transmitted on the phone line to the user’s earpiece where it is converted into a soundwave of the specified frequency.Figure 5. Generating a Square Wave Using Timer_AThe 32,768-Hz auxiliary clock signal (ACLK) is selected for the Timer_A clock. To generate the higher frequency square wave (512 Hz), Timer_A counts up from 0 to 63 and then starts again from 0 (64 clock cycles). The output is set to logic high level on the 32nd count and reset to alogic low level on the 64th (on the 63 to 0 transition).32768 Hz / 64 = 512 HzTo generate the lower frequency square wave (128 Hz), Timer_A counts up 256 cycles of theclock. The output is set on the 128th count and reset on the 256th.32768 Hz / 256 = 128 HzThe Timer is stopped after the wave has been output for the required length of time.5 How to Use the Application1. Dial appropriate number from a phone other than the one to which the application isconnected. Application responds after 5 unanswered rings and sends a confirmation tone(high pitched beep).2. Enter password – 1 2 3 4. Confirmation tone sent out on password match; error tone (lowpitched beep) sent out on mismatch.DTMF-Controlled Remote Switching Application Using the MSP430 13SLLA178 – August 20033. After password match confirmation tone, enter digit 0 through 7 to indicate which of the 8lines on the application you wish to switch.4. Next, enter 0 to switch selected line OFF, or enter 1 to switch selected line ON.5. Confirmation tone indicates valid 2-digit switch command was executed, error toneindicates invalid switch command decoded by application.6. Cycle through steps 3, 4 and 5 as many times as necessary.7. Can hang-up by pressing * at any time.8. Application sends error tone and goes on-hook (hangs up) automatically after 8 secondsof silence, i.e. no key pressed, no DTMF signal received.6 References1. Generation and Recognition of DTMF Signals with the Microcontroller MSP430 (SLAAE16)2. Texas Instruments MSP-FET430 Flash Emulation Tool (FET) User’s Guide3. MSP430x1xx Family User’s Guide (SLAU049B)4. MSP430x11x2, MSP430x12x2 Mixed Signal Microcontroller Data Sheet (SLAS361)14DTMF-Controlled Remote Switching Application Using the MSP430IMPORTANT NOTICETexas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, modifications, enhancements, improvements, and other changes to its products and services at any time and to discontinue any product or service without notice. Customers should obtain the latest relevant information before placing orders and should verify that such information is current and complete. All products are sold subject to TI’s terms and conditions of sale supplied at the time of order acknowledgment.TI warrants performance of its hardware products to the specifications applicable at the time of sale in accordance with TI’s standard warranty. Testing and other quality control techniques are used to the extent TI deems necessary to support this warranty. Except where mandated by government requirements, testing of all parameters of each product is not necessarily performed.TI assumes no liability for applications assistance or customer product design. Customers are responsible for their products and applications using TI components. To minimize the risks associated with customer products and applications, customers should provide adequate design and operating safeguards.TI does not warrant or represent that any license, either express or implied, is granted under any TI patent right, copyright, mask work right, or other TI intellectual property right relating to any combination, machine, or process in which TI products or services are used. Information published by TI regarding third-party products or services does not constitute a license from TI to use such products or services or a warranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual property of the third party, or a license from TI under the patents or other intellectual property of TI.Reproduction of information in TI data books or data sheets is permissible only if reproduction is without alteration and is accompanied by all associated warranties, conditions, limitations, and notices. Reproduction of this information with alteration is an unfair and deceptive business practice. TI is not responsible or liable for such altered documentation.Resale of TI products or services with statements different from or beyond the parameters stated by TI for that product or service voids all express and any implied warranties for the associated TI product or service and is an unfair and deceptive business practice. TI is not responsible or liable for any such statements. Following are URLs where you can obtain information on other Texas Instruments products and application solutions:Products ApplicationsAmplifiers Audio /audioData Converters Automotive /automotiveDSP Broadband /broadbandInterface Digital Control /digitalcontrolLogic Military /militaryPower Mgmt Optical Networking /opticalnetwork Microcontrollers Security /securityTelephony /telephonyVideo & Imaging /videoWireless /wirelessMailing Address:Texas InstrumentsPost Office Box 655303 Dallas, Texas 75265Copyright 2003, Texas Instruments Incorporated。

相关文档
最新文档