Method and chip for serial communication
A serial communication and chip technology, applied in the field of electronic communication, can solve problems such as waste of bus resources, and achieve the effects of low cost, high efficiency and good industrial value
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0037] As shown in Figure 1, the method for serial communication in the present invention includes the following steps: 1. system initialization, after opening the serial port, first set the serial port chip communication parameters and FIFO interrupt trigger level; 2. send communication data frames, distinguish address data and application The flag bit of the data, and cache all the data into the cache of the operating system driver and the FIFO cache on the chip. The steps include: setting the parity bit to "1", then sending the address, and then setting the parity Bit is set to "0", send data; ③ Receive communication data frame.
[0038] According to the configuration requirements of common non-real-time multitasking operating systems such as Windows and Linux, especially affected by wiring costs and distances, 9600 and 19200 are the two most commonly used baud rates in industrial applications. Taking the baud rate of 9600 as an example, various configurations in the presen...
Embodiment 2
[0054] As shown in Figure 1, the method for serial communication in the present invention includes the following steps: 1. system initialization, after opening the serial port, first set the serial port chip communication parameters and FIFO interrupt trigger level; 2. send communication data frames, distinguish address data and application The flag bit of the data, and cache all the data into the cache of the operating system driver and the FIFO cache on the chip. The steps include: setting the parity bit to "1", then sending the address, and then setting the parity Bit is set to "0", send data; ③ Receive communication data frame.
[0055] Taking the baud rate of 19200 as an example, various configurations in this embodiment are described. Moreover, the 9600 baud rate can also be set with such parameters.
[0056] The settings of the serial port driver are as follows:
[0057] Read Interval Timeout Read Interval Timeout=5ms;
[0058] Read timeout constant Read Total Timeou...
Embodiment 3
[0067] As shown in Figure 2, the method for serial communication in the present invention includes the following steps: 1. system initialization, after opening the serial port, first set the serial port chip communication parameters and FIFO interrupt trigger level; also need to query and configure the timer accuracy Timer Resolution. ② Send the communication data frame, distinguish the flag bit of the address data and the application data, and cache the flag bit and all data of the difference address data and the application data to the buffer memory of the operating system driver and In the FIFO buffer on the serial communication chip, the steps include: setting the parity bit to "1", then sending the address, then setting the parity bit to "0", and sending the data; after sending the address and data, both Waiting is required, and the waiting time is set according to the length of the character to be sent and the baud rate. ③ Receive communication data frame.
[0068] For...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 