Additional Configuration for MCUs - devilhyt/lump-device-builder-library GitHub Wiki

RP2040

If the handshake consistently fails, try manually setting the RX pin to INPUT mode before calling begin():

void setup() {
  pinMode(RX_PIN, INPUT);
  device.begin();
}

ATmega328/P

Disable the automatic host type detection feature by setting the detectHostType parameter to false in the constructor of LumpDevice:

LumpDevice<HardwareSerial> device(&DEVICE_SERIAL, RX_PIN, TX_PIN, 68, 115200, modes, numModes, LUMP_VIEW_ALL, 10000000, 10000000, false);
//                                                                                                                                ^ detectHostType

Reason:

During the handshake phase, to perform AutoID, the UART is required to:

  • Ground the TX pin to indicate UART mode to the host.
  • Enable the RX to receive information from the host for automatic host type detection.

To achieve this, the library follows a simple sequence: it initializes the UART first, then grounds the TX pin.

However, this sequence may not work for all MCUs due to differences in hardware behavior. For example, the Atmega328/P require register manipulation to ground the TX pin after UART initialization.

Therefore, for such MCUs, automatic host type detection must be manually disabled for proper operation.