DMX at RS485 interface

Stuck? We'll be happy to help!
Post Reply
roose
Posts: 2
Joined: Fri Jul 31, 2020 8:08 am

DMX at RS485 interface

Post by roose » Fri Jul 31, 2020 2:34 pm

Hello,

i try to use the RS485 interface of the Mega to control a lamp via DMX. So far without luck.

What i tried:
DMXSerial Library
- i edited the DMXSerial_avr.h file for using UART3 (Serial 3)
added the following lines (not sure it's correct):

Code: Select all

#define DMX_USE_PORT3

#if defined(DMX_USE_PORT3)
#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
- uploaded the library example (without any warnings/errors)


Any ideas?

Thanks!

Roose

roose
Posts: 2
Joined: Fri Jul 31, 2020 8:08 am

Re: DMX at RS485 interface

Post by roose » Fri Jul 31, 2020 2:48 pm

Found the solution myself.
I had to enable the tx mode:

digitalWrite(75, HIGH);
digitalWrite(76, HIGH);

User avatar
Jarda
Posts: 61
Joined: Fri Dec 14, 2018 10:52 am

Re: DMX at RS485 interface

Post by Jarda » Wed Aug 05, 2020 11:00 am

Hello,
perfect, good job ;-) !

BR
Jarda

Post Reply