Closed 2788west closed 3 years ago
The UART called Serial
is attached to the USB connection on all the Arduino boards and most of the derivatives, so you can't use it for DMX as well. It'd be messy anyway, because you'd be giving up your serial port. The UART called Serial1
is attached to pins 0 and 1 of all the boards that support it. You can just attach to those pins and you are all set
TL;DR
In fact, Serial1
is a SERCOM interface already implemented for you, do you don't need to add new code to use it. And the ArduinoRS485 library, on which the ArduinoDMX library depends, uses it already. Just attach the MAX485 to pins 0 and 1 as shown in the diagram, and then use the ArduinoDMX library, as shown in DMXFadeKnob and DMXFadeMultchannel. Again, ArduinoRS485 and ArduinoDMX are using Serial1
, so you don't have to change anything to use it. And you still get to use Serial
out the USB port for debugging.
If you are feeling like writing extra code because you have too much time on your hands, or because you don't want to use pins 0 and 1, then sure, you could implement SERCOM on another set of pins, instantiate ArduinoRS485 with your new port See the ArduinoRS485 source code for how you'd do that; I just use pins 0 and 1 all the time), and you'd be all set.
Thanks a lot for the clarification @tigoe!
Hi @tigoe, I really appreciate the detailed tutorial around using a MAX485 chip and ArduinoDMX. You mention that it's better to use
Serial1
thanSerial
, but I'm not entirely clear whether that requires me to change any configuration in the code, or whether I can just connect my jumpers to theSerial1
pins? I'm also wondering if there's a way to use this with a SERCOM Serial interface?