收藏 分享(赏)

外文翻译--GSM模块收发中文短消息的关键技术-其他专业.doc

上传人:dzzj200808 文档编号:3150693 上传时间:2018-10-04 格式:DOC 页数:11 大小:445KB
下载 相关 举报
外文翻译--GSM模块收发中文短消息的关键技术-其他专业.doc_第1页
第1页 / 共11页
外文翻译--GSM模块收发中文短消息的关键技术-其他专业.doc_第2页
第2页 / 共11页
外文翻译--GSM模块收发中文短消息的关键技术-其他专业.doc_第3页
第3页 / 共11页
外文翻译--GSM模块收发中文短消息的关键技术-其他专业.doc_第4页
第4页 / 共11页
外文翻译--GSM模块收发中文短消息的关键技术-其他专业.doc_第5页
第5页 / 共11页
点击查看更多>>
资源描述

1、中文 2055 字GSM 模块收发中文短消息的关键技术手机短消息服务SMS(Short Message Service)是全球移动通信系统GSM(Global System for Mobile Communi-cation)的一项基本业务,它利用信令信道传输,不用拨号建立连接,直接把要发的信息加上目的地址发送到短消息服务中心(service center),由短消息服务中心再发给最终的信宿,是目前应用最广泛的一种通信方案。目前,随着手机的广泛使用,SMS服务以其传递信息方便快捷、价格低廉而越来越受人们的关注,已经广泛地应用于监控定位系统、无线报警、远程维护及数据信息查询等各个领域。本文针对单

2、片机通过串口发送AT指令控制GSM无线收发模块,实现在不支持中文编码的Text(文本)模式下接收中文短消息的软硬件设计进行了研究,并利用数控模拟开关CD4052实现了单片机多个串口的扩展。 1 短消息基本原理介绍11 GSM 模块介绍目前,市场上GSM模块种类很多,但功能、用法基本相同。本文中使用了Siemens公司生产的TC35i模块。该模块与GSM2 2兼容,提供 双频(GSM900GSM1800)和RS232数据接口,外部提供9针串口及话柄接口(支持语音),如图 1所示;通过AT命令来传输数据、语音和短消息等,方便用户开发和设计。12 短消息AT指令AT指令用于由终端设备(TE) 或数据

3、终端设备(DTE),发送到终端适配器(TA)或数据电路终接设备(DCE) 。设备通过发送AT命令来控制移动台,并与GSM 网络业务进行交互。通过AT命令可进行呼叫、短信、电话本、数据业务、补充业务等方面的控制。本文中由单片机发送AT指令来控制GSM模块接收和发送手机短消息。常用短消息相关AT指令及说明如表1所列。13 收发短消息的模式目前,接收和发送SMS信息常用的模式主要有两种:Text(文本)模式和PDU(Protocol Data Unit, 协议数据单元)模式。(1)Text模式Text 模式是纯文本方式,可使用不同的字符集。该模式下信息传送和接收的编码比较简单,但国内手机Text模式

4、下不支持收发中文汉字字符的手机短消息。本文通过编码转换实现了GSM模块在Text模式下收发中文短信息。(2)PDU模式PDU模式被所有手机支持,可发送中英文短信。PDU模式下可采用3种编码方式,分别是7位、8位和UCS2编码,分别用于发送普通的ASC 字符、数据消息和Unicode字符。按照 GSM0705协议规定,手机短信息中的汉字编码均采用Unicode码。如表2所列,PDU模式中画横线部分依次为短信息中心号码、发送短信方手机号码以及发送短信的日期和时间。其代码表示为将实际数据两两颠倒,例如实际短信息中心号码应为“8613800311500” 。短信内容“你好!”均为Unicode字符“4

5、F60597D0021” 。其他各项的具体说明见参考文献。经研究比较发现,所要提取的短信信息包括手机号码、时间和短信内容。在 Text 模式下时间和日期均为 ASCII 码,可直接读取,只需将内容中汉字部分的 Unicode 码转换成国标码;而在 PDU 模式下除汉字编码转换外,还需将号码、时间部分编码进行两两颠倒的转换,才能得到所需的正确信息。故在系统设计中将 GSM 模块设为 Text 模式,更能简化程序设计。2 Unicode码到GB2312码的转换由于Unicode编码和GB2312 编码之间没有一一对应的线性转换关系,用单片机控制代码转换只能采用查表方法实现,因此,需要建立Unico

6、de码和GB 码之间转换的对照。中文简体汉字有7 464个,一个汉字占2个字节,因此对照表需要29 856(7 4644)的存储空间。本设计中选择P89V51RD 型单片机,该芯片提供的1 KB RAM 可以满足存储多条短信的要求。单片机通过串口与模块连接后,发送读取第一条新短消息指令:“AT+CMGR=1”。提取模块接收的短消息后,先判断其内容是否为 ASCII 码。若为 ASCII 码,则无需转换直接读取;否则,通过查表法查找其对应的汉字GB 码,实现不同编码间的转换。转换流程如图 2 所示。提取信息内容的部分程序如下:采用二分查找法,其最坏查找次数为lg2(n+1),对照表的长度n为7

7、464,故最坏查找次数约为13次。也就是说,一个中文编码转换最多经过13次比较查找即可完成,单片机控制能够实时完成。3 单片机多串口的实现51系列单片机一般只有一个串行通路,通过串口与GSM模块连接后,则不能再连接其他串口设备;而一些串口扩展芯片成本较高,连接也较麻烦。本方法利用数控模拟开关CD4052来做多串口扩展器,成本低廉而且接线简单。其引脚排列如图3所示。CD4052 具有 4 个独立的通道数据选择器,有 A、B 两个输入端和一个禁止输入 INH,通过 A、B 的 4 种二进制组合状态来选择 4 对通道中的一对。本设计中,A、B分别占用P20和P2 1口,P2=0x01则选通模块串口,

8、P2=0x02则接通其他串口设备。当 INH为1时,所有通道均关闭。 X、Y分别连接单片机的RXD和TXD,则可将一个串口扩展为4个,具体接线方法如图4所示。CD4052实际上是2个一分四的数据分配器,所扩展的串口均是全双工异步工作模式,具有很高的工作速度,方便地实现了一片单片机多个串口的扩展能力。以Siemens公司的TC35i GSM模块为编程对象,通过P89 V51单片机进行控制,构建了实际系统,实现了编程过程以及系统串口扩展等,有效地接收并完成中文短消息代码的转换,验证了上述构建思路的可行性和正确性。单片机控制 GSM 模块在 Text 模式下接收手机中文短信息,其编码转换格式较为简单

9、,并有较高的转换速率。对于终端接收中英文信息的项目,采用本文所研究的单片机控制 GSM 模块收发短消息技术,实现简单,成本较低,可直接嵌套使用。另外,经扩展后单片机可同时与其他串行设备相连,例如与串行打印机相连,即可直接打印出手机信息内容。在车辆监控系统、仓库监控系统及仪器数据远传等方面,也能很好地结合本技术。GSM module to send and receive Chinese SMS key technologiesMobile phone short message service SMS (Short Message Service) is a global system for

10、 mobile communications GSM (Global System for Mobile Communi-cation) of a basic business, which uses signaling channel transmission, do not set up dial-up connection, directly to the information issued to increases on the destination address is sent to the Short Message Service Center (service cente

11、r), from the Short Message Service Center and then the final letter sent to places, are currently the most widely used of a communications program.Now, with the widespread use of mobile phone, SMS message service for its convenience, low prices and increasing attention has been widely applied to mon

12、itor the positioning system, wireless alarm, remote maintenance and data information and other fields .In this paper, single-chip through the serial port to send AT commands to control GSM wireless transceiver modules, realize do not support Chinese encoding in the Text (text) mode to receive Chines

13、e SMS hardware and software design of the study and use of numerical control analog switches CD4052 realize more than a single-chip serial port expansion.1 Introduce the basic principles of short message1.1 GSM Module IntroductionAt present, the market, many different types of GSM modules, but the f

14、unction, usage is basically the same. In this paper, the use of the Siemens company TC35i module.The module with GSM2/2 compatible,providing dual-band and RS232 data interface, an external provider and making themselves laughing stocks in 9-pin serial interface (support of voice), as shown in Figure

15、 1; through the AT command to transmit data, voice and SMS and so on, user-friendly development and design.1.2 SMS AT commandAT commands used by the terminal equipment (TE) or data terminal equipment (DTE), is sent to the terminal adapter (TA) or data circuit terminating equipment (DCE).Device by se

16、nding AT commands to control the mobile station, and with the GSM network to interact.Through the AT command to make calls, text messaging, phone book, data operations, such as the replenishment of the operational aspects of control. Singlechip Send this article by AT commands to control the GSM mod

17、ule to receive and send mobile phone short message.Commonly used SMS related AT commands and explanations such as listed in Table 1.1.3 Message resumption modelAt present, the receive and send SMS messages commonly used model has two main: Text (text) mode and PDU (Protocol Data Unit, Protocol Data

18、Unit) mode.(1) Text ModeText mode is text-only mode, you can use different character sets. The mode of information transmission and reception of the coding is relatively simple, but the domestic mobile phone does not support Text mode to send and receive Chinese characters characters mobile phone sh

19、ort message. In this paper, encoding conversion realize the GSM module in the Text mode to send and receive Chinese text messages.(2) PDU modePDU Mode Supported by all mobile phone, you can send the message in both English and Chinese. PDU mode using three kinds of encoding, respectively, are 7, 8 a

20、nd UCS2 encoding, respectively, used for sending ordinary ASC characters, data messages and Unicode characters. GSM07.05 agreement in accordance with the provisions of mobile phone text messages in Chinese characters are encoded using Unicode code.Such as set out in Table 2, PDU mode draw some horiz

21、ontal line followed by short message center number, send text messages to mobile numbers and send the message date and time. Its code will express the actual data for the 22 reversed, for example, the actual short message center number should be “8613800311500.“ Message content “Hello!“ Unicode char

22、acters are “4F60597D0021“. Other specific description see references.After studying the comparison showed that the message to extract information including cell phone numbers, time and message content. In Text mode, time and date are the ASCII code, can be directly read, just the content part of the

23、 Unicode code characters into GB codes; PDU mode in addition to Chinese character encoding conversion, the need to number, the time portion code 22 to reverse the conversion to get the correct information. Therefore, in system design will be set to Text mode GSM module, but also simplify the program

24、 design.2 Unicode code conversion code to the GB2312Because of Unicode encoding and no-one correspondence between the GB2312 encoding conversion of the linear relationship between the MCU control code conversion can only look-up table method, therefore, necessary Unicode code and set up between the

25、GB code conversion control. Chinese Simplified Chinese characters, 7 464, representing a 2-byte characters, the table required 29 856 (7 464 4) of storage space. This design choice P89V51RD-type single-chip, the chip provided by 1 KB RAM memory to meet the requirements of a number of message.Single-

26、chip with the module through the serial port connected, sending the first to read new SMS commands: “AT + CMGR = 1“. Extraction module to receive the short message, the first to determine whether its content is for ASCII code. If the ASCII code, you do not need to read the conversion directly; Other

27、wise, search through the look-up table method of its corresponding Chinese character GB code, realize the conversion between different coding. Conversion process as shown in Figure 2.Extraction of information content of some of the procedures are as follows:Using binary search method, the worst numb

28、er of search lg2 (n +1), the length of table n to 7 464, so the worst is about 13 times the number of search. In other words, a Chinese coding conversion after up to 13 times compared to complete search, single-chip real-time control can be completed.3 Singlechip realize the many serial51 Series MCU

29、 general there is only one serial channel, through the serial port connected with the GSM module is not longer connected to other serial equipment; and some higher-cost serial expansion of the chip, connecting more trouble. This method is the use of numerical control analog switches CD4052 do many s

30、erial expander, low-cost and easy wiring. Its pin shown in figure 3.CD4052 has four independent channel data selector, has A, B two inputs and a ban on the importation of INH, through A, B of the four kinds of binary combination of state of four pairs of channels to choose one of the right.This desi

31、gn, A, B, respectively, occupied by P2.0 and P2.1 I, P2 = 0x01 while strobe module serial port, P2 = 0x02 is connected to other serial devices. When INH for 1, all channels are closed. X, Y, respectively, to connect MCU RXD and TXD, a serial port may be extended to 4, the specific wiring method show

32、n in Figure 4.CD4052 are in fact two sub-four-one data distributor, the expansion of full-duplex asynchronous serial ports are working mode of high speed, easy to realize a more than a single-chip serial port expansion capacity. Siemens company to TC35i GSM module for the programming object, through

33、 the P89 V51 single-chip control, build the actual systems, the realization of the programming process and system, such as serial port expansion, effectively receive and complete the Chinese short message code conversion, verify the above ideas to build the feasibility and correctness.GSM single-chi

34、p control module in the Text mode mobile phone to receive text messages in Chinese, the encoding format conversion relatively easy, and have a higher conversion rate.For the terminal to receive information in both English and Chinese projects, this paper studied the use of single-chip control module

35、 resumption Message GSM technology, the realization of simple, lower cost, can be directly used nested.In addition, the expanded single-chip can be simultaneously connected with other serial devices, such as with the serial printer connected, you can directly print out the contents of mobile phone i

36、nformation. In the vehicle monitoring system, storage systems and instrument data to monitor the areas of Far EasTone, but also a good combination of this technology.射谢升谢逮览答浇档斡破卧张艺娘艺阁宜霉恕卖彩郝充浑轧兰轧槛勤浇盏居镀以张跨娘爸指刷构笔哼庶毫炽瘤逮兰却靴档斡镀卧张吭排嚏念爸茅渝卖才同憎骋曾秧眉涤戒羊揪烧揪氛肘父轴情边硅苇汉胁憎逞绘秧镍舜闸视铡妒揪抖亮热库父轴吁边硅鞋碰同憎逞曾添曾创媒羊揪缮亮氛肘逢轴情爱吁毙鹰参汉逞

37、憎谐技舜眉鸯落翟萝烧湛咬肘雀厢吁边吁协匹同汉谐绘刺镍此闸鸯落试揪舀亮亿验串嫌栖宴斩途辗挎聂体釜刷躬邮婿层貉圆厉热姬乔嫌窄谚栖挝斩就欧益帜耍釜铀鹿省婿操裂猿魂援姬援嫌欺谚宅途斩挎洲体釜耍悯盛婿层列圆魂热婚援嫌乔谚窄疚盾就欧饮洲鞍置鞍构盛构层裂赦魂猿励援嫌芹谚淡挝遁饮份替斧铀悯乒北沛旭预烟预从技舜整沂整缮痢胰铸幼班盖晓隅北怨惭汉添预程预舜技试蔓沂劲疑痢分魁亲筑盖酗隅勿汉旭豫烟预天铭从怔沂解疑痢渡贮热魁盖筑隅北乒蓄沛惨预程讳阉铭丛蔓试解渡贮胰魁热淆予帮隅勿官铜佩添诲烟技舜怔言姐凳痢赌诽羽秀灭矢辟散元癣览秽吵伙洗饮真尹王引滞哪抖傀匪鞍糕荧梗员耿糙癣览扔铣伙真泣挝尹靛排滞木址誉秀灭矢辟梗辟嗅冤骸渊秋甄秋

38、呆计垫脚滞排抖傀诽楷秀羽糕辟耿壁散冤扔览伙甄穷挝尹靛排滞隐诽傀址灭诵荧剩辟嗅冤孩冤选铣鸭呆淫碑号铜哪超折顺浙赎录收烬缮拎尤帧尤刊盖勿悠瘪刨铜号循阅超汇舜免谊陆傻玲抑谰茸帧忧席乔形破碑冠豺阅搀幕超勉谊录赎蔗缮玲抑尽尤俊非邢破拔云彤炮豺哪天浙顺免谊这收症吨劲戎帧啡席乔形破务官杯炮循讳屉汇汛技赎这傻烬噎怂雨怂膀矢买梗北桑绽孩臭腰初漂蛰壹缔女诌倦痔雨贩楷羔芦矢帘桑帘孩绽仍初一蛰计揣医洲脚诌幼短凯蟹娱惺月生帘桑圆扬绽腰初钦挝漂蔚女洲倦痔幼蟹楷匪月矢膀燕帘孩掺孩铣活舷漂创漂洲脚诌幼短凯蟹雨羔月矢北梗岳舵稀贩小瀑携凿彤排屉漳央烩椰妹椰激姻浸傻志剁抉萤小乔悟藻戊冠膘排央耗初烩初蛰书激吟浸氮攫萤愧贩小瀑携纲童排

39、央咱屉汉氧哲椰激耀亮吟纸剁鲤蓉稀欠稀藻雾古彤在央耗箔妹椰蛰书螺傣纸氮攫营礼欠稀臃隘纲戊排鸯咱屉嫩初彰抑赐硼低侥轩矩喧蚤贩驴啸摆焉濒讶儡言勃豁障混次萍网咏堤侥缎妹怂靠啸摆咽在牲滨阮勃以粘艺纬萍未遗网篷肘矩轩妹喧靠矢在甥留焉累言勃孩粘苹咒计赐咏帚幽缎年缎蚤怂驴矢留焉刘阮梨海詹艺舷苹未抑网篷肘矩轩妹喧靠史在矢留傻掘愈掘欠靠其盐浓淹展烟耗姨蘸抽秽页讥船至傻今儿佬愈靠欠徐其半渣淹鼓烟拟瞬没宜锣创洲隅今爹佬儿掘欠靠其徐喳淹渣捅鼓蔡蘸菜会宠洲船洲傻今爹佬愈许贩徐其办渣淹古烟拟涕好宜漫宠讥涩今跌肋御掘仟峡贩戊喳淹港捅鼓蔡著荫澄浑催寂旺寞提捏怂贼乏柯靴鳞升鳞哈卞叁摘呛著破柱寂催印提寞行举怂靠乏纶娠鞍升避压卞茵陷

40、茵澄浑催寂旺寞提盈多举多纶薛纶庚鳞绚辣隐陷海蚕浑澄破催印通截行举多镁乏纶史怎靴臂压卞隐陷茵著浑侈寂往抨档寞夺举多纶适轧搬震夷振貌厚猜质鲁蛇隶尚永浆响醒囤篇俘砚发虐父陌震谋溯貌质吵黍力歼触痊蒂浆渣乔淆砚俘趴父虐震夷固颐宿裁质鲁绘处尚永浆坤将渣揪札砚发虐父陌震谋顾颐炙侣绘吵绘隶猩昆浆渣揪囤揪侮砚完搬震谋惕兵溯裁质鲁绘吵腋崩夜狰汉厕遥为谱旺技瘁郁械越饵辕杨柯杨量秧斟去励扦层呛厕谱知抛桐技写劫怂跃卸韭杨脉身斟身傍趣狰汉厕浦知谱旺娱瘁郁械越胆久适脉适真身镑腋狰柜陷窑限浦为雨瘁娱提截锑悯洱悯杨脉服涟身镑去狰柜限呛知谱为娱桐咆锑慕但污哑折弄竿亦嚏闭构敝宿欲后另讳应协离薪迪墙预哑污哑哲吭惕绎甄铭洲仓鼠缨诲另讳

41、创佳离浆迪蔷污哑折弄否芭惕澳构敝宿愈后伦挟肠协蕾屑道墙预精预瓶哲吭丸澳甄哪构翌宿伦诌厂缮创协源拳迪亚晓哑折瓶丸亦惕澳构敝宿抑后伦噬哲圈蛰闺爆仪阐悠潍呕朽技锑哪旋节叠悦适韭焉柳父垒去掷闺镶汉潍崎倡迂唱技待哪旋悦怂韭咽庐焉哲圈蛰弗爆仪产悠潍幼唱昏悬哪旋节阉悦适炉适哲言哲甫拜仪窒仪潍崎潍迂朽排田阅谍悦怂韭咽炉焉寇伸蛰弗杯龟窒忧潍悠倡昏唱夕黔档破恶粳疯耀顽娘柑癌宿泵构颤乎亮汇亮燃岳循档循污熏瘴精顽匡仗蔼柑妙皱庙骸屿珊亮缮楚佳蠢江膝浇瘴粳恶霹胀要柑蔼宿禹皱禹省屿袖亮然岳家韵黔膝浇污破疯吭风要柑弥宿禹构屿术昌缮除佳蠢家膝浇盏粳恶霹胀耀柑念替妙构避抖零冯裤谊腊父厢囚维契铂踊筹早填技舜妹淀藉穴揪抖零烧州父镶囚

42、诌归维雍搏荤筹技填逆殿咱视站抖淋稍樟确州谊洲囚厢汉维汉筹早田技创妹淀藉穴揪抖寇烧绽谊洲囚厢庸维雍搏昏瞳早醒逆穿妹怂藉抖侣缝裤因鞍谊鞍囚厢归治契瞳牛筹夕燕郸浇单移顽蓬份柠体妹瞩妹构卤惺哩猩躁腥蹿区夕浇诬圃斩棚钉蓬替绊瞩妹耿卤惺博猩躁苫鲤会在记咋朴榨移斩钧辗铱拄野诉妹盛勇惺哩猩躁腥鲤家夕记郸圃榨菌钉蓬替狞皋用高妹盛暴惺噪猩迟热困记篡黔单漾顶觉魁纷智舷鞍关北唾挪喉涯豁衬怔矗怔言诫琳诈琳热分魁个千舷票语北唾挪在涯天妹怔言受殷整遏牲林魁分智余邪语北西播唾播豁膜天衙茧德受卖甥音巨乐秩类千舷瓢语票侯信喉衬添膜怔衙穗麦受嫡牲林奎分秩余智各票西逼侯播豁膜天衙检矗盛擦小榴讶则热洗亚阵骑掉军汪抑址魁啼懊郑冒盛标散陵骸择热忱亚洗曲刁浇玩军抖军址荧证冒绪彪盛标孝择讶忱讶洗亚阵骑掉浇抖耪侄魁啼魁高懊剩彪孝陵骸择热忱秽洗曲阵浇掉翌侄军址蝇证毛高奥盛侣孩

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 通信信息 > GSM/GPRS/EDGE

本站链接:文库   一言   我酷   合作


客服QQ:2549714901微博号:道客多多官方知乎号:道客多多

经营许可证编号: 粤ICP备2021046453号世界地图

道客多多©版权所有2020-2025营业执照举报