RS232 Shield

From Wiki 来自痴汉的爱
Jump to: navigation, search
RS232 Shield Photo.jpg

Contents

Introduction

RS232 Shield is a standard communication port for industry equipment.This module is base on MAX232,which is a dual driver/receiver that includes a capacitive voltage generator to supply TIA/EIA-232-F voltage levels from a single 5-V supply. The shield integrates DB9 connectors (female) that provide connection to various devices with RS232 interface. Also the RS232 headers will facilitate your connections and commissioning. It provides the welding areas to make full use of extra space on it, which is highly convenient for prototyping.

Specification

  • Meets or Exceeds TIA/EIA-232-F and ITU
  • Operates Up To 120 kbit/s
  • Low Supply Current
  • LED Indicator
  • DB9 Connectors(female)
  • Welding Areas

Interface Function

Usage

First,we can test it by computer.

Hardware Installation

  • 1) Seeeduino v3.0,Mini usb Cable,RS232 Shield,RS232 to USB Cable.
  • 2) Make the connections as below. The jumper hats can be used to select the software serial port from the digital pins. You can set them to D7(232_TX) and D6(232_RX), and modify the code to "SoftwareSerial mySerial(7, 6); // 232_TX, 232_RX"

RS232 Shield usage.jpg

Software Part

  • 1) Open Arduino IDE,and copy the code.
 
#include <SoftwareSerial.h>
 
SoftwareSerial mySerial(7, 6); //232_TX,232_RX
 
void setup()
{
    // Open serial communications and wait for port to open:
    Serial.begin(9600);
    while (!Serial) {
        ; // wait for serial port to connect. Needed for Leonardo only
    }
 
 
    Serial.println("Goodnight moon!");
 
    // set the data rate for the SoftwareSerial port
    mySerial.begin(9600);
    mySerial.println("Hello, world?");
}
 
void loop() // run over and over
{
    if (mySerial.available())
    Serial.write(mySerial.read());
    if (Serial.available())
    mySerial.write(Serial.read());
}
  • 2) Upload the code. Note that you should select the correct board type and COM port.
  • 3) Open the Serial Monitor.

You can see :
RS232 Shield usage1.jpg

Resource

Personal tools
Namespaces

Variants
Actions
Bazaar
Navigation
Collections
Toolbox