Codey OnlineBiblioteka komponentów Arduino i ESP32 › MAX3232 RS232 to TTL Serial Converter Module
MAX3232 RS232 to TTL Serial Converter Module
Inne

MAX3232 RS232 to TTL Serial Converter Module

Moduł konwertera portu szeregowego MAX3232 RS232 na TTL, żeńskie złącze DB9 do Arduino i

Szerokość: 34.4 mm

Pinout — MAX3232 RS232 to TTL Serial Converter Module

Pin Sygnał Opis
GND ground Ground reference for the TTL side and module power.
TXD TX TTL-level transmit output from the MAX3232 to the MCU UART RX.
RXD RX TTL-level receive input to the MAX3232 from the MCU UART TX.
VCC power Logic supply input for the MAX3232 module, typically 3.3V or 5V.

Przykładowy schemat połączeń — MAX3232 RS232 to TTL Serial Converter Module

Z Do Przewód
board:5V x1:VCC red
board:GND x1:GND black
board:D2 x1:TXD green
board:D3 x1:RXD blue

Przykładowy kod Arduino — MAX3232 RS232 to TTL Serial Converter Module

Ten przykład został napisany i sprawdzony kompilacją dla arduino-uno. Codey Online dostosuje go do każdej innej obsługiwanej płytki.

// MAX3232 RS232 to TTL Serial Converter Module
// Arduino Uno example: simple serial bridge using SoftwareSerial.
// 
// Wiring used:
// Arduino D2 <- module TXD
// Arduino D3 -> module RXD
// 5V -> VCC, GND -> GND

#include <SoftwareSerial.h>

static const uint8_t MAX3232_RX_PIN = 2; // Arduino receives on this pin (connect to module TXD)
static const uint8_t MAX3232_TX_PIN = 3; // Arduino transmits on this pin (connect to module RXD)

SoftwareSerial max3232Serial(MAX3232_RX_PIN, MAX3232_TX_PIN);

void setup() {
  Serial.begin(9600);
  while (!Serial) {
    ;
  }

  max3232Serial.begin(9600);

  Serial.println("MAX3232 TTL serial example");
  Serial.println("Type in the Serial Monitor and press Enter.");
  Serial.println("Text will be sent to the module RXD pin and echoed back from TXD if the external RS232 device replies.");
}

void loop() {
  // Forward data from the USB serial monitor to the MAX3232 module.
  while (Serial.available() > 0) {
    char c = (char)Serial.read();
    max3232Serial.write(c);
  }

  // Show any data coming back from the MAX3232 module.
  while (max3232Serial.available() > 0) {
    char c = (char)max3232Serial.read();
    Serial.write(c);
  }
}

Podobne komponenty

4-Channel Optoisolator Board

4-Channel Optoisolator Board

AD9850 DDS Signal Generator Module

AD9850 DDS Signal Generator Module

Adjustable Step-down Module 3-40VDC  1.5-35VDC LM2596

Adjustable Step-down Module 3-40VDC 1.5-35VDC LM2596

Breadboard 400 pin

Breadboard 400 pin

Zbuduj swój projekt Arduino lub ESP32 z pomocą AI

Opisz, co chcesz zbudować. Codey Online napisze kod, narysuje schemat połączeń, skompiluje projekt i wgra go na płytkę bezpośrednio z przeglądarki.

Zacznij za darmo