机械专业外文文献翻译外文翻译基于GSM模块与AT89C51的接口设计及应用.doc

上传人:夺命阿水 文档编号:95175 上传时间:2025-07-10 格式:DOC 页数:7 大小:71.50KB
下载 相关 举报
机械专业外文文献翻译外文翻译基于GSM模块与AT89C51的接口设计及应用.doc_第1页
第1页 / 共7页
机械专业外文文献翻译外文翻译基于GSM模块与AT89C51的接口设计及应用.doc_第2页
第2页 / 共7页
机械专业外文文献翻译外文翻译基于GSM模块与AT89C51的接口设计及应用.doc_第3页
第3页 / 共7页
机械专业外文文献翻译外文翻译基于GSM模块与AT89C51的接口设计及应用.doc_第4页
第4页 / 共7页
机械专业外文文献翻译外文翻译基于GSM模块与AT89C51的接口设计及应用.doc_第5页
第5页 / 共7页
点击查看更多>>
资源描述

1、Based on GSM module and AT89C51 connection design and applicationAbstract: This article through analyzed the GSM module and the monolithic integrated circuit connection design simply introduced the TC35i module commonly used instruction and the coding rule, introduced emphatically the TC35i module a

2、nd the AT89C51 principle of work, the periphery connection electric circuit, the software control technology, at the same time has produced some TC35i module and the AT89C51 connection application procedure, proposed AT89C51 when receive data should pay attention question, thus designed has the GSM

3、module the data transmission terminal. Key word: SIM Card GSM AT Instruction TC35i AT89C51 1 Summarize: Along with correspondence technique of development, according to the service function of the NTT DoCoMo net, just to industry control and control from a distance the realm have continuously extens

4、ion of trend.Is orientation this kind of demand, Siemens company released a new generation wireless correspondence GSM mold piece-TC35i, according to should the short news function of the mold piece, can fast safety credibility realization customer information processing etc. function, special be ap

5、plicable to control centre and terminal equipments distance very far, or inconvenience adoption wired correspondence lie quality etc. situation, for example the oil well information collect behind of deliver, the long range copy form system, city transportation direction etc. all according to the TC

6、35i mold piece to realization.2 The TC35i mold piece introductionCurrently, domestic already beginning usage of the GSM mold piece have a lot, and these of function, method of using difference not big.What this design adoption is a Siemens TC35 the TC35i of the series.On this kind of wireless mold p

7、iece function and TC35 and permit, design tightly packed, consumedly contracted the physical volume of customers product.The TC35i and GSM2/2 and permit,dual-band(GSM900/GSM1800), RS232 the data connect, should mold piece and radio frequency electric circuit and Ji take and integral whole, provide t

8、oward the customer standard of AT order connect, is data, speech, short news and fax provide fast, credibility, safety of deliver, convenience customer of application development and design. 2.1 The GSM AT instruction introduction that the mold has something to do with SMS in the pieceThe order for

9、provide of the GSM- powered mold piece match GSM07.05 and GSM07.07 norm.In the GSM07.07 definition of the AT Command connect and provided a kind of which move terrace and data terminal equipments of in general use connect;The GSM07.05 made to the short news detailed of provision.At short news mold p

10、iece receive network hair of short news, can send out a designation information through a string of, the data terminal equipments can send out toward the GSM mold piece various order.The instruction of GSM AT having something to do with SMS such as List1 to show.The instruction of GSM AT gather, is

11、signed letter, Motorola and HP etc. factory house by Nokia, love to together develop for the GSM system of, among them include control SMS(Short Message Service). List1 With SMS some related instruction of GSM ATAT instruction function AT+CMGC Send an SMS commend(issue a message order) AT+CMGD Delet

12、e SMS message (delete SIM card the information of the memory) AT+CMGF Select SMS message format(choice short news information format:0-PDU;1-文本) AT+CMGL List SMS message from preferred store(list short PDU/TEXT of the news format in the SIM card:In order to read 0REC UNREAD, oneREC READ in order to

13、have already read, 2STOU NSENTs is a due-out, 3STOSENT is already hair, 4ALL is allAT+CMGR Read SMS message (read short news) AT+CMGS Send SMS message (the hair short news) AT+CMGW Write SMS message to memory (to write in the short news of due-out in the SIM memory) AT+CNMI New SMS message storage(t

14、he manifestation lately- receive short news) AT+CPMS Preferred SMS message storage (the choice short news memory) AT+CSCA SMS service center address(the choice short news memory) AT+CSCB Select cell broadcast message messages (choice beehive broadcasting information) AT+CSMP Set SMS text mode parame

15、ters(constitution short news text origin mode parameter) 2.2 The PDU code ruleSend out short news in common use Text and PDU(Protocol Data Unit, agreement data unit) mode currently.The usage Text mode receive and dispatch a message code simple, realization get up very easy, but the biggest weakness

16、be to cant receive and dispatch Chinese message;But PDU mode not only support Chinese message, also the ability send out English message.The PDU mode receive and dispatch a message can the usage be 3 kinds of to code:7-bit, 8-bit and UCS2 code.7-the bit code to used for send out common of ASCII char

17、acter list, 8-bit code Be usually used for sending out data news, UCS2 code used for sending out Unicode character list.General PDUs code is constitute by ABCDEFGHIJKLM 13. A:The address length of the message center, 216 enter to make number(one word stanza)B:The number type of the message center, 2

18、16 enter to make number. C:Message center number, B+C length will from the data decision in the A. D:Document head word stanza, 216 enter to make number. E:Information type, 216 enter to make number. F:Drive call number length, 216 enter to make number. G:Drive call number type, 216 enter to make nu

19、mber, take value together B. H:Drive call number, length from data within F decision. I:Agreement marking, 216 enter to make number. J:The data code a project, 216 enter to make number. K:Term of validity, 216 enter to make number. L:Customer data length, 216 enter to make number. M:Customers data,

20、its length from the data decision in the L.Enactment in J adoption UCS2 code, here is the Unicode character list of Chinese-English. 3 the hardware of the TC35i and list slice machine connect a peoples electric circuitThe TC35i mold piece is main to save according to the processor, GSM radio frequen

21、cy mold piece, power supply mold piece, Shan from the GSM, the ZIF conjunction machine, antenna connect six part constitute.Connect machine with a list slice machine realization electric circuit to connect through a ZIF, should connect read or send out the TC35i mold piece in of data.4 list slice th

22、e software of the machine and TC35i connect and control principleList slice the software of the machine and TC35i connect in fact be list slice the machine pass AT instruction control cellular phone of control technique, first constitution the TC35i mold piece of work mode:AT+CMGF=n, n=0 is a PDU mo

23、de;N=1 write an article this mode;Usually the constitution is a PDU mode, under this kind of mode, ability transmission or accept a transparent data.(customer from definition data)AT+CMGR=n in order to read the short news data of the TC35i mold piece, the n is a short news number.AT+CMGL=n in order

24、to list the short news in the TC35i mold piece, n=0 is the short news which read, n=a the short news which have been already read, n=2 short news which sent out, n=3 for have already send out of short news n=4 is all short news.AT+CMGD=the n is the short news which delete the TC35i mold piece and th

25、e n is a short news serial number. 4 Master routine The software plait distance pass to write in toward the TC35i dissimilarity of AT instruction ability completion variety function, such as network debarkation, read SIM card top telephone number, send out SMS news and receive SMS news etc. The inst

26、ruction sign, constant, PDU data.etc. of AT instruction all code form transmission by ASCII;The transmission transparent data have to pair of the TC35i mold piece of work mode constitution is PDU mode;List slice machine toward the TC35i mold piece after send out each instruction have to with return

27、to car sign conduct and actions should instruction of be over, for example list slice the machine send out instruction inAT+ CMGF=0 toward the cellular phone, its ASCII code sequence is41 H, 54 H, 2 BH, 42 H, 4 DH, 47 H, 46 H, 3 DH, 30 H, 0 DH, the last word stanza 0 DH is to return to car sign, mea

28、n that instruction be over, if have no this to return to car sign, the cellular phone wont identify this instruction.When the AT instruction which receive to an integrity of the TC35i mold piece after, the TC35i mold piece not summary execution should instruction, but first just receive of the ASCII

29、 of the AT instruction code sequence all anti- send out;(contain 0 DH)Secondly send out a the ASCII which return to car sign with a carriage return sign to code, namely 0 DH with 0 AH;Then performance should instruction. The list slice machine read the PDU data of the TC35i mold piece, originality d

30、ata should is 16 enter make number, but read back of data still is an ASCII mean of 16 enter make number.So a word stanza of 16 entered to make number and then became 2 word stanza of ASMII code.But the PDU data data word stanza length within pack part still is actual character list length.But isnt

31、the word stanza which become ASCII code length, this at plait distance should special attention, otherwise receive of data not integrity.The list slice machine is after receiving a PDU data pack data have to its instauration become 16 enter make a data, its calculate way as follows:Establish a for t

32、he ASCII code receive, b for the conversion is behind of 16 enter make number.So if a39 H, b=h-07 H a-30.End pair of in front and back two pieces merger is a word stanza. 5 Concluding remark The usage cellular phone mold piece benefit is at the system integration, the cost be lower.Install correspon

33、dence circuit in secluded region etc. difficulty or uneconomical place, engineering service facilities can freedom vivid of constitution, no longer be subjected to geography condition of restriction.In fine, GSM mold piece the price be cheap, application extensive, application the foreground be capt

34、ivating, pass with cellular phone mold the piece connect can very convenience of design customer demand of the data receive terminal. 基于GSM模块与AT89C51的接口设计及应用摘 要 本文通过分析GSM模块与单片机的接口设计简单介绍了TC35i模块的常用指令及编码规则,着重介绍了TC35i模块与AT89C51的工作原理、外围接口电路、软件控制技术,同时给出了一些TC35i模块与AT89C51接口的应用程序,提出了AT89C51在接收数据时应该注意的问题,从而

35、设计出具有GSM模块的数据传输终端。 关键词 SIM卡 GSM AT指令 TC35i AT89C51 1 概述: 随着通信技术的发展,基于移动通信网络服务功能,正向工业控制和遥控领域有不断扩大的趋势。为适应这种需要,西门子公司推出了新一代无线通信GSM模块TC35i,基于该模块的短消息功能,可以快速安全可靠地实现用户信息处理等功能,特别适用于控制中心与终端设备距离很远,或不便采用有线通信介质等场合,例如油井信息采集后的传输、远程抄表系统、城市交通导向等均基于TC35i模块来实现。 2 TC35i模块介绍 目前,国内已经开始使用的GSM模块有很多,而且这些模块的功能、用法差别不大。本设计采用的是

36、西门子TC35系列的TC35i 。这种无线模块功能上与TC35兼容,设计紧凑,大大缩小了用户产品的体积。TC35i与GSM2/2兼容、双频(GSM900/GSM1800)、RS232数据接口,该模块及射频电路和基带与一体,向用户提供标准的AT命令接口,为数据、语音、短消息和传真提供快速、可靠、安全的传输,方便用户的应用开发及设计。 2.1 模块中与SMS有关的GSM AT指令介绍 GSM引擎模块提供的命令符合GSM07.05和GSM07.07规范。GSM07.07中定义的AT Command接口,提供了一种移动平台与数据终端设备之间的通用接口;GSM07.05对短消息作了详细的规定。在短消息模

37、块收到网络发来的短消息时,能够通过串口发送指示信息,数据终端设备可以向GSM模块发送各种命令。与SMS有关的GSM AT指令如表一所示。GSM AT指令集,是由诺基亚、爱立信、摩托罗拉和HP等厂家共同为GSM系统研制的,其中包含了对SMS(Short Message Service)的控制。 2.2 PDU编码规则 目前,发送短消息常用Text和PDU(Protocol Data Unit,协议数据单元)模式。使用Text模式收发短信代码简单,实现起来十分容易,但最大的缺点是不能收发中文短信;而PDU模式不仅支持中文短信,也能发送英文短信。PDU模式收发短信可以使用3种编码:7-bit、8-b

38、it和UCS2编码。7-bit编码用于发送普通的ASCII字符,8-bit编码通常用于发送数据消息, UCS2编码用于发送Unicode字符。一般的PDU编码由ABCDEFGHIJKLM十三项组成。 A:短信息中心地址长度,2位十六进制数(1字节) B:短信息中心号码类型,2位十六进制数。 表一 与SMS相关的若干GSM AT指令 AT指令 功 能 AT+CMGC Send an SMS commend(发出一条短信息命令) AT+CMGD Delete SMS message (删除SIM卡内存的信息) AT+CMGF Select SMS message format(选择短消息信息格式:

39、0-PDU;1-文本) AT+CMGL List SMS message from preferred store(列出SIM卡中的短消息格式PDU/TEXT:0“REC UNREAD”为未读,1“REC READ”为已读,2“STOU NSENT”为待发,3“STOSENT”为已发,4“ALL”为全部 AT+CMGR Read SMS message (读短消息) AT+CMGS Send SMS message (发短消息) AT+CMGW Write SMS message to memory (向SIM内存中写入待发的短消息) AT+CNMI New SMS message stora

40、ge(显示新收到的短消息) AT+CPMS Preferred SMS message storage (选择短消息内存) AT+CSCA SMS service center address(短消息中心地址) AT+CSCB Select cell broadcast message messages (选择蜂窝广播信息) AT+CSMP Set SMS text mode parameters(设置短消息文本模式参数) C:短信息中心号码,B+C的长度将由A中的数据决定。 D:文件头字节,2位十六进制数。 E:信息类型,2位十六进制数。 F:被叫号码长度,2位十六进制数。 G:被叫号码类型

41、2位十六进制数,取值同B。 H:被叫号码,长度由F中的数据决定。 I:协议标识,2位十六进制数。 J:数据编码方案,2位十六进制数。 K:有效期,2位十六进制数。 L:用户数据长度,2位十六进制数。 M:用户数据,其长度由L中的数据决定。J中设定采用UCS2编码,这里是中英文的Unicode字符。 3 TC35i与单片机的硬件接口电路 TC35i模块主要由GSM基于处理器、GSM射频模块、供电模块、闪存、ZIF连接器、天线接口六部分组成。通过ZIF连接器与单片机实现电路接口,该接口读取或发送TC35i模块中的数据,将是本文论述的重点,也是TC35i应用的核心。4 单片机与TC35i的软件接口

42、及控制原理 单片机与TC35i的软件接口其实就是单片机通过AT指令控制手机的控制技术,首先设置TC35i模块的工作模式:AT+CMGF=n,n=0为PDU模式;n=1为文本模式;通常设置为PDU模式,在这种模式下,能传送或接受透明数据(用户自定义数据)。AT+CMGR=n为读TC35i模块短消息数据,n为短消息号。AT+CMGL=n为列出TC35i模块内的短消息,n=0是未读的短消息,n=1位已读的短消息,n=2位未发送的短消息,n=3为已发送的短消息n=4为所有短消息。AT+CMGD=n为删除TC35i模块的短消息,n为短消息编号。 4 程序设计 软件编程通过向TC35i写入不同的AT指令能

43、完成多种功能,如网络登陆、读取SIM卡上电话号码、发送SMS消息、接收SMS消息等。AT指令的指令符号、常数、PDU数据等都是以ASCII编码形式传送;传送透明数据必须把TC35i模块的工作模式设置为PDU模式;单片机向TC35i模块发送每一条指令后,必须以回车符作为该条指令的结束,例如单片机向手机发送“AT+CMGF=0”这条指令,其ASCII编码序列为“41H、54H、2BH、42H、4DH、47H、46H、3DH、30H、0DH”,最后一个字节0DH就是回车符,表示该条指令结束,如果没有这个回车符,手机将不识别这条指令。当TC35i模块接收到一条完整的AT指令后,TC35i模块并不立即执

44、行该条指令,而是先把刚才接收到的AT指令的ASCII编码序列全部反发送出来(含0DH);其次发送一个回车符和一个换行符的ASCII编码,即0DH和0AH;然后执行该指令。 单片机读取TC35i模块的PDU数据时,原始数据应该是16进制数,但读回的数据仍然是ASCII表示的16进制数。这样一个字节的16进制数就变成了2个字节的ASMII码。但是PDU数据包中的数据字节长度部分仍然是实际字符长度。而不是变成ASCII码的字节长度,这在编程时应特别注意,否则,接收的数据就不完整。单片机接收到PDU数据包数据后,必须将其恢复成16进制数据,其算法如下:设a为接收的ASCII码,b为转换后的16进制数。那么如果a39H,则b=a-30h-07H。最后把前后两个数合并为一个字节。 5 结论 使用手机模块利于系统集成,成本较低。在偏远地区等架设通信线路困难或不经济的地方,工程服务设施可以自由灵活的设置,不再受地形条件的限制。总之,GSM模块价格低廉、应用广泛,应用前景诱人,通过与手机模块接口可以很方便的设计出用户所需要的数据接收终端。

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

当前位置:首页 > 论文 > 毕业论文

宁ICP备18001539号-1