Connecting RS485 shield to Arduino MKR 1400

Hello everyone,

I want to connect an RS485 shield to my MKR 1400 board. I want to know that if it is necessary to get the MKR 485 shield or can I also connect the RS485 adapter with 3.3V? Like the one as shown in the link:

Thank you!

From what I can tell, the MKR1400 board runs at 3.3V. Any RS485 module that works at 3.3V should work. The MKR485 shield is just a convenient way of adding RS485 without extra wires everywhere.

Note that the RS485 adapter you linked to appears to be one of the auto switching ones that does not use the RE (receive enable) & DE (transmit enable) signals that normally have to be driven by the micro.

markd833:
Note that the RS485 adapter you linked to appears to be one of the auto switching ones that does not use the RE (receive enable) & DE (transmit enable) signals that normally have to be driven by the micro.

Thanks Mark for the input. Yeah that would have been my second question. I saw two shields where one has DE RE and two other pins while the one I am referring to does not have those pins. So, if I use this shield, would that work automatically? I mean normally one has to declare those pins and then make them 0 and 1s in the program. So, with this shield if I use it with my MKR 1400, will that be automatic or would I still need to make changes to the program?

From what I've seen, most of the RS485 implementations make calls to a routine like preTransmission() to switch the RS485 transceiver into transmit mode and postTransmission() to switch it back to receive mode. These functions generally just drive the digital I/O pins connected to RE & DE. They don't have any way of knowing if the I/O pins that have been defined for controlling RE & DE are actually connected or not.

You probably won't have to make any changes to the program. Just remember that the pins defined in the program are not free for normal I/O use and leave them disconnected.

This may be complete garbage (and somebody else will probably jump in and correct me!), but I've not played with the auto switching RS485 modules. From what I recall when tracking down a schematic, they used some version of an RC time constant to keep the RS485 module in Tx mode for some period of time after each byte has been transmitted. Sending bytes in quick succession keeps it in Tx mode. Then after a period of time it reverts back to Rx mode. The problem I can see with this implementation is if the receiving RS485 node tries to respond to the transmitting node before that time period has elapsed. In which case 2 devices are trying to control the RS485 bus at the same time.

I found this link on Arduino forum which is commenting on the same device.

What I understood from their comments is that using that device might not be very useful. I wanted to use that device because I have MKR 1400, which can only accept 3.3 V. Other shields require 5 volts that seems not applicable for MKR boards. The only feasible option I have to opt for the MKR 485 shield, which of course would be more reliable.

Now here comes another question. Actually I want to connect two devices to my Arduino. One device requires UART and the second one require MODBUS RS485 for communication. That means both of them want to use the RX and TX (13 and 14) pins available on the board. However, I can give it to only one device. So, I made another serial following this example. So, now pin 0 is RX and 1 is TX. I tested it on my device that uses UART communication and it worked fine for me. Before I was using it on pins 13 and 14. Now, the pins 13 and 14 will be occupied by RS485. So, the question is, is making the serial on pin 0 and 1 a good idea? Will it be feasible for longer run? Or should I take some other way into consideration? Thanks

The MKR485 shield is currently on offer at 19.53 Euros. Like you say, it uses pins 13 &14 for the data. It also uses pins A5 & A6 to control the Tx & Rx buffers. If you don't mind a few wires, then Sparkfun have an RS485 transceiver breakout that works at 3.3v that costs 10.95 USD (about 9 Euros). It also means that you can connect RE & DE together and drive them from 1 pin - saving a pin if you are short on i/o pins.

According to the SAMD21 datasheet, your MKR 1400 can have several hardware serial ports all at the same time. There's no problem in doing that as far as I can see. However, somebody more knowledgeable on the SAMD21 may jump in and provide additional details.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.