1 Introduction
At present, the multi-microcomputer system composed of single-chip microcomputer and PC through serial interface has been widely used in industrial control, environmental monitoring and other occasions. Most of these systems use RS-232, RS-485 or wired modem communication methods. Although they are very economical and applicable, the wired data transmission method greatly limits their use occasions, making them unusable in areas where it is difficult to set up communication lines. In view of this situation, this paper uses an embedded wireless CPU that supports voice, short message SMS (ShortMessage Service), data communication, fax and other services, combined with the existing single-chip microcomputer 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, and realizes two-way transmission of wireless data. By modifying the software and hardware, it is also possible to realize 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.
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 Cygnal C8051F020 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. Enhanced ESD structures provide protection for all transmitter outputs and receiver inputs to 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.
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. The first is 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 write the driver function of TC35i 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. [page]
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 short message receiving program is shown in Figure 8.
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 Ultrasonic Distance Measurement System Based on Single Chip Microcomputer
Next article:Design of Touch Screen Controller Based on AT89C2051
- Popular Resources
- Popular amplifiers
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- Another technical solution for power-type plug-in hybrid: A brief discussion on Volvo T8 plug-in hybrid technology
- [National Technology N32G457 Review] V. Porting the small embedded multi-button library MultiButton
- Pi Cast celebrates Raspberry Pi's 10th anniversary
- Verilog task call
- [RVB2601 Creative Application Development] + 2 DEMO Trials
- EEWORLD University ---- RT-Thread Studio
- Invite you to make an appointment for TI live broadcast: Analysis of the classic and innovative TI ultrasonic gas flow meter solution + the latest SimpleLink platform wireless products
- 2017 MG6 smart key disassembly (NXP solution, with keyless entry, one-button start)
- Panasonic launches IC air gap interconnect technology to improve chip design performance
- [Sipeed LicheeRV 86 Panel Review] Review Project Summary Report - Desktop Calendar Weather Assistant
- 【AT-START-F425 Review】USB to CAN: Five Serial Port Commands Explained