0 Introduction
In the single-chip microcomputer application system, serial data communication usually uses the chip "8251", but because the communication baud rate of 8251 is not high, it cannot be used in the system with high crystal oscillator. This makes it impossible to use the 8251 chip to send and receive data in the system that requires high operating speed and high-speed data transmission and reception. Moreover, 8251 needs MAX3100 to support high-speed communication. The maximum communication baud rate can reach 230KBPS, low power consumption, support low voltage, and the system size is small after design. It is better than using an external clock 8253 to provide an external clock signal. MAXIM's new UART chip MAX3100
It just fills this gap. MAX3100 supports high-speed communication, with the highest communication baud rate up to 230KBPS, low power consumption, and low voltage support. The system size after design is small, which is less than half the size of the printed board designed with external clock 8253. It can also make software design more reliable.
Organic light emitting display (OLED) is a new generation of flat panel display technology that is more advanced than liquid crystal display technology, and is recognized by the industry as the next generation display technology with the most development prospects. Compared with liquid crystal display technology, organic light emitting display (OLED) has the advantages of ultra-lightness, high brightness, wide viewing angle, self-luminescence, fast response speed, wide temperature range, strong shock resistance, low power consumption, and flexible display. Therefore, OLED screens are rapidly expanding their application share in the portable electronic product market and can be used in harsh outdoor environments such as communications, surveying and mapping, railways, and weapons.
1 Main working principle
The system is mainly composed of AT89C52 single-chip microcomputer, MAX3100 universal asynchronous receiver and transmitter, GPS-OEM board, OLED display screen, etc. AT89C52 single-chip microcomputer receives NEMA statements sent by GPS-OEM board through MAX3100, calculates positioning information (including: latitude, longitude, altitude, speed, date, time, heading, satellite status, etc.) through software programming, and displays it on the OLED display screen. And through MAX3100, these positioning information are output as RS232 standard serial port data. The system circuit schematic diagram is shown in Figure 1.
2 Data communication between MCU and GPS-OEM board
The data communication between the microcontroller and the GPS-OEM board is realized through the MAX3100 universal asynchronous receiver and transmitter, in which the microcontroller oscillation frequency is selected to be 11.0592MHz. First, the MAX232 level conversion chip is used to realize the bidirectional conversion between RS232 level and TTL level, because the serial port level of the GPS OEM board is in line with the RS232 standard level, while the MAX3100 uses the TTL level.
The DIN pin of MAX3100 is the serial data input terminal, and DOUT is the serial data output terminal. The rising edge of the serial clock latches the DIN data, and the DOUT data is synchronously output by the falling edge of the serial clock. The serial data sequences of the DIN and DOUT pins of MAX3100 are both 16-bit data, where the first two bits of the DIN data sequence represent the data type of the string. When the first two bits are "1, 1", it indicates a write command, when the first two bits are "0, 0", it indicates read data, and when the first two bits are "1, 0", it indicates write data.
The initialization configuration of MAX3100 is completed by the microcontroller through the write command sequence. The command sequence includes parity bit, data bit, stop bit, baud rate setting, data word length, check FIFO, interrupt enable and other information. MAX3100 has its own baud rate generator, and its oscillator can use a crystal oscillator with a frequency of 1.8432 MHZ or 3.6864 MHZ. The baud rate is determined by the last 4 bits B0~B3 of the write command sequence.
When the microcontroller receives the serial port data from the GPS OEM board, it is completed by reading the MAX3100 data sequence. When the microcontroller reads data from the MAX3100, it needs to write a 16-bit word (0000H) to DIN, and then read the 16-bit word from DOUT. The upper eight bits are: the status of the receive/send buffer, the data error/overflow status, the receive/check bit status and the CTS status. The lower eight bits are the serial port data received from the GPS OEM board.
When the microcontroller sends the final positioning data, it is completed by writing a data sequence to the MAX3100. When the microcontroller writes data to the MAX3100, a 16-bit word is written to DIN, in which the high eight bits are set to: write flag, enable TX output, RTS pin setting, and transmission check bit setting. The low eight bits are the data to be transmitted.
3 OLED display screen displays positioning information
The display screen of the display module is 128 columns and 64 rows. It has 1 row driver and 2 column drivers. The row driver has 64 row outputs, and each column driver has 64 outputs. As long as the power is provided, the drive signal and synchronization signal can be generated. The external signal of the module is only related to the column driver. The column driver has a built-in 64×64-bit display memory. The display status of each pixel on the display screen corresponds to each bit of the display memory. The data of the display memory is directly used as the driving signal for the graphic display. It is displayed when it is "1" and not displayed when it is "0". The OLED display screen in the system displays positioning information such as latitude, longitude, altitude, speed, date, time, heading, satellite status, etc.
4 Software Design
4.1 Application of watchdog interrupt
Pins 6 and 7 of MAX706 are connected to P1.7 and reset pin of AT89C52 respectively. In the software program, a watchdog counter reset instruction is inserted every other program segment. In this way, if a dead loop or illegal code area is entered during program execution, the system will be reset to ensure normal operation of the system.
4.2 Delay processing
When the data to be sent is sent into the send buffer, since MAX3100 has to wait until T=1 when the send buffer is empty before it can receive another data to be sent, it is very necessary to add a suitable delay at this time to ensure that the data sent is accurate.
4.3 Create a font library
When realizing OLED display, the Chinese characters to be displayed are first organized into a Chinese character library, and the English characters or Arabic numerals are organized into a Western character library.
[page]
For example, for the Chinese character “效”, set the font size to Songti size 12, the corresponding dot matrix is width × height = 16 × 16, and the corresponding 32 bytes of horizontal modulus using the modulus software are: {O×10, 0×20, 0×08, 0×30, O×08, 0×20, 0×7F, O×20, 0×14, 0×7E, 0×12, 0×44, 0×21, 0×C4, O×22, 0×44, O×62, 0×28, O x 14, 0×28, O×08, 0×10, 0×0C, 0×10, O×12, 0×28, 0×20, 0×CE, 0×C3, 0×04, O×00, 0×00}.
The Arabic numeral "1" is set to Songti size 12, and the corresponding dot matrix is width × height = 8 × 16. The corresponding 16 bytes of horizontal modulus using modulus software are: {0×00, 0x0o, 0×00, 0×10, 0×70, 0×10, 0×10, O×10, 0×10, 0×10, 0×10, O×10, 0×7C, O×00, O×00}.
4.4 Key points of software design
When designing the software, there are two key parts: one is to process the GPS module data received by the serial port; the other is to display the required positioning information on the OLED display. The software flow chart is shown in Figure 2.
Define an 8-bit shift subroutine in MAX3100. The C language code is as follows:
The task of this subroutine is to complete two tasks by performing 8 shift operations on the DIN and DOUT pins of the MAX3100. The first is the receiving part. After the initialization configuration, the NEMA statement of the GPS module is received through RX and sent to the receiving buffer. The next is the sending part, which receives the SPI data and sends it to the sending buffer, and sends it out through TX in asynchronous serial.
When receiving a NEMA statement, it starts with the line beginning mark "$". Before further processing, the NEMA statement is a long string of byte streams. This information cannot be used before it is classified and extracted. Therefore, the information of each field must be extracted from the byte stream through a software program and converted into positioning information such as latitude, longitude, altitude, speed, date, time, heading, satellite status, etc.
Displaying a certain location information at a certain position on the OLED display is done through software settings, where Row represents the starting row of the location to be displayed, Column represents the starting column of the location to be displayed, and a represents the serial number in the established Chinese character library and Western character library. The C language code is as follows:
5 Conclusion
This system combines the advantages of MAX3100's efficient asynchronous transceiver communication, and absorbs its advantages of low power consumption, small size, fast transmission, ultra-thinness, high brightness, wide viewing angle, self-luminous, fast response speed, wide temperature range, strong shock resistance, and low power consumption. The battery-powered portable GPS positioning system has been designed and developed and has been successfully applied to products with good results.
Previous article:Application of embedded computers in lightning monitoring systems
Next article:Design of Radar Pulse Pre-selector Based on FPGA
Recommended ReadingLatest update time:2024-11-16 16:56
- Mir T527 series core board, high-performance vehicle video surveillance, departmental standard all-in-one solution
- Akamai Expands Control Over Media Platforms with New Video Workflow Capabilities
- Tsinghua Unigroup launches the world's first open architecture security chip E450R, which has obtained the National Security Level 2 Certification
- Pickering exhibits a variety of modular signal switches and simulation solutions at the Defense Electronics Show
- Parker Hannifin Launches Service Master COMPACT Measuring Device for Field Monitoring and Diagnostics
- Connection and distance: A new trend in security cameras - Wi-Fi HaLow brings longer transmission distance and lower power consumption
- Smartway made a strong appearance at the 2023 CPSE Expo with a number of blockbuster products
- Dual-wheel drive, Intellifusion launches 12TOPS edge vision SoC
- Toyota receives Japanese administrative guidance due to information leakage case involving 2.41 million pieces of user data
- 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
- Technical article: The magic of energy monitoring in DC systems
- Please give me some advice on the previous interview questions.
- Powering a Boost Topology Battery Charger with a Solar Panel
- [RISC-V MCU CH32V103 Review] USB flash drive read and write test
- NI Special Month, enjoy up to 40% off on software and more!
- Help: About the ESP32 Anxinke integrated environment project import compilation error
- Various PCB onboard antennas and PCB design points
- 【Silicon Labs Development Kit Review 06】_Transplanting freertos+Vcom+LED
- There is no more comprehensive article about RF chips than this one! Worth saving!
- Supplement: Design of the lower computer for the computer room monitoring project