MAX485, serial and programming port

I just ordered my first arduino board. I have a question about the serial / programming port.

The arduino uses the serial port for programming. Can it be used as an ordinary serial port in normal operation? If I connect a MAX485 to it, can I still use for programming?

Or am I completely off the rails?

Yes you can use the hardware serial pins for the MAX485, but while it's connected, you can't upload or use the serial monitor.

If I connect a MAX485 to it, can I still use for programming?

You can use a Leonardo for this, there the hardware serial port is free for you to use and you still have the debugging serial connection (or sketch upload) to the PC over the USB bus.

Great, thanks for the info. I'll use softserial for the RS485 comms then. My needs are very simple but I need to be able to program with the MAX485 connected.

Great, thanks for the info. I'll use softserial for the RS485 comms then. My needs are very simple but I need to be able to program with the MAX485 connected.

SoftwareSerial is not a drop-in replacement for a hardware serial interface. Reliable communication is possible up to 9600 baud, in some cases up to 38400 baud. During the transfer of a byte over the SoftwareSerial interface (independent of the direction) the processor is completely absorbed and cannot be used for anything other. If you can live with this, use the SoftwareSerial. Otherwise you might take a look at the AltSoftSerial library (http://www.pjrc.com/teensy/td_libs_AltSoftSerial.html) or use another Arduino model (Leonardo or Mega) which has more hardware serial interfaces.

I read up on that. I though with 1.0.4, it uses AltSoftSerial by default. Anyway, I am sending about 30 bytes once a second at 9600 baud. I'll have to test that it works.

OK, I was wrong. It uses NewSoftSerial by default.... AltSerial is still optional.

I'm using an Arduino Pro Mini 328 from SparkFun. Any guidance on determining which pins and which timer I can use for AltSoftSerial?

https://www.sparkfun.com/products/11113

I'm using an Arduino Pro Mini 328 from SparkFun. Any guidance on determining which pins and which timer I can use for AltSoftSerial?

The Pro Mini should behave like a standard UNO in this context. That means the pins are D8 and D9 and you loose PWM on pin D10.

Hi, Here's an example using Software Serial and RS485 between two Arduinos:

http://arduino-info.wikispaces.com/SoftwareSerialRS485Example

I was able to run two copies of the Arduino IDE with two USB connections to the two Arduinos and upload sketches for debug, and then test with the serial monitor on one Arduino as it sent data to the remote Arduino. The remote also runs Software Serial and echos the data back. The first Arduino displays the data on the serial monitor.

I think this is the easiest way to debug and test RS485 communications.