The processor with Cortex-M3 as the core is a 32-bit processor with low power consumption and low cost. More and more researchers have begun to shift to this field from 51 processors, AVR and other processors. The digital PDA system design uses the STM32ZET6 controller with the Cortex-M3 core. However, since the STM32ZET6 does not have an MMU inside, it cannot transplant WinCE, Linux and other operating systems, so only real-time operating systems such as ucLinux and μC/OS-Ⅱ can be used. After the traditional operating systems ucLinux and μC/OS-Ⅱ are transplanted in the microcontroller, the application program begins to interact with the operating system and the hardware driver. Once a new application is added or the application is changed, the amount of code modification and the stability of the entire operating system will be affected. At this time, a new mechanism is needed to quickly design applications on the basis of ensuring system stability. It is based on this idea that the digital PDA system uniformly encapsulates the real-time operating system, hardware driver, and FATFS, and provides a page-based mechanism. Each page is a thread, using the μC/OS-Ⅱ operating system to switch between tasks, and the application only needs to design the application page according to the page design rules. The design is finally proven to be reasonable and reliable.
1 Digital PDA system principle block diagram description
The hardware circuit part of the digital PDA system consists of a microcontroller STM32F103ZET6, a 16 Mb NOR FLASH memory, a liquid crystal display LCD control circuit, a USB interface circuit, a VS1003B MP3 decoding chip circuit, a 2 Gb misroSD card interface circuit, and a 2.5~5 V power supply circuit. Its structure diagram is shown in Figure 1.
2 Digital PDA system hardware circuit design
2.1 Microprocessor MCU
The microprocessor MCU uses STM32F103ZET6 ARM chip, which is characterized by low power consumption, low price, rich peripheral resources such as FSMC controller, USB, multi-channel SPI and USART, and has MDK programming manual, which is easy to use.
2.2 NOR FLASH memory
NOR FLASH uses M29W128 chip. The function of NOR FLASH is to store page resources, GUI resources, and various font resources. The digital PDA system hardware circuit uses the FSMC controller of the microcontroller to read and write M29W128 NOR FLASH, mainly to improve the reading and writing speed of M29W128. The data stored in M29W128 NOR FLASH can also be read and stored from the microSD card.
2.3 TFT LCD display circuit
The digital PDA system hardware circuit uses the LCD control circuit with HX8312 as the main control chip and connects to the main controller. The data communication between the main controller and the LCD control circuit also uses the FSMC interface of the main controller, the purpose is to quickly transmit data and avoid the LCD screen brushing phenomenon.
2.4 VS1003 audio decoding circuit
VS1003 is an audio decoding chip, which supports Mpeg1 and Mpeg2, WMA, MIDI, MP3 decoding, and supports IMA ADPCM (mono), microphone and line input encoding. VS1003 has a high-performance and low-power DSP processor core VS_DSP, 0.5 KB data RAM. The digital PDA system uses the VS1003 audio decoding chip to realize the music MP3 playback function of the PDA.
2.5 USB interface circuit and microSD card interface circuit
The STM32 microcontroller has a USB interface, which mainly realizes the USB communication of the digital system PDA when it is connected to the PC, and of course it can also power the digital system PDA system. Micro SD realizes the storage of large-capacity data in the digital PDA system.
2.6 PDA internal USB to serial port circuit
PL2303 follows the USB protocol and supports conversion to RS 232. The PDA digital system uses the PL2303 circuit to realize serial communication between the serial port of the main controller and the PC. This circuit is mainly used for system debugging.
2.7 Power supply circuit
The power supply circuit includes five circuits: lithium battery, 5 V external power supply filter circuit, 5 V to 3.3 V, 3.3 V to 2.8 V, and 3.3 V to 2.5 V. They are mainly responsible for providing power to the main controller, decoding chip, SD, and NORFLASH.
[page]
3.1 General Introduction of Software System
Compared with hardware circuits, once the hardware circuit is determined and the circuit is correct, there is basically no major change, while the software part will have very large changes because the application programs are diverse. However, the STM32 microcontroller does not contain MMU like PC processors, and cannot run Linux and WinCE operating systems. However, in many cases, PDA digital systems are required to implement multi-tasking operations, or multi-threaded operations. Therefore, under this condition, the PDA digital system uses μC/OS-Ⅱ to schedule multiple tasks according to priority levels, and the application is based on the operating system and hardware. In order to improve the stability of the operating system and reduce the code modification when adding applications to the digital PDA, the digital PDA system integrates the operating system, GUI, hardware driver, and file system FATFS, and adopts a page mechanism. Each page refers to a page displayed by a TFT LCD, and each page is a thread. When the page is switched, the underlying operating system implements the task switching.
3.2 Transplantation of FATFS file system
Since the PDA digital system uses SD card as a large-capacity data storage, although the main controller STM32 contains SDIO interface, the hardware driver can realize the SD read and write operation as long as the corresponding configuration is performed, but this operation is based on sectors, and the upper-level application operates on files, so the file system must be transplanted. The transplantation step is to associate the SD read and write sector function with the underlying interface function of the file system. The digital PDA system uses FATFS file system, and of course FAT32 file system can also be used. In the FATFS file system, diskio.c provides five interface functions, as shown in Figure 2.
The SD sector read function, sector write function, and SD initialization function of the microSD card driver function are connected to disk_read, disk_write, and disk_initialize in the figure. Of course, the data type integer.h in the FATFS file system must include stm32f10x.h and the data type in integer.h must be changed. You only need to change the BOOL type data in the file system to be consistent with the bool type in stm32f10x.h, and the file system is transplanted. After transplanting the FATFS file system, the digital PDA system can read data according to the commonly used file format when reading the SD card.
3.3 Transplantation of μC/OS-Ⅱ real-time operating system
μC/OS-Ⅱ provides multi-threaded operation and task scheduling for the operating system of the PDA digital system. Since the system requires multi-threaded scheduling, μC/OS-Ⅱ needs to be transplanted for the digital PDA system. The digital PDA system uses semaphore and mailbox mechanisms for multi-task scheduling. μC/OS-Ⅱ is written in standard C language and assembly language. Only the microprocessor-related parts are written in assembly instructions. Therefore, to transplant the μC/OS-Ⅱ real-time operating system on STM32F103ZET6, you only need to change or rewrite the processor-related files OS_CPU.H and OS_CPU_C.C, the assembly file OS_CPU-A.ASM, and the system configuration file OS_CFG.h.
3.4 Hardware driver
The digital PDA system needs to call the drivers of these hardware resources when calling various peripheral interface resources and various hardware resources of the microcontroller. The hardware driver of the digital PDA system consists of the serial port print output driver, SD card driver, VS1003B hardware driver, TFT LCD liquid crystal display driver, 3 SPI serial communication port drivers, NOR FLASH and STM32 FSMC interface driver, and touch screen TSC2046 driver. The above drivers ensure the normal operation of the hardware resources of each module. As the lowest-level driver, these programs ensure that the entire digital PDA system can implement various applications.
3.5 Page and GUI interface
The digital PDA system needs to display the graphical interface on the TFT LCD display, which requires the support of GUI. The digital PDA system adopts GUI design without transplanting uCGui, but rewrites the GUI based on the LCD controller. Since the clock of the STM32F103ZET6 microcontroller is 72 MHz, the advantage of writing in this way is to increase the speed of LCD page display, reduce the occurrence of screen refresh phenomenon, and improve the quality of PDA LCD screen display. The
digital PDA system integrates all the above software, and regards a page displayed on the LCD screen as a thread. The page switching realizes the task switching, and the task switching is realized by the operating system. Through the framework of the page mechanism, when the application is modified or a new application is added, the amount of code modification is reduced to ensure the stability of the system. After the digital
PDA system is started, it enters the homepage thread. The operating system system also switches according to the hardware interrupt and semaphore mailbox mechanism. When the page is switched, the file system or hardware driver will be called. This is the working principle of the PDA system.
4 Conclusion
The design of digital PDA is completed by transplanting the file system and operating system on the hardware circuit design. The whole system requires not only the correct compatibility of the hardware circuit, but also the correct transplantation of the FATFS file system and μC/OS-Ⅱ operating system. The whole system performs task switching based on the page mechanism. It has been proven in practice that the page mechanism can be used for rapid and rigorous application development.
Previous article:Design of intelligent wireless signal transmitter based on ARM
Next article:Interface design between OLED display module and AT91RM9200
Recommended ReadingLatest update time:2024-11-16 15:28
- Popular Resources
- Popular amplifiers
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
- Personal understanding of DSP_28335's interrupt PIE system
- Introduction to the method of board-level online compilation and downloading of C6000 DSP code
- How to draw this shape of 0.35x0.35
- EEWORLD University ---- ARM (IMX6U) bare metal video tutorial (punctual atom)
- EEWORLD University Hall----Texas Instruments field transmitter output interface/fieldbus solution
- Design of Portable Weather Instrument Based on MSP430 Microcontroller
- EEWORLD University ---- Top 5 Simple Electronic projects
- Thank you for being here, thank you EEWORLD Admin-okhxyyo and Orange Kai
- Recommended solutions to reduce Wi-Fi interference
- The MCU cannot run in DC-DC mode of BLUENRG-1