Skip to content

Commit d84dff4

Browse files
committed
Serial port options explained in Readme.
1 parent 589fced commit d84dff4

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

README.md

+43
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,55 @@ The supported processors and Arduino Boards are:
2323
* Arduino Mega2560 (ATmega2560)
2424
* Arduino Leonardo (Atmega32U4)
2525
* Arduino nano Every (ATMEGA4809)
26+
* ATmega8 boards - experimental
2627

2728
Other compatible boards my work as well.
2829

2930
You can find more detail on this library at http://www.mathertel.de/Arduino/DMXSerial.aspx.
3031

3132

33+
## Compile for other Serial ports
34+
35+
The original library was written for Arduino 2009 and Arduino UNO boards that use the ATmega328 or ATmega168 chip.
36+
These chips only have a single Universal Synchronous and Asynchronous serial Receiver and Transmitter (USART) a.k.a. the Serial port in the Arduino environment.
37+
The DMXSerial library uses this port for sending or receiving DMX signals by default.
38+
39+
This conflicts a little bit with the usage of the programming mode the Arduino offers through then USB ports or serial interfaces but it is possible to build compatible DMX shields that don’t interfere with this usage if done right. The DMXShield is an example of this.
40+
41+
By using the Arduino Leonardo, MEGA or Every board you can write debugging information to the Serial port in your sketch for debugging or data exchange purpose as the processor supports multiple ports.
42+
So maybe a DMX diagnostic sketch and debugging output in your code can profit from that.
43+
44+
45+
**Arduino Leonardo, Arduino Esplora**
46+
47+
When compiling for a Arduino Leonardo board the DMXSerial library will choose the **Serial1** port by default for DMX communication.
48+
49+
The Arduino Leonardo board uses a chip that has a USB 2.0 port available in addition to the USART. Therefore the “Serial” port is routed through the USB port that behaves like a serial port device and not the built-in USART. If you like to address the real Serial port you have to go with the Serial1.
50+
51+
When you look at the hardware and the registers definitions and manual for the processor the USART0 still exists but the definitions for addressing the registers have changed
52+
(for example USART_RX_vect is now USART0_RX_vect). Therefore some adjustments had to be done.
53+
54+
55+
**Arduino MEGA 2560**
56+
57+
When using the chip on the Arduino MEGA 2560 board you have more than one USART available and maybe you wish to use port 1 instead of port 0.
58+
This can be done by enabling the definitions for port1 in the library in file `src\DMXSerial_avr.h` just uncomment the line
59+
60+
```CPP
61+
#define DMX_USE_PORT1
62+
```
63+
64+
**MEGAAVR processors like 4809 in Arduino nano Every**
65+
66+
For this processor the USART1 is used for DMX.
67+
68+
69+
**ATmega8 boards**
70+
71+
I added the definitions of boards based on the ATmega8 too for experimental purpose. If you find problems with these boards, leave me a note please.
72+
73+
74+
3275
## Supported Shields
3376

3477
A suitable hardware is the Arduino platform plus a shield for the DMX physical protocol implementation.

0 commit comments

Comments
 (0)