Difference between the original code from Jack (W8TEE), mct2.ino, and the code from Bruce (W8BH) running on the PCB from Dave (KI4PSR) might result in problems. At least I didn't get it working!
I finished a small protoboard yesterday, tried to use the code from Bruce - without luck. Just a white screen. As this was my first project with Blue Pill, I thought the problem was "on my side". I read the pdf files at Bruce's website and also found the testfiles at github. Dave (KI4PSR) sent me two "circuit diagrams", one called "Kens latest" and the one marked KI4PSR August 13. 2019. There is one difference between the tow, in "Ken's", PA3 is wired to the display RESET pin. I added this connection as I had used the KI4PSR diagram when wiring. When trying to use the TESTDISPLAY.ino, the display reported "HELLO WORLD" without any problmes! My hardware was ok! When looking at the KI4PSR-PCB.ino, the PA2 was defined twice. First as the TFT_RESET and the as PIEZO.
//=================================== Hardware Connections =============================
#define TFT_DC PA0 // LCD "DC" pin
#define TFT_CS PA1 // LCD "CS" pin
#define TFT_RST PA2 // LCD "RST" pin
#define SD_CS PA4 // SD card "CS" pin
#define ENCODER_A PA9 // Rotary Encoder output A -KI4PSR VERSION_0
#define ENCODER_B PA8 // Rotary Encoder output B -KI4PSR VERSION_0
#define LED PC13 // onboard LED pin
#define ENCODER_BUTTON PB15 // Rotary Encoder switch -KI4PSR VERSION_0
#define PADDLE_A PB8 // Morse Paddle "dit" -KI4PSR VERSION_0
#define PADDLE_B PB7 // Morse Paddle "dah" -KI4PSR VERSION_0
#define PIEZO PA2 // -KI4PSR VERSION_0 AUDIO OUT
#define SCREEN_ROTATION 3 // landscape mode: use '1' or '3'
I changed the first occurance of PA2 to PA3
//=================================== Hardware Connections =============================
#define TFT_DC PA0 // LCD "DC" pin
#define TFT_CS PA1 // LCD "CS" pin
#define TFT_RST PA3 // LCD "RST" pin
#define SD_CS PA4 // SD card "CS" pin
#define ENCODER_A PA9 // Rotary Encoder output A -KI4PSR VERSION_0
#define ENCODER_B PA8 // Rotary Encoder output B -KI4PSR VERSION_0
#define LED PC13 // onboard LED pin
#define ENCODER_BUTTON PB15 // Rotary Encoder switch -KI4PSR VERSION_0
#define PADDLE_A PB8 // Morse Paddle "dit" -KI4PSR VERSION_0
#define PADDLE_B PB7 // Morse Paddle "dah" -KI4PSR VERSION_0
#define PIEZO PA2 // -KI4PSR VERSION_0 AUDIO OUT
#define SCREEN_ROTATION 3 // landscape mode: use '1' or '3'
Now, the code from Bruce. The reset function is not used in the code (MCT2.ino) from Jack.
If you only change (KI4PSR-PCB.ino) the line:
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);
to
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
I have not tried this, but I think the code will run on the KI4PSR PCB without any hardware modification.
Best regards
Karl - LA3FY