Welcome! Log In Create A New Profile

Advanced

LCD hotplugging

Posted by PCLoadPLA 
LCD hotplugging
August 28, 2024 01:54PM
I am building a printer where there's really no good place to stick an LCD screen. I planned to have no LCD at all, and just use Marlin's "auto-print" feature, where you insert an SD card and reboot and it automatically prints. But I'm afraid to commit to that.

I'm thinking about making a portable LCD "control pendant" that I could just plug into the printer if I needed to control something. I would be using a TFT35 LCD screen in serial-port mode. I believe there's 5 wires to connect it, RX, TX, 5V, GND, and RST.

The question is, can I just put a 5-pin socket on the printer, and plug / replug the LCD screen in whenever I want? Or will Marlin crash when I do it from a power surge on the RST line? Or maybe if I plug the LCD in without rebooting Marlin, will Marlin just automatically detect it and work, or would I have to plug it in and reboot?
Re: LCD hotplugging
August 29, 2024 03:51AM
anything that is hot plugged has to be designed that way

Hot plug devices are designed with special connectors wher the GND pin is guaranteed to be connected first

for eg take a look at sata power cable



See the different length pins? the gnds are longer.

Next the power supply of the controller needs to have sufficient current reserves not to brown out crashing the controller.

Then the software has to be able to handle it.
Re: LCD hotplugging
August 29, 2024 01:18PM
I hacked together a test rig. I don't have a perfect way to diagnose what's happening, but what I did was establish a terminal session on my computer via USB.

When I plug or unplug the TFT display (all 5 pins at once), it kills my terminal session on the computer, as if it's causing a reboot. I'm not sure if it's rebooting, or the serial stream is just being interrupted, or what, but it acts like it reboots the board.

If I have the TFT plugged in, it works, if I don't have it plugged in, it seems to work, with no configuration changes needed. I just can't hot-swap it, but it seems like I can "install" it any time as long as I plan for a reboot.
Sorry, only registered users may post in this forum.

Click here to login