Design of short message communication terminal based on embedded wireless CPU

Publisher:SereneNature7Latest update time:2014-03-14 Source: elecfans Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

 1. Introduction

 This paper uses an embedded wireless CPU that supports voice, short message SMS (ShortMessage Service), data communication, fax and other services, and combines the existing single-chip system to connect the embedded wireless CPU through the RS-232 interface, so as to realize wireless data transmission using the GSM network. The application of embedded wireless CPU in short messages has the characteristics of always online, no dialing, low price, wide coverage, etc. It is particularly suitable for applications that require frequent transmission of small traffic data to realize two-way transmission of wireless data. By modifying the software and hardware, data acquisition systems, GPS/GSM (SMS) mobile vehicle monitoring and positioning systems, mobile POS machines, mobile charging systems, mobile data and Internet access, computer room monitoring, remote maintenance systems, mobile data query securities trading and information query systems, wireless remote detection and control, etc. can also be realized.

  2. System hardware design

  This design uses Siemens TC35i embedded wireless CPU. TC35i is an OEM module based on GSM 900 mobile communication network system launched by Siemens to meet the needs of various professional fields for wireless data transmission, voice transmission and developability. TC35i is compatible with GSM 2/2+, dual-band (GSM900/GSM1800), RS232 data port, compliant with ETS I standards GSM07.07 and GSM07.05, and provides a standard AT command interface. MCU uses CygnalC8051F020 single-chip microcomputer.

  The hardware design of the application system based on TC35i embedded wireless CPU includes the design of TC35i IGT circuit, voltage-stabilized power supply circuit, SYNC/SIM card indicator circuit, serial port circuit connecting C8051F020 and TC35i, and serial interface between C8051F020 and PC. The hardware block diagram of the application system is shown in Figure 1. Special attention should be paid to the design of TC35i IGT circuit and serial interface circuit between C8051F020 and PC.

  


  Figure 1. Application system hardware block diagram

  2. 1. Design of IGT circuit of TC35 i

  For the control of TC35 i module, IGT signal is very important. Only the correct IGT signal can make the TC35 i module operate normally. The module working sequence is shown in Figure 2.

  

TC35 i module working sequence

  Figure 2. TC35 i module working sequence

  The startup circuit consists of an open-drain transistor and a power-on reset circuit. 10ms after the module is powered on (the voltage must be greater than 3V), in order to ensure the normal startup of the entire system, it is required that when the power is turned on, GT must remain at a low level for more than 100 milliseconds before stepping to a high level. In the circuit board, this is done by an RC circuit and the falling edge time of the signal is less than 1ms. After startup, the signal at pin 15 should remain at a high level. After the power is turned on, the +5V power supply charges C through the resistor R, causing the voltage on the positive electrode of the capacitor to rise slowly. After about 100ms, it reaches a high potential, causing the Schmitt trigger to flip and the system to be reset. The circuit design is shown in Figure 3.

  

TC35i's IGT circuit

  Figure 3. TC35i IGT circuit

  2. 2. Design of serial port circuit between C8051F020 and PC

  The serial interface EIA-RS-232C standard specifies electrical characteristics, logic levels and various signal line functions. RS-232-C uses negative logic to specify logic levels. RS-232C cannot be directly connected to the TTL level of the microcontroller (TTL uses high and low levels to represent logic states), otherwise the TTL circuit will burn out. In this design, the serial interface data communication circuit between C8051F020 and PC is based on the SP3223E chip to achieve level conversion and serial communication functions. The power supply voltage of the SP3223E chip is 3~5.5V, which complies with TIA/EIA-232-F and ITUV.28/V.24 standards. It is compatible with 5V logic input, contains 2-way receiving and 2-way sending serial communication interfaces, and the data transmission rate can reach 240 kbit/s. It has the characteristics of low power consumption, high data rate, and enhanced ESD protection. The enhanced ESD structure provides protection for all transmitter outputs and receiver inputs, and can withstand 15kV IEC 1000-4-2 air gap discharge, 8kV IEC 1000-4-2 contact discharge and 15kV human body discharge mode. The biggest feature of the chip is that it can flexibly manage power when there is no data input to the serial port, that is, when ONLINE is low, SHUT.[page]

  When DOWN is high, the ON-LINE function is valid. In normal operation mode, if the chip does not detect a valid signal at the receiving pin, it will automatically enter SHUTDOWN mode, consuming luA of power.

  When the ON-LINE function is valid, if a signal is detected on the receiving or sending pin, the chip is automatically activated and enters normal working state. The circuit design is shown in Figure 4.

  

C8051F020 and PC serial port circuit

  Figure 4. Serial port circuit between C8051F020 and PC

  3. System software design

  Software writing is divided into low-level drivers and application layer programs.

  In order to facilitate software programming, it is necessary to write some low-level drivers for the hardware. First, the driver function of the serial port: open the serial port (OpenComm), close the serial port (CloseComm), read serial port data (fteADComm), write serial port data (WriteComm), etc., which are completed by the control MSCCOMM in this system. Then, the driver function of TC35i is written based on these serial port functions. The microcontroller controls TC35i through the serial port, and the control method adopts the standard AT command set. When sending short messages, the user data must be encoded in the PDU format. The functions are Encode and Decode respectively, and the application layer program is written on this basis. These low-level driver functions will make the writing of the upper-level protocol very convenient. More importantly, it provides a hardware abstraction layer. When the low-level hardware is changed, only the low-level driver function needs to be changed, and the code of the upper-level function remains unchanged.

  The software hierarchy is shown in Figure 5.

  

Software Hierarchy Diagram

  Figure 5. Software hierarchy diagram

  3.1. Host computer software design

  The host computer software is a short message communication manager, running on a PC, and communicating with the microcontroller and TC35i through the serial port. The host computer software consists of RS-232 serial port parameter settings, receiving information, sending information, history recording, sending commands, etc. The host computer software user interface is shown in Figure 6.

  

Host computer software user interface

  Figure 6. Host computer software user interface

  (1) Sending SMS program flow.

  For the short messages in the SIM card, its number, type, sender number, message body and sending time can be displayed. When sending a short message, you should first set and check whether the serial port is open and whether the TC35 i module is correctly connected. You should also determine whether the number of digits of the destination mobile phone and short message center number is correct, and then send the AT command. The flow chart of the short message sending program is shown in Figure 7.

  

Send SMS program flow chart

  Figure 7. Flowchart of the SMS sending program

  (2) Procedure for receiving short messages.

  If TC35 i receives a short message, it will send a prompt message. When the serial port* program receives this prompt message, it will display the content of the short message in the text box. The content of the short message includes the receiving time, sending time, sending mobile phone number, and short message body. The flowchart of the program for receiving short messages is shown in Figure 8. [page]

  

Flowchart of receiving short message program

  Figure 8. Flowchart of receiving short message program

  3.2. Lower computer software design

  The lower computer uses the C8051F020 microcontroller from Cygnal, which has two serial ports UART0 and UART1. During the design, UART0 is connected to the PC host computer (receiving end) or the data acquisition system (transmitting end), and UART1 is connected to the TC35i module. Both serial ports are bidirectional channels, so the microcontroller can control TC35i to send data and receive data through TC35i. The data transmission flow is shown in Figure 9.

  

MCU data transmission flow diagram

  Figure 9. MCU data transmission flow diagram

  Since the interrupt priority of UART0 is much higher than that of UART1, if the query method is used to process the request of UART0 first and then the request of UART1, it is more efficient than the interrupt method, and the program design is simpler. Therefore, this system adopts the query method in the microcontroller serial port program design. The lower computer software program flow chart is shown in Figure 10.

  

Lower computer software program flow chart

  Figure 10. Flowchart of the lower computer software program

  4. Conclusion

  This paper focuses on the hot topic of designing short message communication terminal based on embedded wireless CPU, and describes the design scheme, development method and development process of the corresponding GSM wireless terminal. A wireless CPU terminal capable of sending and receiving text messages is realized, and the design of hardware circuits such as IGT startup circuit and serial interface between single-chip microcomputer, TC35 i and PC is completed. The upper computer software design is completed by adopting object-oriented design method. In the single-chip microcomputer program design, C51 is used for programming, and the polling method is adopted for reading and writing of two serial ports. Due to limited space, the program code is omitted, and the program design flow chart is given.

  Based on this terminal platform, various application systems can be designed by appropriately adjusting and expanding the hardware and software.

Reference address:Design of short message communication terminal based on embedded wireless CPU

Previous article:Design of Electricity Fee Management System for Student Apartments
Next article:Design of SCR Speed ​​Control Circuit to Reduce Noise Interference

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号