5 از 5.0 با 4 رای
It also includes 120-ohm matching resistance. It supports communication between multiple microcontrollers, allowing up to 32 devices on the bus. It can be hot-swappable, in order to prevent signal interference. The module has a 4-pin header on the assembly for connections to the MCU. It automatically takes care of data transmission direction control, so it does not require the extra DE/RE pins required by most other RS-485 modules.
1. Compatible with 3.3V and 5.0V power supply.
2. Compatible with 3.3V and 5.0V signal.
3. Absolute using imported chips; industrial design; anti-interference ability; while using more effective 485 lightning protection design can be used in the industrial field and harsh field environments; the working temperature of -40 ℃ to + 85 ℃; transmission distance up to 1 kilometer (made with 850 meters of cable F1.5 tests recommended using in the 800 meters, when more than 800m please add repeaters).
4. Semi-hole process design, thickness 0.8mm, can easily use as a picture board, it can also be welded terminal use.
5. Has RXD, TXD signal indicator lights, monitor send and receive status.
/* * SCM TTL To RS485 Master Software * Exercise the SCM TTL to RS485 Module. This code runs on the first (Master)device. * Use the SCM_RS485_Slave_Test software for the second (Slave) device * This uses the SoftSerial.h library which comes with the Arduino IDE * Pins used for the soft serial port are fairly arbitrary and can be changed * as needed. Just redefine them below. */ #include <SoftwareSerial.h> const int SSERIAL_RX_PIN = 10; //Soft Serial Receive pin const int SSERIAL_TX_PIN = 11; //Soft Serial Transmit pin // Create Soft Serial Port object and define pins to use SoftwareSerial RS485Serial(SSERIAL_RX_PIN, SSERIAL_TX_PIN); // RX, TX int byteReceived; //=============================================================================== // Initialization //=============================================================================== void setup() { Serial.begin(9600); // Start the built-in serial port Serial.println("Master Device"); Serial.println("Type in upper window, press ENTER"); RS485Serial.begin(9600); // Start the RS485 soft serial port } //=============================================================================== // Main //=============================================================================== void loop() { if (Serial.available()) // A char(byte) has been entered in the Serial Monitor { byteReceived = Serial.read(); // Read the byte RS485Serial.write(byteReceived); // Send byte to Remote Arduino } if (RS485Serial.available()) //Data from the Slave is available { byteReceived = RS485Serial.read(); // Read received byte Serial.write(byteReceived); // Show on Serial Monitor } }
/* * SCM TTL to RS485 Slave Software * Exercise the SCM TTL to RS485 Module. This code runs on the second (slave)device. * Use the SCM_RS485_Master_Test software for the first (Master) device * This uses the SoftSerial.h library which comes with the Arduino IDE * Pins used for the soft serial port are fairly arbitrary and can be changed * as needed. Just redefine them below. */ #include <SoftwareSerial.h> const int SSERIAL_RX_PIN = 10; //Soft Serial Receive pin const int SSERIAL_TX_PIN = 11; //Soft Serial Transmit pin // Create Soft Serial Port object and define pins to use SoftwareSerial RS485Serial(SSERIAL_RX_PIN, SSERIAL_TX_PIN); int byteReceived; int byteSent; //=============================================================================== // Initialization //=============================================================================== void setup() { Serial.begin(9600); // Start the built-in hardware serial port Serial.println("Slave Device"); RS485Serial.begin(9600); // Start the RS485 soft serial port } //=============================================================================== // Main //=============================================================================== void loop() { // Watch for data coming in on the soft serial port. If found, send a copy to the // hardware port to display on the local serial terminal and also echo a copy back out // the soft serial port to the Master device if (RS485Serial.available()) // If data has come in from Master { byteSent = RS485Serial.read(); // Read the byte Serial.write(byteSent); // Show on local Serial Monitor window delay(10); RS485Serial.write(byteSent); // Send the byte back to Master } }