@ David Prentice
[Mod edit @david_prentice ]
Good evening David, I have a problem with an ESP32 design.
I have configured the TFT (8 bit) as follows:
***********************
#define LCD_RD 2
#define LCD_WR 4
#define LCD_RS 15
#define LCD_CS 35
#define LCD_RST 32
#define LCD_D0 12
#define LCD_D1 13
#define LCD_D2 26
#define LCD_D3 25
#define LCD_D4 17
#define LCD_D5 16
#define LCD_D6 27
#define LCD_D7 14
************************
In the same project there is an optical rotary encoder that uses the GPO16 and GPO17 pins with the interrupt, which are also used by the TFT (D4 and D5).
***********************
//--------- Set up Interrupt Timer -------------------------------
timer = timerBegin(0, 80, true); //use Timer0, div80 for 1us clock
timerAttachInterrupt(timer, &onTimer, true);
timerAlarmWrite(timer, 10000, true); // T=10000us
timerAlarmEnable(timer); // Start Timer
//--- Counter setup for Rotary Encoder ---------------------
pcnt_config_t pcnt_config_A;// structure for A
pcnt_config_t pcnt_config_B;// structure for B
//
pcnt_config_A.pulse_gpio_num = PULSE_INPUT_PIN;
pcnt_config_A.ctrl_gpio_num = PULSE_CTRL_PIN;
pcnt_config_A.lctrl_mode = PCNT_MODE_REVERSE;
pcnt_config_A.hctrl_mode = PCNT_MODE_KEEP;
pcnt_config_A.channel = PCNT_CHANNEL_0;
pcnt_config_A.unit = PCNT_UNIT_0;
pcnt_config_A.pos_mode = PCNT_COUNT_INC;
pcnt_config_A.neg_mode = PCNT_COUNT_DEC;
pcnt_config_A.counter_h_lim = 10000;
pcnt_config_A.counter_l_lim = -10000;
//
pcnt_config_B.pulse_gpio_num = PULSE_CTRL_PIN;
pcnt_config_B.ctrl_gpio_num = PULSE_INPUT_PIN;
pcnt_config_B.lctrl_mode = PCNT_MODE_KEEP;
pcnt_config_B.hctrl_mode = PCNT_MODE_REVERSE;
pcnt_config_B.channel = PCNT_CHANNEL_1;
pcnt_config_B.unit = PCNT_UNIT_0;
pcnt_config_B.pos_mode = PCNT_COUNT_INC;
pcnt_config_B.neg_mode = PCNT_COUNT_DEC;
pcnt_config_B.counter_h_lim = 10000;
pcnt_config_B.counter_l_lim = -10000;
//
pcnt_unit_config(&pcnt_config_A);//Initialize A
pcnt_unit_config(&pcnt_config_B);//Initialize B
pcnt_counter_pause(PCNT_UNIT_0);
pcnt_counter_clear(PCNT_UNIT_0);
pcnt_counter_resume(PCNT_UNIT_0); //Start
**********************
Reading your mail, I found the reference to your mcufriend_shiek.h which I installed by modifying pins D4 and D5 of the TFT respectively on pins GPO5 and GPO23.
As you guessed, to no success!
By changing the TFT addresses, it remains blank and by changing the addresses of the rotary encoder, it causes no effect.
Can you help me?
Thanks in advance, Roberto
