Home JGAurora A5 & A3S Modifications & Upgrades

Help with the Marlin configuration (Serial Ports)

AETEKAETEK Posts: 106🌟 Super Member 🌟
I need an additional serial interface for my upcoming project (WIFI module). I have only the AUX-2 connection available. There I would like to use the pins A9 & A5 for TXD and RXD signals. Marlin supports software serial interfaces so it should be possible to use the above mentioned pins. But how do I configure this in Marlin 1.1.8?


  • Samuel PinchesSamuel Pinches Posts: 2,997Administrator
    edited June 2018
    I have not tried this.... but I suspect it is already ok! Because this is exactly how the LCD communicates with the motherboard - using GCODE over AUX-2 serial port. The serial port speed will be the same for both serial ports in the firmware - 250000 baud by default.
    Post edited by Samuel Pinches on
  • AETEKAETEK Posts: 106🌟 Super Member 🌟
    Hello Samuel,
    Maybe I did not express myself clearly. The question is how do I use Marlin for serial communication with the WIFI module using pins A9 & A5? The MEGA2560 has 3 serial hardware interfaces (UARTS). But they are used for other purposes or not led out on AUX2 connection. There is the option to emulate a UART by software and then to use pins that can not do this otherwise. I have to tell Marlin which pins Marlin should use for this.
    It's also pretty confusing with the Arduino pin mappings. On the Arduino side, an incomplete pin mapping is stored for the MEGA2560. I just found out that this pin mapping is complete (pin 1 ... 100):
  • Samuel PinchesSamuel Pinches Posts: 2,997Administrator
    Sorry, I made a mistake before. The LCD uses AUX-1 not AUX-2. 

    From my limited research, SoftwareSerial is not suitable for use with Marlin. You probably need to use a hardware serial port, such as pins D0/D1 (AUX-1) or D16/D17 (EXP-1).

  • AETEKAETEK Posts: 106🌟 Super Member 🌟
    So there is hardly any useful information about alternative serial ports in Marlin 1.1.8
    Now I have found this discussion: https://github.com/MarlinFirmware/Marlin/issues/10219.
    In summary, one can learn from the fact that Marlin 1.1.8 supports only one serial port and switching to a non-# 0 does not work properly. I've done a little revese engeneering today to find out how MKS handles the TFT touch display and the USB port. Actually, these are two separate data streams, which should be switched using a Multiplexer. Probably for cost reasons or because Marlin only supports one serial port, MKS has decided to mix both data streams (from the USB chip and the Toch display) via simple resistors. This also explains the problems when using the USB port while typing something on the touch screen. Then Marlin gets mutilated data.

    So for now I just have to develop a craft solution (serial signal mix). Then one has the restriction that only one serial function (USB, touch display or WIFI) can be used at the same time. But I think I can live with that. You just have to know it.

  • AETEKAETEK Posts: 106🌟 Super Member 🌟
    edited July 2018
    The pinout designations of the MKS-GEN_L 1.0 documentation are partly faulty:

    Thanked by 1Samuel Pinches
    Post edited by AETEK on
Sign In or Register to comment.