initializing LCD library within setup() ?

The real problem is I have a long unshielded ribbon cable connection between Arduino board and LCD module in an automotive environment. The LCD module was REALLY flaky until I added some cap's on the LCD end of that ribbon. And using PWM to control its 12V sourced LED backlight driven at 150mA also made for some nice inductive coupling with the data lines in the same ribbon, causing jitters that showed up regularly as double printing of some characters on the LCD.. I could change "brightness" (duty cycle) and drive out the problem more dramatically, or scale it back. Near full dim, or full brightness the problem is less severe. Anything that is near square wave could make it go wonkers much more predictably. So I changed out the LED resistors for ones more friendly with 5V and send 5V up the line instead of 12V, still using PWM near those data lines but much better now. Every once in a while it seems a glitch on the power line hits the LCD hard and it goes into goo-goo land (splatter all over the screen and subsequent prints show in alien patterns).

Yes, rebooting the LCD is software patch that will get me by until I make and prove out a better connection between the two.

Things I need to do in the hardware area of the problem:

  • make a low pass filter by adding a resistor, not just add caps at the LCD, maybe a couple hundred Ohms or so current limiting resistor in series with the power line going to LCD.

  • get a better cable that shields the data lines from the LCD backlight power running up the same cable, and the environment.

It's interesting to note that the Arduino Mega board (providing my power for all LCD needs) keeps on running fine through all these events, so if there's a glitch on the Vcc 5 on the board, it's hitting the ATmega just the same but it survives. ... so I'm pretty sure the problem is introduced between the Arduino and the LCD by virtue of that cable and the environment.

The concept of having an ability to reboot or control LCD power, and regenerate its display without having to reboot Arduino should not be foreign. Somewhere in here is bad software modularity / design in the library.