Quantcast
Channel: Arduino Forum - Latest topics
Viewing all articles
Browse latest Browse all 15317

How to remove useless PINs in RS485?

$
0
0

I burn the Ameba IoT Arduino into my wifi module realtek 8720DN. I want to use the Audino Modbus lib, but how to set RS485 pins?

I just use the tx/rx to send/receive data, how to remove/disable other useless Pins, like DE, RE pin.

Are there any better practices?

My settings is like bellow:

#ifndef _RS485_H_INCLUDED
#define _RS485_H_INCLUDED

#include <Arduino.h>

#define SERIAL_PORT_HARDWARE Serial1 //Serial use for USB print, Serial 1 use for real MCU's UART communication.

#define SERIAL_PORT_HARDWARE Serial1 //Serial use for USB print, Serial 1 use for real MCU's UART communication.
#define RS485_DEFAULT_TX_PIN 255//fake pins
#define RS485_DEFAULT_DE_PIN 255//fake pins
#define RS485_DEFAULT_RE_PIN 255//fake pins
#define RS485_DEFAULT_PRE_DELAY 50
#define RS485_DEFAULT_POST_DELAY 50
//....

//disable all dePin, rePin logic in RS485.cpp.
void RS485Class::sendBreakMicroseconds(unsigned int duration)
void RS485Class::sendBreak(unsigned int duration)
void RS485Class::receive()
void RS485Class::noReceive()
void RS485Class::beginTransmission()
void RS485Class::endTransmission()

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 15317

Trending Articles