12864 displays and use of PS_ON M80/M81
-
I'm trying to setup my printer so that it can trigger PS_ON so that I can flip a relay that cuts 24v/mains as desired. What happens now is that when the external power switch is flipped, 5V is supplied to my board first, which then boots and runs M80 in config.g.
What seems to happen is that the 12864 display and the onboard neopixels aren't properly initialized. After the board boots, I can send gcode manually to enable the LEDs, but sending M918 to enable the LCD just results in a flicker of garbage on the LCD and then blanking out.
If I power the board directly with 24v, the bootup sequence works properly and the LCD is able to function normally.
I'm currently using a Big Dipper which is supposed to be an enhanced mini5+ clone (adds +2 drivers, and some rework in the area of the 5v internal power supply, they also screw up with the 5v selection as well).
The way the big dipper has its jumpers for 5v selection configured is either usb-5v or internal-5v. there is no selector for disabling internal-5v.
As a result, I jump my power supply directly into the middle selector pin (basically send my 5v directly into the 5v that powers the mcu) -- this is enough to power the 3.3v rail and boot up rrf. Once RRF boots up, it sends M80 to flip my relay which powers the 24v psu which in turn boots up the internal 5v power supply and enables the 5ve rail.
Are there any considerations that need to be done in order to get the 12864 display to boot up correctly? If I bypass my 5v and relay shenanigans, the LCD starts up fine, if I don't, the LCD flickers some garbage and blanks out.
-
@pfn What sort of current is the 5V supply rated for? It sounds like the supply might not be enough and the LCD is in effect getting a brownout and not starting up correctly. Does your display work if you disconnect the Neopixels? If it does you might be able to power them separately? Similarly you could try disconnecting the 5V supply for the display from the ribbon cable and feed it by a separate 24 to 5V converter powered from the main supply?
Which display are you using? Some like the Fysetc 2.1 version (the one with Neopixels for the backlight) make the LCD controller reset pin available via the normal connectors which may help in this sort of setup.
-
@gloomyandy I'm using a meanwell rs-25-5 which has 5a capacity.
I'm not having separate neopixels, but am using the fysetc 2.1 display.
It would be interesting to try powering the display directly from the meanwell (because the big dipper does weird stuff with 5ve). However, I think this is the end of my experimentation as I don't want to slice up a cable at the moment.
-
@pfn How are you initialising the display? That display exposes the reset pin for the lcd controller and I would have hoped that by toggling that you should be able to reset it. On the STM32 boards we have a macro that initialises the display (and neopixels) and the reset toggle is part of that.
-
@gloomyandy I'm not doing anything special for initialization, just M918 in config.g. M80 is the first line.
I tried a G4 S4 before the M918, also tried pressing the reset button under the encoder. Both had the same behavior: there's an odd blur of pixels and then it blanks out.
-
@pfn To get that display to work reliably I've always had to toggle the reset pin (which is not the same as the reset button). According to this schematic: https://github.com/FYSETC/FYSETC-Mini-12864-Panel/blob/master/hardware/V2.1/Mini12864(RGB)V2.1_sch.pdf
the reset pin is pin 6 on EXP1. On the STM boards we use the following sequence to toggle the pin...; Configure reset pin M950 P1 C"PC.14" ; hardware reset of LCD M42 P1 S0 G4 P500 M42 P1 S1
But obviously the pins will be different for your control board (and it is different for each stm32 board, just in case anyone else is reading this).
It could be that the way the two boards power up makes a difference. When I was testing the display on the STM32 it worked most of the time without the above reset. But not always, the reset made it pretty much 100% reliable.
-
@gloomyandy this is a great idea. I would love to try it, but it seems the exp1.lcd_rst pin isn't exposed looking through https://github.com/Duet3D/RepRapFirmware/blob/3.4-dev/src/Config/Pins_Duet3Mini.h
Is there an alternative name @dc42 ?
Edit: Actually, I took a look at the big dipper schematic and it's simply shorted to 3.3v to pull the signal high. It seems like triggering lcd_rst wouldn't be possible