With the continuous development of information technology, embedded WinCE is increasingly used in the field of industrial control. It is mainly used as the operating system of the host computer. As an industrial-grade single-chip microcomputer chip, the LPC935 microcontroller is widely used in various industrial control equipment. In many complex applications, one LPC935 microcontroller is impossible to meet the needs, and multiple LPC935 microcontrollers are required to work together. At this time, how to achieve the communication of multiple LPC935 microcontrollers has become the key to the design. Based on the embedded WinCE device as the core, replace the traditional PC to build a CAN communication system. Combining the advantages of embedded, single-chip microcomputer, and network communication technology, the complex communication protocols and data formats of each independent system are uniformly converted to achieve mutual communication between systems. Combining embedded WinCE with single-chip microcomputers will have important practical value and broad application prospects.
1. Hardware Platform
1) Embedded WinCE uses Zhou Ligong's TIPC-700 as the hardware platform. The main hardware resources include S3C2440A processor, 1 isolated CAN-bus interface, 1 10/100M Ethernet interface, 2 RS-232C serial ports, etc. According to the requirements of the core hardware, the required WinCE system kernel is customized. The application is written in the Visual Studio 2005 integrated development environment.
2) The LPC935 microcontroller is a single-chip packaged microcontroller that uses a low-cost package. It uses a high-performance processor processing structure, and the instruction execution time only takes 2 to 4 clock cycles. 6 times that of the standard 80C51 device. It has high integration and rich peripherals, 2 4-input 8-bit A/D converters/DAC outputs, 2 analog comparators, 2 16-bit timers/counters and a 23-bit system timer, enhanced UART and SPI communication ports. The LPC935 integrates many system-level functions, greatly reducing the number of components and circuit board area and reducing system costs. Therefore, it has been widely used in many fields.
3) Establish ActiveSync connection between TIPC-700 and PC through USB, and embedded WinCE and LPC935 communicate through isolated CAN-bus interface.
4) Each sub-board controls 4 colorimetric cells, each colorimetric cell has 3 detection channels, and each sub-board can perform 12-channel detection, but each colorimetric cell only uses one channel for detection at a time. Therefore, each sub-board can perform 4-channel detection at the same time, and 4 sub-boards can perform 16-channel detection at the same time, thus achieving the purpose of multi-channel detection. The subsequent communication protocol is designed based on this.
2. Customization of embedded WinCE platform
WinCE is a 32-bit, multi-threaded, multi-tasking operating system that uses an API that is independent of the usual programming language and compatible with Windows. WinCE has good communication capabilities and a very good graphical user interface. The WinCE operating system is divided into hardware layer, OEM adaptation layer, operating system layer, application support library, application development layer, and application integration layer. Each layer can only rely on or call one-way. This makes the calling relationship between functional modules clearer. In order to make the system more scalable and have a clearer structure, the WinCE system often needs to be customized.
WinCE provides a tool called PB (PlatformBuilder), which is the main integrated development environment of WinCE. Through this tool, you can easily customize and cut out WinCE operating systems that meet different design requirements according to different hardware. The complete WinCE operating system includes the following: Bootloader, CPU initialization code, driver programs (keyboard, mouse, sound card, graphics card, IDE, COM, USB), user interface interface, and application programs that complete specific functions.
3. Bottom board CAN design
The main control chip used in the baseboard is LPC935, which is a type of microcontroller that does not have an on-chip CAN. However, it has an SPI interface. The design uses the SPI interface plus an independent CAN controller (MCP2515) to implement the CAN function. MCP2515, as a CAN controller, is an independent controller mainly used for local area network control in general industrial environments and fully supports the CAN bus V2.0A/B technical specifications. The CAN transceiver uses TJA1050T, which can operate multiple CAN networks at the same time and provide a transmission rate of up to 1Mb/s. At the same time, optoelectronic isolation is used to improve the stability of the system. It is used to realize the communication between the baseboard and the embedded WinCE device.
4. CAN communication protocol design
In order to enable embedded WinCE and multiple LPC935 microcontrollers to communicate, the key is to have a good communication protocol. This includes making unified regulations on data format, communication method, transmission speed, transmission steps, error detection method, and control character definition [5]. From the design of the hardware platform, we can know that each sub-board controls 4 colorimetric cells, and each colorimetric cell can be set to 3 detection channels. Therefore, each sub-board can control 12 detection channels and number them 1-12. However, each sub-board can only select 1 channel from the 3 channels of each colorimetric cell for detection at a time, and can only detect 4 channels at a time. The entire system can detect 16 channels at the same time. The frame format of CAN communication message transmission includes a standard frame with an 11-bit identifier and an extended frame with a 29-bit identifier. This design uses the standard frame format to design the CAN communication protocol.
1) Setting of communication protocol when the main board transmits commands to the sub-board
Identifier setting: fix the upper four bits of the 11-bit identifier to 1010, the following two bits are the board number (0-3), the seventh bit is set to 0 to read AD, set to 1 to set the colorimetric cell LED luminous intensity, and the lower four bits are set to the detection channel (1-12). At this point, the 11-bit identifier is set.
Data field settings: When the 7th bit is set to 0, the data part is one byte (less than 16), indicating the detection item, which is the same as the lower four bits of the identifier. The sub-board adjusts to the corresponding detection state when receiving it. When the 7th bit is set to 1, the light tube is set/calibrated. The lower four bits of the identifier are the detection channel, and the data part is 3 bytes.
2) Setting the communication protocol when the sub-board uploads data/commands to the main board
Identifier setting: The high 4 bits of the 11 bits are fixed to 1010, the next 2 bits are the board number (0-3), the 7th bit is 0, and the low 4 bits are set to the detection channel (1-12).
Data field settings: 8 bytes in total
When uploading a command to a sub-board, the identifier is the same as the uploaded data. The data part is one byte. When it is "0x0b", it means that the detection button has been pressed. When it is "0x0A", it means that the last command has been processed.
Baud rate setting: set to 50K.
Filter setting: The motherboard only filters the high 4 bits of the identifier, and the value is 1010.
The sub-board only filters the high 6 bits of the identifier, the value is 1010XX, XX is the sub-board number 0-3.
For example, if you want to test the test items of channel 1 of the first colorimetric cell of the first sub-board: if it has been calibrated, set the identifier to 10100000001, followed by the corresponding data field, and then you can test the test items of channel 1 of the first colorimetric cell of the first sub-board. If it has not been calibrated, set the identifier to 10100010001, add the corresponding data field to calibrate, and perform the test according to the previous steps after calibration. Similarly, the data/command uploaded by channel 1 can be operated according to the communication protocol written above.
5. Conclusion
CAN communication was first used in the automotive field. With the development of science and technology, CAN communication has been widely used in computer control systems. This paper studies and develops CAN communication between embedded WinCE and multiple LPC935 single-chip microcomputer baseboards, and integrates embedded, single-chip microcomputer and network communication technologies to achieve multi-channel CAN communication, achieving the original design purpose. The communication protocol designed in this paper has been proven to be stable and reliable in practice, ensuring the real-time and accuracy of information transmission between the baseboard and the WinCE control board. It improves the accuracy of data and reduces the packet loss rate. The technology used in this paper has important practical value and broad application prospects in the fields of short-distance control, remote control and industrial control.
Previous article:Analysis on the Application of Single Chip Microcomputer in Electronic Technology
Next article:Design of signal modulation amplifier in dual laterolog tool
Recommended ReadingLatest update time:2024-11-15 16:40
- MathWorks and NXP Collaborate to Launch Model-Based Design Toolbox for Battery Management Systems
- STMicroelectronics' advanced galvanically isolated gate driver STGAP3S provides flexible protection for IGBTs and SiC MOSFETs
- New diaphragm-free solid-state lithium battery technology is launched: the distance between the positive and negative electrodes is less than 0.000001 meters
- [“Source” Observe the Autumn Series] Application and testing of the next generation of semiconductor gallium oxide device photodetectors
- 采用自主设计封装,绝缘电阻显著提高!ROHM开发出更高电压xEV系统的SiC肖特基势垒二极管
- Will GaN replace SiC? PI's disruptive 1700V InnoMux2 is here to demonstrate
- From Isolation to the Third and a Half Generation: Understanding Naxinwei's Gate Driver IC in One Article
- The appeal of 48 V technology: importance, benefits and key factors in system-level applications
- Important breakthrough in recycling of used lithium-ion batteries
- 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
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- Learn ARM development(15)
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- EEWORLD University - Gate driver design pitfalls and how to solve them
- Will MicroPython support multiple VCPs?
- 30 tips for reducing noise and electromagnetic interference
- CircuitPython 6.2.0 Beta 0 released with RPi Pico support
- Download Qorvo's "Fundamentals of Motor Control"
- EEWORLD University Hall ---- understanding Kalman filters
- SOPC.pdf
- For electrostatic simulation experiments on electronic products, should we choose air discharge or contact discharge?
- Components and devices: various types of buses
- [Sipeed LicheeRV 86 Panel Review] - 3 waft-ui component testing