If I want to use a MAXIM 485 for a RS485 communication, is there any option to include the Control DE
and RE'
pin in a natural manner in the code, instead changing the control pin everytime I made a Serial.print()
?
Should I overload the HardwareSerial object in order to add those pin operations everytime?
1 Answer 1
No, there isn't - you have to do it manually. And don't forget to flush.
You could inherit HardwareSerial if you really wanted - or just write a couple of functions to do the sending and controlling of the DE pin.
-
Should i use a slight delay and distinct signals for controlling the DE and RE' pins? Or it is enough to join them in the design?. When should I have different signals for them?Brethlosze– Brethlosze2019年06月28日 05:39:58 +00:00Commented Jun 28, 2019 at 5:39
-
1I usually tie them together. And no need for a delay normally.Majenko– Majenko2019年06月28日 07:19:44 +00:00Commented Jun 28, 2019 at 7:19
-
1The only time you might want separate control of directions is if you are doing fancy collision detection by reading what you're sending and seeing if it matches what you sent.Majenko– Majenko2019年06月28日 11:38:16 +00:00Commented Jun 28, 2019 at 11:38