Activity Forums Questions & Troubleshooting Software & Firmware DMX at RS485 interface

  • DMX at RS485 interface

     Jarda updated 4 years, 2 months ago 2 Members · 3 Posts
  • roose

    Member
    July 31, 2020 at 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:

    #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

    Member
    July 31, 2020 at 2:48 pm

    Found the solution myself.

    I had to enable the tx mode:

    digitalWrite(75, HIGH);

    digitalWrite(76, HIGH);

  • Jarda

    Member
    August 5, 2020 at 11:00 am

    Hello,

    perfect, good job ;-) !

    BR

    Jarda

Viewing 1 - 3 of 3 replies

Log in to reply.

Original Post
0 of 0 posts June 2018
Now