Go Down

Topic: ATTiny2313V to Arduino over RS485 (MAX485) (Read 1 time) previous topic - next topic

sTaX

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: [Select]
// 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: [Select]
// 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.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy