Hi,
my goal is that a attiny2313V over RS485 with mit Arduino Uno talk.
I use two MAX485 for that.
Datasheet: http://www.datasheetcatalog.org/datasheet/maxim/MAX1487-MAX491.pdf
My breadboard-setup is in the attachment.
Edit: Both sides on the breadboard have +5V and GND. The image is not correct…
This is my code on the Attiny2313V (Transmitter):
// Our Serial RX pin connected to RO- Receiver Output Pin on Max485- we receive on
#define rxPin 0
// Our Serial TX pin connected to DI- Driver Output Pin on Max485 - we send on
#define txPin 1
void setup() {
//sets our Arduino's serial TX pin to send data
pinMode(txPin, OUTPUT);
//sets our Arduino's serial RX pin to receive data
pinMode(rxPin, INPUT);
// opens serial port, sets data rate to 4800 bps(Heatmiser baud rate)
Serial.begin(4800);
}
void loop() {
Serial.write('0');
Serial.write('1');
delay(100);
}
This codes runs on the Arduino (Receiver):
// Our Serial RX pin connected to RO- Receiver Output Pin on Max485- we receive on
#define rxPin 0
// Our Serial TX pin connected to DI- Driver Output Pin on Max485 - we send on
#define txPin 1
// for incoming serial data
byte incomingByte = 0;
void setup() {
pinMode(txPin, OUTPUT);
//sets our Arduino's serial RX pin to receive data
pinMode(rxPin, INPUT);
// opens serial port, sets data rate to 4800 bps(Heatmiser baud rate)
Serial.begin(4800);
//sets our Arduino's serial TX pin to send data
}
void loop() {
if(Serial.available() > 0) {
Serial.read();
}
}
My first step is that the Ardunio becomes data (led on the arduino uno board blinks). Not more.
But currently nothing blinks…
If I connect the TX/RX from the ATTiny direct (without the MAX485’s) to the Ardunio it blinks…
Did you see any mistakes from me? Thanks.
Arduino_MAX485.fzz (7.05 KB)