Skip to content

DMX_USE_PORT3 #89

Description

@paolocavagnolo

I'm using a PLC from industrial shields that put RS485 on Serial3 of an arduino mega.
I wanted to only read DMX so I made this 2 changes and it works.

1 - change definitions for serial port 3 (pins 14 and 15)

file: src/DMXSerial_avr.h

#define UCSRnA UCSR3A
#define RXCn RXC3
#define TXCn TXC3
#define UCSRnB UCSR3B
#define RXCIEn RXCIE3
#define TXCIEn TXCIE3
#define UDRIEn UDRIE3
#define RXENn RXEN3
#define TXENn TXEN3
#define UCSRnC UCSR3C
#define USBSn USBS3
#define UCSZn0 UCSZ30
#define UPMn0 UPM30
#define UBRRnH UBRR3H
#define UBRRnL UBRR3L
#define UDRn UDR3
#define UDREn UDRE3
#define FEn FE3
#define USARTn_RX_vect USART3_RX_vect
#define USARTn_TX_vect USART3_TX_vect
#define USARTn_UDRE_vect USART3_UDRE_vect

2 - fix DE / RE to always low in the setup

pinMode(DE_PIN, OUTPUT); // 11
pinMode(RE_PIN, OUTPUT); // 46
digitalWrite(DE_PIN, LOW);
digitalWrite(RE_PIN, LOW);

it works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions