Pages: [1]   Go Down
Author Topic: ATTiny2313V to Arduino over RS485 (MAX485)  (Read 1091 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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):
Code:
// 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):
Code:
// 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.jpg (52.24 KB, 999x710 - viewed 56 times.)
* Arduino_MAX485.fzz (7.05 KB - downloaded 13 times.)
Logged

Pages: [1]   Go Up
Jump to: