Communicate with RUMBA board via alternate TX/RX connections?

edited January 2017 in Repetier-Firmware
Hello,

I think I may have damaged the on-board USB-to-TTY converter (i.e. the Atmega16u2 chip) on my RUMBA control board. Normally as a workaround I would just use a separate USB-to-TTY converter, connected to a TX0/RX0 pin breakout in order to upload firmware and communicate with the Mega2560 chip.

Unfortunately on this version of the RUMBA board there are no breakout pins for the TX0/RX0 connections, but there are pins accessible for the TX1/RX1 and TX3/RX3 serial connections. Knowing that the bootloader is programmed only to allow firmware uploading from the Arduino IDE via the specific TX0/RX0 connections, I know I won't be able to load new firmware onto the board via USB-to-TTY; rather, I'd have to use an AVR programmer and the ICSP connector. But if I were able to load firmware using an AVR programmer, is there a way I could modify the firmware so that I could use one of the other serial connections besides TX0/RX0 to communicate with the board through Repetier-Host?

I tried modifying some pin assignments in the fastio.h firmware file, as it seemed to be the only place where TXD/RXD pins could be assigned explicitly. Here is the code:


#if defined (__AVR_ATmega1280__) || defined (__AVR_ATmega2560__)
// UART
#define RXD DIO15
#define TXD DIO14

// SPI
#define SCK 52
#define MISO DIO50
#define MOSI DIO51
#define SS 53

I changed the DIO0 and DIO1 assignments to DIO15 and DIO14, respectively, in accordance with the ATmega2560 digital pins that correspond to the RX3 and TX3 serial connections. However, when I compiled and uploaded the firmware via USB to a separate, fully functioning Arduino Mega board for testing, I was unable to connect to the board in Repetier-Host using the external USB-to-TTY adapter connected to digital pins 14 and 15 (TX3 and RX3). The connection was not refused, but it just wouldn't connect fully. 

Upon checking the serial monitor in the Arduino IDE, there was no output. When I connected the TX/RX wires from the USB-to-TTY adapter to the RX0/TX0 pins on the Arduino board, I received the expected output 'wait' repeatedly on new lines. Furthermore, despite the firmware pin assignment change I made, Repetier-Host would only communicate with the board when the USB-to-TTY adapter was wired to the TX0/RX0 pins and not the TX3/RX3 pins on the Arduino board.

So it looks like my firmware change didn't accomplish what I wanted, which again is to be able to communicate with the board using Repetier-Host and the TX3/RX3 serial connection on the board. I suspect the way to accomplish this has little to do with the Repetier firmware and more to do with some modification to an Arduino library that the Repetier firmware uses. Is there a way to do this?

Thanks for your help and advice!

Comments

  • Easiest way is to have 2 serial ports. Select bluetooth port (which is just a second serial port) and select matching serial connection for the pins you use. No more changes required. Dev version should be preferred here as it handles that case a bit better.
  • So, I modified the firmware to use Bluetooth (#define BLUETOOTH_SERIAL 3, #define BLUETOOTH_BAUD), compiled, and uploaded the firmware to the test Arduino Mega board via USB. 

    When I tried to connect via the TX3/RX3 pins, I wasn't able to open a connection to the printer in Repetier-Host, regardless of whether I selected (in the Printer Settings dialog) the connection port as "Bluetooth-Incoming-Port" (which I guess would select my computer's Bluetooth module) or "usbserial" (the USB-to-TTY adapter I have connected between my computer and the Mega board). It's only when I have usbserial selected and the TX/RX pins on the USB-to-TTY adapter wired to the TX0/RX0 ports on the Mega board that I can establish a connection to the board in Repetier-Host.

    What might I be missing?
  • It stays the same serial COM port in windows you also have. From Configuration.h it states

    We can connect BlueTooth to serial converter module directly to boards based on AtMega2560 or AtMega1280 and some boards based on AtMega2561, AtMega1281 or AtMega1284p
    - On Melzi boards connect BT to TX1 and RX1 pins, then set BLUETOOTH_SERIAL to 1
    - On RUMBA boards connect BT to pin 11 and 12 of X3 connector, then set BLUETOOTH_SERIAL to 3
    - On RAMBO boards connect BT to pins 5,6 or 7,8 or 9,10 on Serial connector, then accordingly set BLUETOOTH_SERIAL to 1,2 or 3
    - On RAMPS we must remap Y_ENDSTOPS pins or Z_ENDSTOPZ pins or LCD_ENABLE and LCD_RS pins to another pins, and connect BT to:
      a) signals of Y_MIN, Y_MAX, then set BLUETOOTH_SERIAL to 3 (RX from BT to Y_MIN, TX from BT to Y_MAX)
      b) signals of Z_MIN, Z_MAX, then set BLUETOOTH_SERIAL to 1 (RX from BT to Z_MIN, TX from BT to Z_MAX)
      c) pin 17 and 18 of AUX4 connector, then set BLUETOOTH_SERIAL to 2 (RX from BT to AUX4 p18, TX from BT to AUX4 p17)
      Comment out or set the BLUETOOTH_SERIAL to 0 or -1 to disable this feature.

    these informations are not from me but I assume they are correct. Remember that RX is connected with TX and vice versa! But since it works for serial 0 I guess you know that already.
  • Yep, I know about the RX connected to TX thing. I tried the same procedure I did before (i.e. just changing the BLUETOOTH_SERIAL and BLUETOOTH_BAUD) values using the v0.92 firmware and it worked! I was able to connect and control the Arduino through the TX3/RX3 serial port.

    I had read elsewhere that sometimes the firmware files were not correct on the first download, so I tried re-downloading the dev firmware (v1.0) with the same changes to the Bluetooth serial port settings. Unfortunately I was not able to connect to Repetier-Host using the TX3/RX3 port. So, it seems there is a bug in the dev version of the firmware.

    In any case, it looks like it works just fine in v0.92.

    Thanks for the help!
  • Do I have to select the bluetooth interface from for example the display before I can use this communication channel from my computer (repetier host on mac)??

    In the firmware, I have enabled the bluetooth on serial 3 on my Rumba board and set the baudrate to 115000.

    I tried with a HC-06 bluetooth module, and it did not work, but maybe because the default baudrate on HC-06 is 9600....
    If I dont have to select the bluetooth interface on the display, it is maybe because I need to reconfigure the HC-06.

Sign In or Register to comment.