Running original code and the code from Bruce #morsecodetutor #tft-lcd


Karl Jan Skontorp
 

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


lostfrogsrecords <dave@...>
 

Karl has done a lot of good work getting his system running.  But I want to reassure everyone who plans to use my PCB that all is well with the way it works, no hassles that Karl has experienced.

The PCB code I am using started with the 007 version of W8TEE code, and the PCB was designed to run the W8TEE code with a few changes to the schematic.  The changes were to use the 5V input of the STM32 rather than VB, and to place the volume pot on the input to the amplifier.   At that time I was not aware of Bruce's software and the support for the display's SD card.  I am currently using an August 7 version of Bruce's code.  Both sets of code work properly on my PCB with no further modification beyond what Ken KM4NFQ did to readdress Bruce's code so the I/O matched.  Using the 2.2 inch 2.2" SPI TFT LCD Display module and the reset circuit that Jack had show, there was no issue with the display,   I have added and excerpt of Ken's drawing showing the SD Card interface. https://groups.io/g/SoftwareControlledHamRadio/files/KI4PSR%20MCT%20PC%20Board%20Files/SDcard-wiring.png

Ken had told me about the SD card support and I saw Bruce's video.  Ken was the one responsible for me adding the 4 SD Card connections to the rev1a board, dragging me kicking and screaming to make an obviously better PCB. Thanks for that Ken.  The text to CW mode is really great. An old CW operator asked me to try BENSBESTBENTWIRE.  Any others like that to try?

In preparation for our group build next month I pre-wired the 16 conductor ribbon cable to most of the front panel components, including the display.  I tested each and every one of the 51 units kitted up to be sure they all worked.  They all did.  I am very pleased with the quality control for the parts Jack selected.  Not a single flaw in the displays, voltage regulator and amplifier, and no issues with the STM device either,

Dave, KI4PSR

I'm helping Bruce solve a few issues. not bugs but hardware differences, and I will have more insight on that soon (I'm working on it Bruce, honest!).