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.
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.
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.
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.
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.
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.
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]
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.
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.
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.
Previous article:Design of Electricity Fee Management System for Student Apartments
Next article:Design of SCR Speed Control Circuit to Reduce Noise Interference
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- CGD and Qorvo to jointly revolutionize motor control solutions
- CGD and Qorvo to jointly revolutionize motor control solutions
- Keysight Technologies FieldFox handheld analyzer with VDI spread spectrum module to achieve millimeter wave analysis function
- Infineon's PASCO2V15 XENSIV PAS CO2 5V Sensor Now Available at Mouser for Accurate CO2 Level Measurement
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- Advanced gameplay, Harting takes your PCB board connection to a new level!
- A new chapter in Great Wall Motors R&D: solid-state battery technology leads the future
- Naxin Micro provides full-scenario GaN driver IC solutions
- Interpreting Huawei’s new solid-state battery patent, will it challenge CATL in 2030?
- Are pure electric/plug-in hybrid vehicles going crazy? A Chinese company has launched the world's first -40℃ dischargeable hybrid battery that is not afraid of cold
- MSP430F5529 multi-channel PWM output control servo and motor
- Discrete Difference Amplifiers vs. Integrated Solutions
- What is inter-core communication in a multi-core processor system
- Summary of DSP boot mode / boot loader / power-on sequence / online upgrade and other issues
- [ATmega4809 Curiosity Nano Review] Using MCC in MPALB Xpress
- Use a simple field strength meter to test 433 wireless coverage, wireless dead spots, and compare antenna differences
- Will the reset pin of the microcontroller be invalid?
- Received the X-NUCLEO-IKS01A3 sensor kit
- 【Mil MYD-YA15XC-T】- 0: How to power on?
- Xilinx Zynq-7015 SoC Industrial Core Board SOM-XQ7Z15 Cortex-A9 + Artix-7