I am attempting to control the brightness (via the LITE pin) on a 3.5" LCD TFT (HX8357 based) display with a PWM output from a Teensy 4. Previously, I was able to do this on a SparkFun Pro Micro using:
#define TFT_CS 10
#define TFT_DC 9
#define TFT_RST 8
//MOSI in on Teensy 4 Pin 11
#define TFT_LITE 0
TFT.begin();
pinMode(TFT_LITE,OUTPUT);
analogWrite(TFT_LITE,255);
...my TFT graphics code follows here.
Attempting to do the same on the Teensy 4 seems to give me unpredictable results--occasional the screen partially redraws. If I remove anything involving the TFT_LITE (pin 0), then the code displays graphics as expected. If I use pinMode() and analogWrite() as shown, the graphics partially draw or don't draw at all or draw strangely.
I suspect that this is because I am using a pin (0, in my case) for PWM output that is sharing a timer or other Teensy resource that is also being used by one of my other pins (8,9,10 or MOSI), but I was unable to find any documentation stating this....does anyone have another suggestion as to what might be causing this?
#define TFT_CS 10
#define TFT_DC 9
#define TFT_RST 8
//MOSI in on Teensy 4 Pin 11
#define TFT_LITE 0
TFT.begin();
pinMode(TFT_LITE,OUTPUT);
analogWrite(TFT_LITE,255);
...my TFT graphics code follows here.
Attempting to do the same on the Teensy 4 seems to give me unpredictable results--occasional the screen partially redraws. If I remove anything involving the TFT_LITE (pin 0), then the code displays graphics as expected. If I use pinMode() and analogWrite() as shown, the graphics partially draw or don't draw at all or draw strangely.
I suspect that this is because I am using a pin (0, in my case) for PWM output that is sharing a timer or other Teensy resource that is also being used by one of my other pins (8,9,10 or MOSI), but I was unable to find any documentation stating this....does anyone have another suggestion as to what might be causing this?