With the development of embedded applications and the maturity of 16/32-bit RISC processor technology, as well as the emergence and improvement of embedded operating systems that support various high-end processors, embedded wireless devices can use CDMA networks to realize many new applications. The embedded system that automatically sends MMS is one of such new applications. Under certain conditions, the system automatically sends MMS to the designated mobile communication terminal. This application system is an automatic MMS sending system that sets trigger conditions according to requirements. When the trigger conditions are met, the device automatically controls the capture and compression image components to shoot external images. After analog-to-digital conversion, digital compression and other processing, the processor performs MMS (Multimedia Message Service) protocol encapsulation, and the encapsulated data is sent to the mobile switching network via the mobile phone module and finally forwarded to the mobile communication terminal user.
System overall design ● System main processor
The system uses Samsung's 16/32-bit ARM7TDMI-based microprocessor, which has a maximum main frequency of 130MIPS and supports the 16-bit Thumb instruction set. Using the Thumb instruction set, you can get 32-bit system performance with a 16-bit system overhead. ● System principle block diagram
The system is logically divided into three parts: the image capture and image compression module is used to capture and compress images; the MMS protocol processing and main controller module processes image data and task control; the mobile phone module can send MMS and receive SMS. The system principle is shown in Figure 1.
Figure 1 System block diagram
● System working principle and steps
(1) After the system is powered on, the mobile phone module reads the UIM information and sends a wireless signal to find the CDMA network. After completing the user number account and identity authentication, it connects to the network. Then the system initiates a task to read the information in the mobile phone module to determine whether there is a network connection. If there is a network connection, the system initiates a task and waits for the conditions to be met to trigger the automatic sending of MMS.
(2) The device software can receive SMS (Short Message Service) messages, parse them, and take actions based on the parsed results. When the system receives a trigger from the user, it initiates a task to control the serial port UART to command and control the image capture and compression modules and take photos; after taking photos, it initiates a task to read the serial port and receive the image data sent back by the image capture and compression modules.
(3) After receiving the returned image data, the system initiates a task to encapsulate the image data into MMS. The encapsulation format fully complies with the MMS CLIENT protocol.
(4) The system initiates a task to establish a connection with the WAP information gateway using the WAP protocol. After the connection is established, the system transmits the encapsulated image data to the mobile phone module through the standard serial port UART. Finally, the system initiates a task to control the mobile phone module to send the color image to the mobile switching network using AT commands, and finally forwards it to the set target mobile communication terminal user, thereby completing the function of automatically sending MMS.
● System hardware design The technical points of system hardware design include the following parts. (1) The image compression processing module completes the compression of digital image information. Part of the circuit is shown in Figure 2. SDRAM is used to cache image data, and FLASH is used to store the compression processor execution program image. In addition, the image compression processor module provides a UART interface to transfer the compressed image file to the main control processor module.
Figure 2 Image compression processing circuit
Figure 3 System serial port connection circuit
(2) Part of the system serial port connection circuit is shown in Figure 3. The ARM7 processor provides a standard UART interface to connect to the mobile phone module, and also provides a serial interface to connect to the serial interface of the image compression processor module.
System software design ● Operating system and development environment VxWorks is the real-time operating system with the largest number of users in the world. It has rich application software support, good technical services, scalability (VxWorks provides more than 1,800 application programming interfaces for users to choose and use), scalability (users can configure VxWorks according to their own application requirements to generate operating system images with various functions) and reliable system stability. This system mainly adopts its real-time, multi-tasking, priority-based preemptive scheduling, same-priority round-robin scheduling, communication and synchronization mechanisms between tasks, and communication mechanisms between tasks and interrupts.
The development environment of VxWorks is Tornado provided by Wind River. Tornado adopts the host-target machine development method. The host system uses a workstation or PC running Windows 2000/NT, and VxWorks runs on a target processor such as ARM. The host-target machine connection method adopted by Tornado is Ethernet, serial line, etc. The communication between the host and the target machine is completed by running the proxy process on each processor, so that the development tools on the host and the operating system of the target machine can be completely separated from the way of mutual connection. Tornado provides a variety of application tools such as a friendly visual development interface, a cross-compilation environment, a source code-level debugging tool, a target machine command interpreter, and a target machine status monitor, providing an efficient and reliable platform for application software development.
● Software Design Principles The software design adopts an event-driven mechanism; the interrupt event activates the ISR, which queues the event and notifies the processing task through the semaphore's v operation. The processing task performs the p operation and blocks when there is no event to be processed. If a semaphore is obtained, it performs corresponding processing according to the content of the event queue; the event processing task is a permanent loop. The software design process is shown in Figure 4.
Figure 4 Software Flowchart
● Specific implementation of key software designs (1) When the system starts, it waits for a period of time. If it times out, it loads the kernel normally to boot. If it receives configuration parameter request information from the serial port UART, it sends the configuration file to the PC through the serial port UART. After the PC processes the configuration parameters, it sends the parameters to the device through the serial port, and the device stores the parameters in the form of a file.
(2) Initialize the mobile phone module. First, use the hard reset line of the mobile phone module to hard reset the mobile phone, wait until the mobile phone can respond to AT commands, then turn on the information notification function of the mobile phone, initialize the SMS processing to text mode, activate CDMA, and wait until the mobile phone signal is strong enough.
(3) When a short message that meets the triggering conditions is received, an interrupt processing task is initiated, the short message in the UIM card is read into the buffer, the short message is deleted, and the validity of the short message in the buffer is judged. If it is a valid short message, corresponding processing is performed, and then the parameters configured according to the short message are saved.
(4) The system initiates tasks to take photos and encapsulate them according to the trigger parameters, and calls the function to establish a PPP connection. First, use the AT command ATD#777 to connect to CDMA, then initialize the PPP connection, and set the corresponding IP parameters after the PPP connection is completed.
(5) Then initialize WAP related parameters, establish a WAP connection, call the MMS sending function to send the picture to the destination mobile communication terminal user, and disconnect the PPP connection.
The key source code is as follows. STATUS mmsmain(viod){int ioFd, i;pSysInfo = (sysInfo_t *) calloc(1, sizeof(sysInfo_t));pSysInfo->tickRate = SYS_TICK_RATE;pSysInfo->pQueue = msgQCreate(SYS_MSG_COUNT, sizeof(sysMsg_t), MSG_Q_FIFO);pSysInfo->pCamQueue = msgQCreate(SYS_MSG_COUNT, sizeof(sysMsg_t), MSG_Q_FIFO);pSysInfo->pPhotoQueue = msgQCreate(SYS_MSG_COUNT, sizeof(sysMsg_t), MSG_Q_FIFO);pSysInfo->pModemQueue = msgQCreate(SYS_MSG_COUNT, sizeof(sysMsg_t), MSG_Q_FIFO);DEBUG_PRINT(("Now begin read config information... "));if (readFlash() == ERROR){initDefaultInfo();readFlash();}DEBUG_PRINT(("Now end read config information... "));#ifndef CDMA_MODULEwhile(wavecomLibInit() == ERROR);for (i=0; i<2; i++){if (startPPP() == OK)break;pppDelete(0);taskDelay(30);wavecomLibInit();}if (i>= 2){DEBUG_PRINT(("startPPP ERROR! "));return ERROR;}if (wapInit()!= OK){DEBUG_PRINT(("wapInit ERROR! "));return ERROR;}#elsecdmaLibInit();#endifsysRecvLibInit();taskSpawn("tCamera", 80, 0, 50 * 1024, cameraTask, pSysInfo->pCamQueue, pSysInfo->pPhotoQueue,2,3,4,5,6,7,8,9);photoSendLibInit();taskDelay(2);irLibInit();if (sysInitInfo->motionDetction)camQSend(SYS_MOTION_PIC, NULL, 0x0200 + sysInitInfo->camPixel);commCallBackFun = commStrHandle;pSysInfo->initialized = TRUE;return OK;}
The main functions implemented are: initializing system parameters, initializing capture and image compression processor modules, initializing mobile phone modem, establishing PPP connection, sending connection packets, disconnecting PPP connection and returning; establishing a task to check modem information reception, establishing the system main loop task, processing the modem information reception task and the content sent to the information queue in the interrupt handler in the main loop task.
Previous article:Hardware design of embedded marine navigator based on BeiDou II system
Next article:ARM driver development method based on FPGA under Linux platform
Recommended ReadingLatest update time:2024-11-16 14:38
- Popular Resources
- Popular amplifiers
- Design of permanent magnet synchronous motor control system based on VxWorks_Zhang Guilin
- Design of Embedded Multi-protocol Communication Controller Based on VxWorks
- Multi-task real-time scheduling design of low-orbit broadband communication payload management software based on VXWorks
- Design and implementation of CPCI multi-channel card driver based on VxWorks
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- EEWORLD University ---- Introduction to LED functions and considerations for LED driver design
- Please recommend 4G module
- [GD32E231 DIY Contest]——07. Getting Started with GD32E231C-START
- EEWORLD University Hall-Zhengdian Atom teaches you how to learn STM32-M7
- The Problem with UUIDs
- A heating unit power supply scheme with constant and adjustable output power based on TPS61022
- AMIC110 SoC makes industrial communications simple
- STM32F446 NUCLEO 3.5 inch TFT LCD driver
- Allegro reports an error when drilling files
- Digital clock design based on FPGA (video source code)