当前位置:网站首页>Common problems and precautions of remote serial port server (adapter) uart/i2c/1-wire/spi PS304

Common problems and precautions of remote serial port server (adapter) uart/i2c/1-wire/spi PS304

2022-07-28 15:57:00 Hebei stable control technology

    PS304(Ports Server channel 4) It is a physical layer protocol repeater of various digital interfaces , Can be realized UART transformation I2C、SPI、 1Wire Telematics , Embedded magnetic isolation dual power supply and auxiliary enhanced power supply circuit 、 Adaptive Cable Algorithm 、 Powerful and flexible S2S Protocol firmware program , String instruction set , Simple user interface . The optimized driver can extend the communication distance to 500~1000 rice . Widely used in electronic equipment development 、 Chip test 、 Industrial digital interface conversion 、 Digital interface learning verification and other fields .

Common problems and precautions
(1) Length of external lead
When connecting external devices or chips with wires , The wire should not be too long , General control at 20CM within , IIC、 SPI、 UART And other digital interface data line driving capacity is limited , Long wires will cause slow communication waveform . When the wire really cannot be shortened , It can be solved by reducing the communication rate 、 Alleviate abnormal communication problems .
(2) IIC Pull up resistance
IIC Bus SDA and SCL It has been connected on the board 2k The pull-up resistance of , When external IIC Device or chip , There is no need to connect the pull-up resistor , When the pull-up resistance of the repeated connection is lower than 1k It will cause failure of normal communication or permanent damage to this product .
(3) UART Communication rate
Modifying the frequency division coefficient of the system clock will cause UART The upper limit of communication rate does not work properly , UART The upper limit of communication rate is inversely proportional to the frequency division parameters , The highest supported communication rate =921600bps/ Frequency division value ( 8 Frequency division time , UART The highest communication rate =921600/8=115200bps), When modifying the system frequency division coefficient , Pay attention to lowering UART The communication rate of , In order to avoid the problem of unable to communicate .
(4) Voltage range
USB2S Support 3.0~5.5V Wide voltage (VCC), Communications and IO(ADC) The lower limit of the maximum withstand voltage of the pin is -0.3V, Cap of 3.6V, W1~W4 The upper limit voltage of the pin is 5.5V, Exceeding the normal voltage range will cause permanent damage to the module . Special attention should be paid to when connecting external test equipment or chips .
(5) Power consumption and burst current
USB2S Its own power is about 50mA, Use USB When supplying power to the interface, it should be noted that the overall power consumption of the connected external chip or device should not exceed 500mA, The sudden change of current at the moment of plugging will cause the voltage to drop and then automatically recover , In the process USB2S It is normal that reset and restart may occur and the connection with the computer is disconnected for a short time . S2STool The tool has the function of detecting hardware and automatically reconnecting . When using other third-party debugging tools , Generally, you can reconnect once after the plug-in operation .
 

Remote serial server ( Adapter )UART turn 1-Wire application

PS304 Yes 4 Passageway 1Wire Interface , Multiple can be connected to each interface at the same time 1Wire chip ( Or equipment ). have 64 position ID Search function ; It has the adaptive function of long-distance lines .

ID Search and cable adaptation detection
Send... To the module [WIRE1][FIND], The module returns all the... Mounted on the search line 1Wire chip ID And the output , Every ID Occupy 8 byte . give an example : Search channel 1 On all the 1Wire chip , The module returns the following information :S2SREC 28 AA 32 B9 21 20 03 94 2D 85 00 10 20 00 00 7A Total return 16 Bytes of data , Every ID8 byte , So channel 1 There are two on 1Wire chip
chip 1ID: 28 AA 32 B9 21 20 03 94
chip 2ID: 2D 85 00 10 20 00 00 7A

During search , The module will detect the cable parameters , Automatically complete cable adaptation correction . When the 1Wire When there is an error in chip operation , Or change the line length , Or when replacing the cable , The above search operation should be repeated , To get the real-time number of chips and chips ID And the adaptability of the module to the cable performance . notes : generally speaking , The longer the cable, the longer the search process takes .

DS18B20 Temperature sensor
DS18B20 yes 1Wire Interface temperature sensor , Can be realized 12 Temperature conversion and output function of bit accuracy . The use method is briefly described as follows .
(1) Start a temperature conversion
Send to the chip 0xCC 0x44, S2S Agreement for : [WIRE1][START][WT2H]CC 44
(2) Reading temperature
Send to the chip 0xCC 0xBE, Then read 2 Bytes .S2S Agreement for : [WIRE][START][WT2H]CC BE[RD2N]

Module return : S2SREC C8 010x01C8 Convert to 10 Into the system for 456, according to DS18B20 Data book description , The number of *0.0625=28.5℃.
(3) Reading temperature ( Using chip only ID)
[WIRE][START][WT10H]55 28 AA 32 B9 21 20 03 94 BE[RD2N]( The underlined part is the known chip ID)
Module return : S2SREC C8 01
0x01C8 Convert to 10 Into the system for 456, according to DS18B20 Data book description , The number of *0.0625=28.5℃.

DS2431 Memory chips
DS2431 Is a 1024 position 1-Wire EEPROM chip , from Four memory pages , each page 256 position . The data is written into a 8 In byte register , After verification, it is copied to EEPROM Memory . It is characterized by , The four memory pages are independent of each other , You can set write protection or EPROM Simulation mode . Yes 2431 The read-write access of the chip must be in 8 Bytes and the starting address must be 8 Multiple .
(1) Read EEPROM
Send to the chip 0xCC 0xF0+ Two byte starting address , Then read 8 Bytes of data .
example : Read EEPROM The address of 0~8, [WIRE][START][WT4H]CC F0 00 00[RD8N]
Module return : S2SREC 31 32 33 34 35 36 37 38
(2) Write EEPROM
2431 The write operation of is divided into write register and register synchronization to EEPROM Two big steps . Write register : Send to the chip 0xCC 0x0F+ Two byte starting address +8 Bytes of data .[WIRE][START][WT4H]CC 0F 00 00[WT8H]31 32 33 34 35 36 37 38[RD2N]
Module return : S2SREC 52 D7(0x52D7 Is sent for this data CRC Check the data )
Read register : Send to the chip 0xCC 0xAA, read 13 byte (3 A register +8 Byte register data +2 byte CRC)
[WIRE][START][WT2H]CC AA[RD3N][DELAY1][RD10N]
Module return : S2SREC 00 00 07 31 32 33 34 35 36 37 38 66 B2
The register is synchronized to EEPROM: Send to the chip 0xCC 0x55+ Two byte starting address +0x07
Module return : S2SREC AA(0xAA Indicates the synchronization is successful )

原网站

版权声明
本文为[Hebei stable control technology]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/209/202207281450387038.html