Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backlight doesn't turn off on the M5StickC Plus2 #86

Closed
matthudsonau opened this issue Mar 14, 2024 · 8 comments · Fixed by #88
Closed

Backlight doesn't turn off on the M5StickC Plus2 #86

matthudsonau opened this issue Mar 14, 2024 · 8 comments · Fixed by #88

Comments

@matthudsonau
Copy link
Contributor

Instead of the backlight turning off, you get a fun strobe effect. Guess the LCD pinout change wasn't entirely without problems...

@gkoh
Copy link
Owner

gkoh commented Mar 14, 2024

Hmm, looks like something is broken with the M5Unified library at v0.1.13.
I had a similar flicker problem with my M5Stack Core with 0.1.12, however now I can't even change the brightness :/

You could try downgrading the library:

I will investigate further.

@gkoh
Copy link
Owner

gkoh commented Mar 14, 2024

Erg, it could also be the M5GFX library underneath M5Unified that also got auto-bumped from 0.1.12 to 0.1.13.

@gkoh
Copy link
Owner

gkoh commented Mar 15, 2024

Well, that's nice, now I can't control backlight brightness for my M5Stack Core at all, with either 0.1.12 or 0.1.13.

@gkoh
Copy link
Owner

gkoh commented Mar 15, 2024

Instead of the backlight turning off, you get a fun strobe effect. Guess the LCD pinout change wasn't entirely without problems...

Looks like they also ripped out the PMIC, so backlight control is now via PWM.
M5StickC and Plus use the AXP192, brightness control seems fine there, but Plus2 and Core use PWM, which appears to not work or at least work wrong.

The full documented differences according to M5Stack are here:

Scroll down to "The difference between M5StickC PLUS and M5StickC PLUS2".

@gkoh
Copy link
Owner

gkoh commented Mar 15, 2024

Looks like the PWM controls for M5Stack Core aren't being called at all.
My M5StickC Plus2 should arrive in the next week or so, when that happens I will check there.
This one might take a bit of digging about in the underlying libraries to fix.

@gkoh
Copy link
Owner

gkoh commented Mar 15, 2024

Gah, I cut a minimal sketch to test and I can control the backlight properly. I will continue to narrow down the issue.

@gkoh
Copy link
Owner

gkoh commented Mar 15, 2024

Gah, I cut a minimal sketch to test and I can control the backlight properly. I will continue to narrow down the issue.

Found it, there are 2 problems:

  • The serial port pins used to support GPS are different on the M5Stack and interfere with the backlight pins :(
    • I will need to parameterise them and test when my M5Stack Core battery comes
  • PWM control doesn't work during lightSleep() by default
    • I need to dig into platformio configuration to find out if we can enable it

@gkoh gkoh linked a pull request Mar 21, 2024 that will close this issue
@gkoh gkoh closed this as completed in #88 Mar 21, 2024
@gkoh
Copy link
Owner

gkoh commented Mar 21, 2024

My M5StickC Plus2 arrived and I have fixed this.
On this and other PWM backlight devices we avoid lightSleep() as this disables the PWM and hence the backlight.
To try to conserve power, lower the CPU to 10MHz.
However, this messes up the clocks and the serial ports get clocked at the wrong frequency.

For now, accept this as 'idle' isn't where the fun happens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants