-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
PWM connected LEDs pulse when sending SPI commands to ili9341 LCD #2675
Comments
Have you tried another pin ? |
The work around I used was to switch to D16 for PWM signal because after checking with an oscilloscope it was the only pin which generated a stable signal without a 20mv flicker at the time of heavy SPI usage (such as screen draws) I tried PWM with D0, D10 andD16 as they were the only pins I could make available in my project, the rest in use by various devices such as , RTC, ili9241 LCD, 2xRelays. Anyone have a theory to why D16 is the only stable PWM pin when using heavy SPI? |
@horendus the ESP has software PWM, not hardware. The most likely reason for the dimming is that interrupts get disabled and enabled during SPI comms, which can then affect the software PWM. |
Please fill the info fields, it helps to get you faster support ;)
if you have a stack dump decode it:
https://github.com/esp8266/Arduino/blob/master/doc/Troubleshooting/stack_dump.md
for better debug messages:
https://github.com/esp8266/Arduino/blob/master/doc/Troubleshooting/debugging.md
----------------------------- Remove above -----------------------------
Basic Infos
Hardware
Hardware: ESP-12E
Core Version: 2.1.0-rc2
Description
I have connected an ili9341 2.8inch LCD display to a ESP8266 (NodeMCU Board) using SPI bus.
I am driving the LED Backlight with a PWM signal from pin16 which works well until I lower the PWM value down to about 50% to dim the screen.
On the LCD I have the TIME updating every second. Every time the screen updates to re draw the second (only that section is re drawn not whole screen) it also causes the backlight to pulse. It doesnt appear to do with when the screen is at high brightness level (PWM 1023).
My theory is that using the SPI bus causes disruption to the PWM signal. Is this a know issue?
Is there a work around?
I plan to try this library out tonight to see if it makes a difference.
https://github.com/StefanBruens/ESP8266_new_pwm
Settings in IDE
Module: NodeMCU v1.0
Flash Size: 4MB
CPU Frequency: 120Mhz
Flash Mode: qio
Flash Frequency: 40Mhz
Upload Using: SERIAL?
Reset Method: nodemcu
(This isnt the real sketch as its over 8,000 lines over 10 .ino files but its just an example of how I am setting the PWM backlight control)
Sketch
#include <Arduino.h>
int backlight = 16
void setup() {
pinMode(backlight ,OUTPUT);
digitalWrite(backlight, 400);
}
void loop() {
}
messages here
The text was updated successfully, but these errors were encountered: