Automatic MODBUS-RTU communication baud rate matching method
A technology of automatic matching and baud rate, applied in the direction of data exchange through path configuration, digital transmission system, electrical components, etc., can solve the problem of increasing labor costs for system maintenance
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment Construction
[0011] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.
[0012] Such as figure 1 The baud rate of the slave station and the master station are automatically matched. The following code is based on the STM32F103 chip and calls the STM32F103 library. The specific description is as follows:
[0013] / *
[0014] Slave station communication baud rate combination definition
[0015] * /
[0016] #define UART_RXBUF_DMA_LEN 300
[0017] const unsigned int ASC_Baudrate_Const[15]=
[0018] {
[0019] 9600,19000,38400,57600,93750,1115200,187500,250000,300000,500000,1000000,2000000,
[0020] 2500000
[0021]};
[0022] Unsigned char ASCRevBuf[300];
[0023] Unsigned char BaudrateInde=0;
[0024] Unsggned char ASCRevErroNum=0;
[0025] uint32_t AscDMA_Ptr=0;
[0026] / *
[0027] Serial port receiving processing (using serial port communication DMA method)
[0028] * /
[0029] void OnASC2_Event(void) ...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 