stm32 blue pill wires with 1.8 tft lcd display in stock
For any microcontroller project, interfacing a display unit with it would make the project a lot easier and appealing for the user to interact with. The most commonly used display unit for microcontrollers is the 16×2 Alpha numeric displays. These types of displays are not only useful to display vital information to the user but can also act as a debugging tool during the initial developmental stage of the project. So, in this tutorial we will learn how we can interface a 16×2 LCD display with the STM32F103C8T6 STM32 Development board and program it using the Arduino IDE. For people who are familiar with Arduino this tutorial will just be a cake walk since they both are very similar. Also to learn more about STM32 Blue Pill Board follow our getting started tutorial.
As told earlier the Energia IDE provides a beautiful library which makes the interfacing a piece of cake and hence it’s not mandatory to know anything about the display module. But, would didn’t it be interesting to show what we are using!!
The name 16×2 implies that the display has 16 Columns and 2 Rows, which together (16*2) forms 32 boxes. One single box would look something like this in the picture below
A single box has 40 pixels (dots) with a matrix order of 5 Rows and 8 columns, these 40 pixels together forms one character. Similarly, 32 characters can be displayed using all the boxes. Now lets take a look at the pinouts.
Out of all these 16 pins, only 10 pins are to be used mandatory for the proper working of the LCD if you want to know more about these LCD display jump to this 16x2 LCD article.
As you can see the complete connection is made over a breadboard. We need a FTDI board to program the STM32 Microcontroller. So similar to our previous tutorial, we have wired the FTDI board to STM32, the Vcc and ground pin of the FDTI programmer is connected to the 5V pin and ground pin of the STM32 respectively. This is used to power the STM32 board and the LCD since both can accept can +5V. The Rx and Tx pin of the FTDI board is connected to the A9 and A10 pin of the STM32 so that we can program the board directly without the boot loader.
Next the LCD has to be connected to the STM32 board. We are going to use the LCD in 4-bit mode, so we have to connect the 4 data bit pins (DB4 to DB7) and the two control pin (RS and EN) to the STM32 board as shown in the STM32F103C8T6 LCD interfacing circuit diagram above. Further the table below will help you in making the connection.
As told in this tutorial we will be using the Arduino IDE to program our STM32 Microcontroller. But, the Arduino IDE by default will not have the STM32 board installed, hence we have to download a package and prepare the Arduino IDE for the same. This is exactly what we did in our previous tutorial getting started with STM32F103C8T6 using Arduino IDE. So if you have not installed the required packages fall back to this tutorial and follow it before you continue here.
Once the STM32 Board is installed in the Arduino IDE, we can start programming. The program is very similar to that of an Arduino board, the only thing that will change are the pin names since the notations are different for STM32 and Arduino. The complete program is given at the end of this page, but to explain the program I have split it into small meaningful snippets as shown below.
One noticeable advantage of using Arduino for programming our microcontrollers is that Arduino has readymade libraries for almost every famous sensors and actuators. So here we start our program by including the LCD library which makes the programming a lot easier.
In the next line we have to specify to which GPIO pins of the STM32 we have connected the LCD display control and data lines. To do this we have to check our hardware, for ease you can also refer to the table given at the top which lists the pin names of LCD against the GPIO pin of STM32. After mentioning the pins we can initialise the LCD using the LiquidCrystal function. We also name our LCD as “lcd” as shown below.
Next we step inside the setup function. Here first we have mention what type of LCD we are using. Since it is a 16*2 LCD we use the line lcd.begin(16,2). The code inside the void setup function gets executed only once. So we use it to display an intro text which comes on the screen for 2 seconds and then gets cleared. To mention the position where the text has to appear we use the function lcd.setcursor and to print the text we use the lcd.print function. For instance lcd.setCursor(0,0) will set the cursor at first row and first column where we print “Interfacing LCD” and the function lcd.setCursor (0,1) moves the cursor to second row first column where we print the line “CircuitDigest”.
After displaying the intro text we hold the program for 2 seconds by creating a delay so that the user the can read the intro message. This delay is created by the line delay(2000) where 2000 is the delay value in mill seconds. After the delay we clear the LCD using the lcd.clear() function which clears the LCD by removing all the text on LCD.
Finally inside the void loop, we display “STM32 –Blue Pill” on the first line and the value of seconds on the second line. The value of second can be obtained from the millis() function. The millis() is a timer which gets incrementing right from the time the MCU is powered. The value is in form of milli seconds so we divide it by 1000 before displaying it on our LCD.
Make the connections as show in the circuit diagram and use the code given below on Arduino IDE. Go to tools and make sure the right board is selected as done in getting started tutorial. Also, before uploading the program make sure the boot 0 jumper is set to 1as shown in the image below and press the reset button. When the upload button is pressed is code should get uploaded and the message will be shown on LCD as show in the image below.
As discussed in the above paragraph you should be able to notice the output as soon as the code is uploaded. But this program will not work the next time when you power up the board, since the board is still in programming mode. So once the program is uploaded the jumper on boot 0 should be changed back to 0 positions as show below. Also now since the program is uploaded to the STM32 board already we do not need the FTDI board and the whole set-up can be powered by the micro-USB port of the STM32 board as well as shown below.
This is just a simple interfacing project to help use the LCD display with STM32 board, but further you can use this to build cool projects. Hope you understood the tutorial and learnt something useful from it. If you had faced any problem in getting it to work, please use the comment section to post the problem or use the forums for other technical questions. The complete working of LCD display with STM32 can also be found as a video given below.
Since it’s inception the Arduino IDE has demonstrated the desire to support all kind of platforms, from Arduino clones and variations of different manufacturers to third party boards like the ESP32 and ESp8266. As more people get familiar with the IDE, they are beginning to support more boards that are not based on ATMEL chips and for today’s tutorial we will look on one of such boards. We will examine how to program the STM32 based, STM32F103C8T6 development board with the Arduino IDE.
The STM32 board to be used for this tutorial is none other than the STM32F103C8T6 chip based STM32F1 development board commonly referred to as “Blue Pill” in line with the blue color of its PCB. Blue Pill is powered by the powerful 32-bit STM32F103C8T6 ARM processor, clocked at 72MHz. The board operates on 3.3v logic levels but its GPIO pins have been tested to be 5v tolerant. While it does not come with WiFi or Bluetooth like the ESP32 and Arduino variants, it offers 20KB of RAM and 64KB of flash memory which makes it adequate for large projects. It also possesses 37 GPIO pins, 10 of which can be used for Analog sensors since they have ADC enabled, along with others which are enabled for SPI, I2C, CAN, UART, and DMA. For a board which costs around $3, you will agree with me that these are impressive specs. A summarized version of these specifications compared with that of an Arduino Uno is shown in the image below.
Based on the specs above, the frequency at which Blue pill operates is about 4.5 times higher than an Arduino UNO, for today’s tutorial, as an example on how to use the STM32F1 board, we will connect it to a 1.44″ TFT display and program it to calculate the “Pi” constant. We will note how long it took the board to obtain the value an compare it with the time it takes an Arduino Uno to perform the same task.
As mentioned earlier, we will connect the STM32F1 board to the1.8″ ST7735 based colored TFT Display along with a push button. The push button will be used to instruct the board to start the calculation.
Go over the connections once again to be sure everything is as it should be as it tends to get a little bit tricky. With this done, we proceed to set up the STM32 board to be programmed with the Arduino IDE.
As with most boards not made by Arduino, a bit of setup needs to be done before the board can be used with the Arduino IDE. This involves installing the board file either via the Arduino Board manager or downloading from the internet and copy the files into the hardware folder. The Board Manager route is the less tedious one and since the STM32F1 is among the listed boards, we will go that route.
Start by adding the link for the STM32 board to the Arduino preference lists. Go to File -> Preferences, then enter this URL ( http://dan.drown.org/stm32duino/package_STM32duino_index.json ) in the box as indicated below and click ok.
The code will be written the same way we’d write any other sketch for an Arduino project, with the only difference being the way the pins are referenced.
To be able to easily develop the code for this project, we will use two libraries which are both modifications of standard Arduino Libraries to make them compatible for the STM32. We will use the modified version of the Adafruit GFX and the Adafruit ST7735 libraries. Both libraries can be downloaded via the links attached to them.
With this done, we create an object of the ST7735 library which will be used to reference the display all through the entire project. We also indicate the pin of the STM32 to which the pushbutton is connected and create a variable to hold its state.
Next, we initialize serial communication and the screen, setting the background of the display to black and calling the printUI() function to display the interface.
We start by reading the state of the push button. If the button has been pressed, we remove the current message on the screen using the removePressKeyText() and draw the changing progress bar using the drawBar() function. We then call the start calculation function to obtain and display the value of Pi along with the time it took to calculate it.
The remaining part of the code are the functions called to achieve the tasks from drawing the bar to calculating the Pi. Most of these functions have been covered in several other tutorials that involve the use of the ST7735 display.
Uploading sketches to the STM32f1 is a little bit complex compared to standard Arduino compatible boards. To upload code to the board, we need an FTDI based, USB to Serial converter.
With this done, we then change the position of the board’s state jumper to position one (as shown in the gif below), so as to put the board in programming mode. Press the reset button on the board once after this and we are ready to upload the code.
With the code complete, follow the upload process described above to upload the code to your setup. You should see the display come up as shown in the Image below.
Press the pushbutton to start the calculation. You should see the progress bar slide gradually until the end. At the end of the process, the value of Pi is displayed along with the time which the calculation took.
Comparing these two values, we see that “Blue Pill” is over 7 times faster than the Arduino Uno. This makes it ideal for projects which involves heavy processing and time constraints. The small size of the Blue pill also serves as an advantage here as it is only a bit bigger than the Arduino nano and it can be used in place where the Nano won’t be fast enough.
That’s it for today’s tutorial guys. What will you be building with the Blue Pill? feel free to share along with any questions you might have, under the comment section.
An excellent new compatible library is available which can render TrueType fonts on a TFT screen (or into a sprite). This has been developed by takkaO and is available here. I have been reluctant to support yet another font format but this is an amazing library which is very easy to use. It provides access to compact font files, with fully scaleable anti-aliased glyphs. Left, middle and right justified text can also be printed to the screen. I have added TFT_eSPI specific examples to the OpenFontRender library and tested on RP2040 and ESP32 processors, however the ESP8266 does not have sufficient RAM. Here is a demo screen where a single 12kbyte font file binary was used to render fully anti-aliased glyphs of gradually increasing size on a 320x480 TFT screen:
The TFT configuration (user setup) can now be included inside an Arduino IDE sketch providing the instructions in the example Generic->Sketch_with_tft_setup are followed. See ReadMe tab in that sketch for the instructions. If the setup is not in the sketch then the library settings will be used. This means that "per project" configurations are possible without modifying the library setup files. Please note that ALL the other examples in the library will use the library settings unless they are adapted and the "tft_setup.h" header file included. Note: there are issues with this approach, #2007 proposes an alternative method.
Support has been added in v2.4.70 for the RP2040 with 16 bit parallel displays. This has been tested and the screen update performance is very good (4ms to clear 320 x 480 screen with HC8357C). The use of the RP2040 PIO makes it easy to change the write cycle timing for different displays. DMA with 16 bit transfers is also supported.
Support for the ESP32-S2, ESP32-S3 and ESP32-C3 has been added (DMA not supported at the moment). Tested with v2.0.3 RC1 of the ESP32 board package. Example setups:
Smooth fonts can now be rendered direct to the TFT with very little flicker for quickly changing values. This is achieved by a line-by-line and block-by-block update of the glyph area without drawing pixels twice. This is a "breaking" change for some sketches because a new true/false parameter is needed to render the background. The default is false if the parameter is missing, Examples:
New anti-aliased graphics functions to draw lines, wedge shaped lines, circles and rounded rectangles. Examples are included. Examples have also been added to display PNG compressed images (note: requires ~40kbytes RAM).
Frank Boesing has created an extension library for TFT_eSPI that allows a large range of ready-built fonts to be used. Frank"s library (adapted to permit rendering in sprites as well as TFT) can be downloaded here. More than 3300 additional Fonts are available here. The TFT_eSPI_ext library contains examples that demonstrate the use of the fonts.
Users of PowerPoint experienced with running macros may be interested in the pptm sketch generator here, this converts graphics and tables drawn in PowerPoint slides into an Arduino sketch that renders the graphics on a 480x320 TFT. This is based on VB macros created by Kris Kasprzak here.
The RP2040 8 bit parallel interface uses the PIO. The PIO now manages the "setWindow" and "block fill" actions, releasing the processor for other tasks when areas of the screen are being filled with a colour. The PIO can optionally be used for SPI interface displays if #define RP2040_PIO_SPI is put in the setup file. Touch screens and pixel read operations are not supported when the PIO interface is used.
DMA can now be used with the Raspberry Pi Pico (RP2040) when used with both 8 bit parallel and 16 bit colour SPI displays. See "Bouncy_Circles" sketch.
The library now supports the Raspberry Pi Pico with both the official Arduino board package and the one provided by Earle Philhower. The setup file "Setup60_RP2040_ILI9341.h" has been used for tests with an ILI9341 display. At the moment only SPI interface displays have been tested. SPI port 0 is the default but SPI port 1 can be specifed in the setup file if those SPI pins are used.
The library now provides a "viewport" capability. See "Viewport_Demo" and "Viewport_graphicstest" examples. When a viewport is defined graphics will only appear within that window. The coordinate datum by default moves to the top left corner of the viewport, but can optionally remain at top left corner of TFT. The GUIslice library will make use of this feature to speed up the rendering of GUI objects (see #769).
An Arduino IDE compatible graphics and fonts library for 32 bit processors. The library is targeted at 32 bit processors, it has been performance optimised for STM32, ESP8266 and ESP32 types. The library can be loaded using the Arduino IDE"s Library Manager. Direct Memory Access (DMA) can be used with the ESP32, RP2040 and STM32 processors with SPI interface displays to improve rendering performance. DMA with a parallel interface is only supported with the RP2040.
For other processors the generic only SPI interface displays are supported and slower non-optimised standard Arduino SPI functions are used by the library.
"Four wire" SPI and 8 bit parallel interfaces are supported. Due to lack of GPIO pins the 8 bit parallel interface is NOT supported on the ESP8266. 8 bit parallel interface TFTs (e.g. UNO format mcufriend shields) can used with the STM32 Nucleo 64/144 range or the UNO format ESP32 (see below for ESP32).
The library supports some TFT displays designed for the Raspberry Pi (RPi) that are based on a ILI9486 or ST7796 driver chip with a 480 x 320 pixel screen. The ILI9486 RPi display must be of the Waveshare design and use a 16 bit serial interface based on the 74HC04, 74HC4040 and 2 x 74HC4094 logic chips. Note that due to design variations between these displays not all RPi displays will work with this library, so purchasing a RPi display of these types solely for use with this library is not recommended.
A "good" RPi display is the MHS-4.0 inch Display-B type ST7796 which provides good performance. This has a dedicated controller and can be clocked at up to 80MHz with the ESP32 (55MHz with STM32 and 40MHz with ESP8266). The MHS-3.5 inch RPi ILI9486 based display is also supported.
Some displays permit the internal TFT screen RAM to be read, a few of the examples use this feature. The TFT_Screen_Capture example allows full screens to be captured and sent to a PC, this is handy to create program documentation.
The library supports Waveshare 2 and 3 colour ePaper displays using full frame buffers. This addition is relatively immature and thus only one example has been provided.
The library includes a "Sprite" class, this enables flicker free updates of complex graphics. Direct writes to the TFT with graphics functions are still available, so existing sketches do not need to be changed.
A Sprite is notionally an invisible graphics screen that is kept in the processors RAM. Graphics can be drawn into the Sprite just as they can be drawn directly to the screen. Once the Sprite is completed it can be plotted onto the screen in any position. If there is sufficient RAM then the Sprite can be the same size as the screen and used as a frame buffer. Sprites by default use 16 bit colours, the bit depth can be set to 8 bits (256 colours) , or 1 bit (any 2 colours) to reduce the RAM needed. On an ESP8266 the largest 16 bit colour Sprite that can be created is about 160x128 pixels, this consumes 40Kbytes of RAM. On an ESP32 the workspace RAM is more limited than the datasheet implies so a 16 bit colour Sprite is limited to about 200x200 pixels (~80Kbytes), an 8 bit sprite to 320x240 pixels (~76kbytes). A 1 bit per pixel Sprite requires only 9600 bytes for a full 320 x 240 screen buffer, this is ideal for supporting use with 2 colour bitmap fonts.
One or more sprites can be created, a sprite can be any pixel width and height, limited only by available RAM. The RAM needed for a 16 bit colour depth Sprite is (2 x width x height) bytes, for a Sprite with 8 bit colour depth the RAM needed is (width x height) bytes. Sprites can be created and deleted dynamically as needed in the sketch, this means RAM can be freed up after the Sprite has been plotted on the screen, more RAM intensive WiFi based code can then be run and normal graphics operations still work.
Drawing graphics into a sprite is very fast, for those familiar with the Adafruit "graphicstest" example, this whole test completes in 18ms in a 160x128 sprite. Examples of sprite use can be found in the "examples/Sprite" folder.
The "Animated_dial" example shows how dials can be created using a rotated Sprite for the needle. To run this example the TFT interface must support reading from the screen RAM (not all do). The dial rim and scale is a jpeg image, created using a paint program.
The XPT2046 touch screen controller is supported for SPI based displays only. The SPI bus for the touch controller is shared with the TFT and only an additional chip select line is needed. This support will eventually be deprecated when a suitable touch screen library is available.
The library supports SPI overlap on the ESP8266 so the TFT screen can share MOSI, MISO and SCLK pins with the program FLASH, this frees up GPIO pins for other uses. Only one SPI device can be connected to the FLASH pins and the chips select for the TFT must be on pin D3 (GPIO0).
Configuration of the library font selections, pins used to interface with the TFT and other features is made by editing the User_Setup.h file in the library folder, or by selecting your own configuration in the "User_Setup_Selet,h" file. Fonts and features can easily be enabled/disabled by commenting out lines.
Anti-aliased (smooth) font files in "vlw" format are generated by the free Processing IDE using a sketch included in the library Tools folder. This sketch with the Processing IDE can be used to generate font files from your computer"s font set or any TrueType (.ttf) font, the font file can include any combination of 16 bit Unicode characters. This means Greek, Japanese and any other UCS-2 glyphs can be used. Character arrays and Strings in UTF-8 format are supported.
The .vlw files must be uploaded to the processors FLASH filing system (SPIFFS, LittleFS or SD card) for use. Alternatively the .vlw files can be converted to C arrays (see "Smooth Font -> FLASH_Array" examples) and stored directly in FLASH as part of the compile process. The array based approach is convenient, provides performance improvements and is suitable where: either use of a filing system is undesirable, or the processor type (e.g. STM32) does not support a FLASH based filing system.
It would be possible to compress the vlw font files but the rendering performance to a TFT is still good when storing the font file(s) in SPIFFS, LittleFS or FLASH arrays.
Anti-aliased fonts can also be drawn over a gradient background with a callback to fetch the background colour of each pixel. This pixel colour can be set by the gradient algorithm or by reading back the TFT screen memory (if reading the display is supported).
The common 8 bit "Mcufriend" shields are supported for the STM Nucleo 64/144 boards and ESP32 UNO style board. The STM32 "Blue/Black Pill" boards can also be used with 8 bit parallel displays.
Unfortunately the typical UNO/mcufriend TFT display board maps LCD_RD, LCD_CS and LCD_RST signals to the ESP32 analogue pins 35, 34 and 36 which are input only. To solve this I linked in the 3 spare pins IO15, IO33 and IO32 by adding wires to the bottom of the board as follows:
If the display board is fitted with a resistance based touch screen then this can be used by performing the modifications described here and the fork of the Adafruit library:
If you load a new copy of TFT_eSPI then it will overwrite your setups if they are kept within the TFT_eSPI folder. One way around this is to create a new folder in your Arduino library folder called "TFT_eSPI_Setups". You then place your custom setup.h files in there. After an upgrade simply edit the User_Setup_Select.h file to point to your custom setup file e.g.:
You must make sure only one setup file is called. In the custom setup file I add the file path as a commented out first line that can be cut and pasted back into the upgraded User_Setup_Select.h file. The ../ at the start of the path means go up one directory level. Clearly you could use different file paths or directory names as long as it does not clash with another library or folder name.
The library was intended to support only TFT displays but using a Sprite as a 1 bit per pixel screen buffer permits support for the Waveshare 2 and 3 colour SPI ePaper displays. This addition to the library is experimental and only one example is provided. Further examples will be added.
Here are my notes on interfacing your basic 1.8" ST7735 TFT LCD display with an STM32 Smart V2 board such as this 1-8-inch-TFT-LCD-ST7735S-Display-Module128x160-51-AVR-STM32-ARM-8-16-bit listing on ebay.
This should have been a trivial project. The STM32 board has an 8 pin female header. The display board has an 8 pin male header. As with most things, getting it to actually function was way more difficult than it needed to be. Upon inspection, the pins are not a match. Fortunately the Vcc and GND are - so at least it is unlikely the board would be fried when plugging in, but it certainly won"t work. More specifically, here are the pins:
The octopus of jumper wires is really not very appealing. So I spent some time making a little adapter. (for the time it took, I"m glad I am not planning a production run!)
The code was of course not plug & play... but it was very close. In addition to the pin definition inconsistencies - I also had the problem of IDE. Apparently the code on github was created with something that knows how to deal with a "coproj" project file (I have no idea what IDE is needed).
So I cracked open my old time friend Visual Studio with the VisualGDB add-in. I first created a project with the STM32 HAL, then quickly realized the sample code was not implemented with HAL... so I tried again, creating another project this time with the STM32F1 Legacy Peripheral Library.
In order to add ST7735 LED Display support, only the main project directory files need to be copied from the github sample (VisualGDB has its own support files in the path). In this case: main, delay, font5x7, garmin-digits, and of course STM7735 files:
I had a difficult time with the suggested DEBUG_DEFAULT_INTERRUPT_HANDLERS. Fortunately the kind support folks at sysprogs forum had some helpful advice:
The problem was immediately obvious. The SysTick_Handler was not properly configured (despite being right there in delay.c; renamed to delay.cpp). The problem here seems to be the difference between the original C code, and this C++ project. It needed to be prefixed with extern "C":
Once everything compiles successfully, a few more changes are needed to point the controlling pins at the ones actually used on the STM32 Smart V2 board. This is all defined in the SM7735.h file:
Reset is hard wired to actual reset (NRST) line, so the "soft" reset functions will not work (e.g. RST_L and RST_H). In code, it is left assigned here to Port B Pin 6. The manual reset of the display occurs in void ST7735_Init(void). If you really want the soft reset, perhaps consider not connecting the NRST pin and instead wiring something up to the unused Pin 8 on the STM32 Smart board.
If you are interested in the ST7735 display for the STM32, you may also be interested in some of the many other STM32 libraries created by LonelyWolf:
TFT LCDs are the most popular color displays – the displays in smartphones, tablets, and laptops are actually the TFT LCDs only. There are TFT LCD shields available for Arduino in a variety of sizes like 1.44″, 1.8″, 2.0″, 2.4″, and 2.8″. Arduino is quite a humble machine whenever it comes to process or control graphics. After all, it is a microcontroller platform, and graphical applications usually require much greater processing resources. Still, Arduino is capable enough to control small display units. TFT LCDs are colorful display screens that can host beautiful user interfaces.
Most of the smaller TFT LCD shields can be controlled using the Adafruit TFT LCD library. There is also a larger TFT LCD shield of 3.5 inches, with an ILI9486 8-bit driver.
The Adafruit library does not support the ILI9486 driver. Actually, the Adafruit library is written to control only TFT displays smaller than 3.5 inches. To control the 3.5 inch TFT LCD touch screen, we need another library. This is MCUFRIEND_kbv. The MCUFRIEND_kbv library is, in fact, even easier to use in comparison to the Adafruit TFT LCD library. This library only requires instantiating a TFT object and even does not require specifying pin connections.
TFT LCDs for ArduinoUser interfaces are an essential part of any embedded application. The user interface enables any interaction with the end-user and makes possible the ultimate use of the device. The user interfaces are hosted using a number of devices like seven-segments, character LCDs, graphical LCDs, and full-color TFT LCDs. Out of all these devices, only full-color TFT displays are capable of hosting sophisticated interfaces. A sophisticated user interface may have many data fields to display or may need to host menus and sub-menus or host interactive graphics. A TFT LCD is an active matrix LCD capable of hosting high-quality images.
Arduino operates at low frequency. That is why it is not possible to render high-definition images or videos with Arduino. However, Arduino can control a small TFT display screen rendering graphically enriched data and commands. By interfacing a TFT LCD touch screen with Arduino, it is possible to render interactive graphics, menus, charts, graphs, and user panels.
Some of the popular full-color TFT LCDs available for Arduino include 3.5″ 480×320 display, 2.8″ 400×200 display, 2.4″ 320×240 display and 1.8″ 220×176 display. A TFT screen of appropriate size and resolution can be selected as per a given application.
If the user interface has only graphical data and commands, Atmega328 Arduino boards can control the display. If the user interface is a large program hosting several menus and/or submenus, Arduino Mega2560 should be preferred to control the TFT display. If the user interface needs to host high-resolution images and motions, ARM core Arduino boards like the DUE should be used to control the TFT display.
MCUFRIEND_kbv libraryAdafruit TFT LCD library supports only small TFT displays. For large TFT display shields like 3.5-inch, 3.6-inch, 3.95-inch, including 2.4-inch and 2.8-inch TFT LCDs, MCUFRIEND_kbv library is useful. This library has been designed to control 28-pin TFT LCD shields for Arduino UNO. It also works with Arduino Mega2560. Apart from UNO and Mega2560, the library also supports LEONARDO, DUE, ZERO, and M0-PRO. It also runs on NUCLEO-F103 and TEENSY3.2 with Sparkfun Adapter. The Mcufriend-style shields tend to have a resistive TouchScreen on A1, 7, A2, 6 but are not always in the same direction rotation. The MCUFRIEND_kbv library can be included in an Arduino sketch from the library manager.
The 3.5-inch TFT LCD shield needs to be plugged atop the Arduino board. The Mcufriend-style shields are designed to fit into all the above-mentioned Arduino boards. The shields have a TFT touch screen that can display colorful images and interfaces and a micro SD card reader to save images and other data. A 3.5-inch TFT LCD touch screen has the following pin diagram.
The drawFastVLine function draws a vertical line that starts in x, y location, and its length is h pixel and its color is t. The drawFastHLine function draws a horizontal line that starts in x and y location, and the length is w pixel, and the color is t. The drawLine function draws a line that starts in xi and yi locationends is in xj and yj, and the color is t. These methods draw lines with 5-pixel thickness.
The fillRect function draws a filled rectangle in x and y locations. w is width, h is height, and t is the color of the rectangle. The drawRect function draws a rectangle in x and y location with w width and h height and t color. The fillRoundRect function draws a filled Rectangle with r radius round corners in x and y location and w width and h height and t color. The drawRoundRect function draws a Rectangle with r radius round corners in x and y location and w width and h height and t color.
The drawTriangle function draws a triangle with three corner location x, y and z, and t color. The fillTriangle function draws a filled triangle with three corner location x, y and z, and t color.
How project worksThe code fills a rectangle, then draws a rectangle within which text “EEWORLDONLINE” is displayed. Then, lines, circles, rectangles, and squares are drawn on the screen. The project ends with a greeting and a message.
We will organize the kinds of display interfaces we offer, and how they differ. You will get to know what kind of external and internal interfaces we have and what are their main applications.
First, let us start with dividing internal and external interfaces in LCD modules. Internal interface of display means it used inside the device. Those are usually the embedded interfaces that are not visible, and we do not have access to them as the users of the device. External interfaces, on the other hand, are connected to the device using a cable. Once we have defined internal and external interfaces, both of these categories come as universal or image transfer interfaces.
A protocol defines the rules of information exchange, where the interface is the medium. The example here could be the language. When I use my voice to communicate with other people, my voice is an interface. Over this interface my voice is being sent to other people’s ears, and the protocol is the language used. Right now, I am using the English protocol. If you understand the protocol, you understand what I am saying. If I switch to a different language, Polish or some other language that you do not understand, you have the same interface, you will still hear me, but because of a different protocol, you do not understand me anymore. In this article we will talk only about interfaces, how to connect devices to each other. We will not focus on protocols.
Let’s try to get the interfaces right. For internal interfaces, interfaces embedded into the device, we have universal interfaces and image transfer interfaces. Universal display interface can send other data, not only an image. Being universal, they are not perfect for image transfer, because in most of the displays used nowadays, the image transfer is one of the most demanding. The bit rate, the data transfer needed for the image transfer is rather high. Higher that many universal interfaces can offer. If we need to send an image every once in a while, then we don’t need very high bandwidth. If we do not need live video stream, then we can use some of the internal universal interfaces such as SPI, I2C or even slow interfaces as RS232 or UART.
The first universal interface will be SPI (Serial Peripheral Interface). This interface is serial, used for communication between a host, in SPI called a Master, and devices called Slaves. One host can communicate with many slaves. To select the Slave, we use the Chip select or SS line and then we use two data lines, Master output or Master input. And of course we have to define the clock, to synchronize the data, because this is a clock synchronized interface.
It can be fast but is not fast enough for live video. The baud rate can be 1 MBd, but it can also be 10 MBd or even 50 MBd on the SPI or QSPI. QSPI is a Quad SPI, a kind of modification of SPI that is faster. But still this interface is very universal, we can use it to connect memory or some input and outputs internally in our device. In the display universe the SPI is used for simple displays, for small size displays, where we can transfer the image relatively fast, because the resolution is low. The maximum size for SPI display interface would be 3.5 inch, 320 by 240 pixel TFT displays. If we have higher resolution, image transfer will be too slow to use SPI even with a high-speed SPI.
If, for example, the Master is sending some data, the only thing Slaves can do is to receive it. And then we need to wait a little bit for the Master to finish. We can then respond as Slave to Master. In I2C Slave selection works a little bit different than in SPI, where we had a Chip Select line (CS line) or SS line to select from. In I2C we first need to send the logical address to the interface that is being written by Slaves. In general, this procedure is slow and universal interface used also to connect the simple memory and some other I2S that we have around our microcontroller on the PCB. It is very useful, but usually not used for image transfer. This interface is very popular in the display world for touchscreens. Most of the embedded touch screens that we use have I2C interface because the touchscreen does not generate many data. We only have coordinates of the finger or few fingers at most, that need to be sent back to the microcontroller, to the device processor. The slow baud rate is good enough for the touchscreen, but not enough for the image.
That is not a case for SPI or I2C, because we have a clock there that gives the speed to every device. Then each device works according to the clock. In UART we do not have a clock. It is rather not used for image transfer. The UART, or SPI, or I2C can be used for low resolution displays. For high resolution displays we need an Intelligent Display, a display that will generate the image internally and through these slow universal interfaces we only send commands, or we send the image once, the image is being stored into the internal memory of the intelligent display, that we will use later sending the commands. You can find Riverdi’s intelligent display line on our website: https://riverdi.com/product-category/intelligent-displays/.
These Riverdi products are very advanced Intelligent Displays, made with Bridgetek controllers. The controllers use SPI and QSPI for communication. That means your software, your system, your microcontroller can be simple. You can use SPI interface to drive them, and you can still have high resolution image, even as high as 1280 by 800 pixels in 10.1-inch LCD displays. So, please remember that if you want to use a slow universal interface and have a high-resolution image, you need to use an Intelligent Display.
There are also the internal image transfer interfaces. The image transfer interface allows continuous high speed image transfer. Internal transfer is high enough to refresh the display many times per second. This is called the refresh rate of a display. When you go to a display, monitor, or TV set specification, you will see refresh rate or maximum refresh rate parameter. If it’s 60 Hertz, that means the display image is refreshed 60 times per second. More advanced displays would have higher values, like 100 Hertz. The refresh rate means we need to send full image 60 times or 100 times in each second. To visualize this amount of data, we need to multiply refresh rate by the resolution of the screen. For example, for a 7-inch Riverdi LVDS display with resolution 1024 by 600 it is roughly 600 thousand pixels.
The most common internal image transfer interface in industrial LCD displays nowadays is LVDS – Low Voltage Differential Signal. A crucial feature of this interface is that it is differential. It means that the signal is immune to interference and we can use a twisted pair of wires to transfer the data. We can send data fast and it will not be corrupt by any noise, interference. This kind of data corruption is quite common in other interfaces.Key Takeaway: In LVDS display interface the differential signal allows you to send the signal at a very high speed and keep it safe from noise.
The next, older image transfer interface is called RGB. Name comes from the colors sent parallelly to the display: red, green and blue. LVDS is a serial interface and the RGB is a parallel interface. The main difference is that RGB is not differential, so it is easier to disturb signal with noise and you configure the speed of this interface too high. Parallel interface means that we send every bit in a separate line. In theory this interface could be fast, but because it is not differential, the transfer speed is limited. Moreover, the RGB display interface will work with rather small screen sizes – usually up to 7-inch or 10-inch.
12 inch screen size is the total maximum for a LCD display with RGB interface, but the resolution will be lower, like 800 by 600. For this display size it is very low resolution. This is the reason why the 7-inch is size above which the LCD displays are being switched from RGB to LVDS interface. Among Riverdi products (if you go to the Riverdi website and to the IPS display tab), there are displays without the controller, and the small displays like 3.5-inch, 4.3-inch and 5-inch are equipped with RGB interface. But when you go to the 7-inch LCD displays tab on Riverdi website, you will find RGB, LVDS and MIPI displays. But when you go to the 10-inch or bigger displays, you will only find the LVDS displays because our 10-inch LCD displays are high resolution 1280 by 800, and it is impossible to build it with the RGB interface.Key Takeaway: RGB is low speed and not immune to noise. Use it for the smaller size displays or with lower resolution.
MIPI – Mobile Industry Processor Interface – is an internally embedded image transfer interface, getting popular these days. This kind of interface is used in mobile applications, tablets or mobile phones, but it is entering as an option in industrial applications. In Riverdi we offer 7-inch MIPI displays, but please be careful with other MIPI displays on the market. Many come from mobile phones or tablet market. Also, the TFT glass availability may not be stable as the mobile market changes really fast, every six months or every year. When you buy a 7-inch Riverdi MIPI interface display you are safe, because it is an industrial display.
This is why we have a limited number of displays with MIPI interface – we want to be sure that what we sale will be available for a long time. Longevity is one of Riverdi’s core values and we do not want to deliver anything that will not be supported for a minimum 3 to 5 years. It is because many of our customers are making industrial, medical or military devices and they need displays to be available long-term.Key Takeaway: MIPI is an important and growing interface in the display market.
Next interface is the Vx1. It is similar to LVDS and MIPI, so it’s low voltage differential signal. Vx1 is a very high-speed interface, usually used in large high-resolution screens, like 55-inch 4K TVs or even larger ones. If you buy this kind of a TV set right now, probably the embedded interface inside will be the Vx1.Key takeaway: Vx1 is a super-fast interface used for high bandwidth image transfer, with high refresh rate and high-resolution displays, used in 4K screens and above.
The last internal image transfer interface is Embedded DisplayPort (eDP). We call it the new LVDS, because many new industrial displays are equipped with the eDP. If you go through industrial manufacturers of TFT LCD displays, you will notice increasing number of models available with the eDP. eDP is also a native interface in new Intel or AMD based processors.Key Takeaway: With the embedded DisplayPort as a native display interface you can cut down costs, because you do not need anything extra to connect a display to the processor.
Now, with the processors on the market, we need displays with embedded DisplayPort. Many laptops or monitors already use embedded DisplayPort as an internal interface instead of LVDS. LVDS still is the most popular industrial LCD display interface. All the internal image transfer interfaces like MIPI, Vx1 and eDP are variations of LVDS, where the protocols and the signals are a little bit different. For example, for eDP we can have lower noise and reduced power consumption. All of them have advantages over regular LVDS, but they are all LVDS type.
Now, let’s take a closer look at external interfaces. Those are the ones that we usually have direct access to. It can be TV or monitor connected to your computer with the HDMI . It can be a DVI usually used for monitors. Or VGA which is an outdated image interface for monitors. The DisplayPort that is a HDMI successor. Finally, an universal USB-C, the most common interface nowadays used to connect devices.
Let us start with USB-C, the most universal interface . It is one of the best interfaces that we have ever designed, because it is really fast and also very universal. It not only transfers data, not only it is fast enough to transfer image, but it can also transmit a lot of power.
USB-C transmits up to 100 watt of power, because you can increase voltage and current. In a regular USB it is usually 5 volt and 0.5 or 1.0 amp, so only a couple watts. In USB-C you increase the voltage up to 20 volt and with the 5 amp current, so in total it’s even 100 watt of power. This interface is made not only for data, but for real power transfer. Through USB-C you can charge your phone and your laptop. If you buy a new laptop right now, you may even not get a regular power connector, but only an USB-C. The USB-C is a very smart interface. If you connect the devices, they can negotiate with each other which one has more power. For example, if we connect a charger to a laptop, the charger has more power and will charge the laptop, but if you connect the laptop with the same interface to your mobile phone, then they will discuss the power levels, and of course the laptop will be charging the phone. You can already find monitors on the market that have USB-C instead of HDMI. Those monitors can be powered from your computer and need only one USB cable, both for image transfer and power. For sure the future belongs to USB-C implementations.Key Takeaway: USB-C is a really smart, universal and fast interface for displays. It comes with power transmission option.
Let’s move on to image transfer interfaces. The most common one is HDMI – High-Definition Multimedia Interface. M stands for Multimedia, because it transfers image with sound. If you connect your computer to your TV set with HDMI, you will need one cable for both the video and the audio. There are variations of HDMI connectors:standard HDMI,
The next one is DVI – Digital Visual Interface. The first DVI was not a multimedia interface, because it did not have audio data transfer. Nowadays, there are some variations that can transfer audio, but it is non-standard. We can assume DVI is rather for image transfer. It is a digital interface, similar in signals to HDMI. The latest variation is DVI-I, where I stands for integrated interface. It can have a digital and analog part for VGA compatibility. In the picture above there is a DVI-D, digital only, where we do not have the pins for analog VGA interface. Analog VGA is sometimes available in your desktop computer, but not in laptops anymore.Key Takeaway: DVI is digital visual interface with multiple variations and updates, similar in signal to HDMI
The oldest video interface still in use is the VGA – Video Graphic Array interface. It becomes less and less popular. This is an analog interface, not a digital one like all the other abovementioned interfaces. Analog interface means that we do not transmit the bits, but we send the voltages values. The analog signals are not stable, they are quite easy to disturb, so the transfer cannot be very high in speed and volumeKey takeaway: VGA’s popularity is declining, and it is not the best solution if you have a high-resolution display or noisy environment.
The last external interface that we can find in our devices nowadays is a DisplayPort. DisplayPort is similar to HDMI or DVI. It can also transfer image and sound. It is even faster than the HDMI. Usually, the DisplayPort is used for high resolution displays, for new monitors and TVs with 4K or 8K resolution where it is really hard, or nearly impossible, to achieve such resolution using HDMI interface.Key Takeaway: DisplayPort is super-fast image and sound transmitting interface, used in highest resolution displays.
This is a third release of combined soldering iron controller for Hakko T12 tips and 858D rework station based on STM32 micro controller. This time the oled display was replaced by ili9341 TFT one with SPI interface. There are several display variants (2.2", 2.4", 2.8" or 3.2") in the market, so you can chose the one that satisfies your requirements, I used 2.2" display. The touch screen feature is not used in this project, but you can use display with touch screen panel.
The soldering controller supports using soldering iron and Hot Air Gun at the same time. In the main mode, you can activate any device or activate both devices simultaneously or turn them off. As soosn as the display resolution is higher than oled display, the information of both devices can be displayed on the main screen.
Before updating the firmware, save the PID parameters if you have modified them. The landscape orientation is still the default. Some issues can be faced in the portrait display mode. Report them to be fixed.
To decrease the controller price and increase its reusability, the complete schematics was split in 3 separate PCBs. The main PCB conntains the main low-voltage components: stm32 blackpill board, op-amps, voltage dc-dc converter and regulator, mosfets that manage the soldering iron and Hot Air Gun fan. The AC power PCB contains the high-voltage part of the project: the triac, optional high-voltage relay and opto-couplers that creates galvanic isolation from the main board. These boards connected via 5-wire interface cable. The display PCB contains the TFT display and two rotary encoders.
JP11 is a optional DIP-type connector for SD-card reader on the TFT display. This connector is used to load external files to the SPI flash memory IC. Just solder the pin-header here.
The debug switch is optional one. You can solder the wire instead. It is used to disconnect 24v power from the bluepill board when the firmware is loading from your PC or while debug the firmware. As soon as 24v AC-DC power supply is not isolated one and the PC has non-isolated power supply also, it is possible to destroy blackpill board when it receives the power from different sources.
The high-voltage board implements wide lines and should be ordered with2ozdepth to allow high current to the Hot Air Gun heater. It would be very expensive to order the complete board with 2 oz depth, so the high-voltage part was split to a separate PCB. Yet, the interface connector is completely isolated from AC power via two opto-couplers OK1 and OK2. The EasyEda page contains two versions of the pcb, both are correct. You can select the one you like.
The interface connector has 5 wires that manages the AC power board:"+24" is +24 volt from AC-DC power supply to activate K1 relay. You can remove this wire if you do not install the relay
The schematics of the board is very simple. It contains two rotary encoders and TFT display. Also, you can see the mosfet that manages the TFT display brightness.
The controller requires big size PCB to fit all the components so it is convenient to create the display separate board. Also, It is convenient to solder rotary encoders to the display board and use encoder neck to fix this board on the acrylic front panel.
This controller is working with ili9341 based TFT displays only. You can select the display size (2.2", 2.4", 2.8" or 3.2"). The display has sufficient resolution 320x240 to show required information. I used the 2.2" one to fit the case.
The Hakko T12 soldering tips are very convenient tools: they are heating extremely fast and have a sensor inside that allows to keep the temperature very accurate. The tips require just three wires: plus, minus (ground) and earth ground. The heating element inside the tip is connected consequently with the thermo couple allowing to decrease the required wires. It makes the cable very flexible and light weight.
When connecting the Hot Air Gun handle to the controller via GX16-8 plug you can use the following reference of the plug pin-out. Unfortunately, I do not know the color of the wires because my handle was assembled. I have been told that there is a different kind of hakko 858D handles in the market and your handle can have different pinout. To check your handle pinout you can keep in mind the following criteria:The plug should have two wires for the heating element, two wires for the temperature sensor and two wires for the fan. The reed switch shares gnd with a temperature sensor.
This feature increases the safety of soldering iron. There are two automatic power-off features are implemented inside the controller, software driven and hardware driven. The hardware driven one requires optional TILT or REED switch installed in the iron handle. In the software mode, the controller turns on the Idle mode if the supplied power to the iron is stable for a while. In this case, the controller will power off the iron in specified timeout. When the time to automatic shutdown near, it will be displayed as a seconds remaining. When you use the iron, the supplied power changes and the controller resets the automatic power off timeout.
To use the hardware TILT switch, you must setup automatic power off timeout and standby temperature. If the standby temperature is "OFF" the hardware tilt switch will not be used and software solution described previously will be activated. Also, you can setup standby time (timeout to switch to low power mode). When the tilt switch enabled, the main working mode changes the following way. The iron is starting heating. When it reaches the preset temperature the "Ready" message will be displayed and the controller will keep the preset temperature. If the soldering IRON is not used (laying on the table) the controller will switch low power mode. If the iron keep laying for automatic off timeout, the controller will switch off the power completely. As soon as you start using the iron, the controller restores the preset temperature.
The main component is the BlackPill board. You can use the pure STM32F401CCU6 micro controller if you wish to create compact variant of the soldering station.
Connect this DC-DC converter consequently with b0505 isolated cobverter: 24v -> MP1584 DC-DC converter -> b0505 -> ams1117 gnd you get isolated power supply for your stm32 micro controller. This king of power supply is isolated and low-noise power that ensure accurate ADC temperature readings.
This project is based on the BlackPill board with STM32F401CCU6 micro controller. To flash prebuilt firmware to the controller the st link v2 programmer and ST link utility are required.
Download the STM32 ST-LINK utility fromstsite. Install the utility in your system. Launch the ST-LINK utility, connect the programmer to the 4pins SWD interface of BlackPill board, press "connect" button. The main window should display the memory content of the BlackPill board. Press flash button to write the firmaware to the BlackPill board.
As you can see, the main AC power after fuse that can be installed on the pannel of the case, goes into JP3 socket on the high voltage board. You can connect main power switch to the JP6 socket or short it oins and completely remove main switch if do not like to use it. JP4 and JP2 sockets are used to connect to the GX16-8 connector of the Hot Air Gun. The power to the heater goes from JP4 socket and all other wires connected to the JP2. Earth ground should be connected to the Earth ground of AC power (not shown here). JP8 and JP9 connectors should be connected together. Soldering Iron GX12-5 connector should be connected to JP1 and JP5 sockets. JP10 used to connect optional automatic mode switch. Using this switch you can disconnect the Hot Air Gun completely from the controller when it is not needed. JP3 should be connected to the J1 connector on the TFT board. This is 14-wires connector to attach the display and rotary encoders.
Using JP11 you can connect the SD-CARD installed on TFT display to the controller when going to upload some files from SD-CARD to SPI FLASH. For instance, it can be used whel upload localization data files.
In the controller schematics you can see two 500k potentiometers R5 and R19 that tunes the operation amplifier U4.1 and U4.2 to get the expected temperature readings at controller pins PA4 and PA5 of BlackPill board. You can use different operating amplifier, so these potentiometers are increasing the controller flexibility.
To simplify controller tuning procedure, the tune modes are implemented in the controller. This modes can be activated from the system menu item "tune iron" or "gun menu->tune gun". When the tune mode is activated, the controller powers on the iron or Hot Air Gun and displays on the screen applied power (in percents) and the gauge of the current temperature readings. The gauge has a label "450" or "500" depending on what hardware you are tuning. When the gauge reaches this label, the temperature should be 450 or 500 degrees of Celsius.
As soon as you have stabilized the iron temperature near 450 degrees, rotate the 500k potentiometer trim to shift gauge bar on the display left or right. Adjust the potentiometer so the bar would be as near to the reference temperature as possible. Then long press the encoder handle (for about 2 seconds) to turn the iron off and finish the procedure. It is recommended to use the thick tip that produce the highest voltage when performing the tune procedure. For example, T12-K, T12-D52 or similar.
As you can see from the picture above, the debug screen shows the following information:iron status (off or on). You can manage the power supplied to the soldering iron by rotating the upper encoder. As the encoder rotated, you adjust the power supplied to the iron (in internal units). The more power supplied to the iron the faster it heats. Supplied power value displayied in the right column ("irnP") in the internal units.
If the SPI FLASH is formatted and working correctly, you should see the screen above. As you can see, it is the root directory list of SPI FLASH. In case of FLASH error, the error message would be displayed indicating the FLASH is not readable. If your SPI FLASH is unformatted, the corresponding message would be displayed and the controller asks you to confirm the FLASH should be formatted. When the FLASH will be formatted, you should see the empty file list.
The current tip can be calibrated using "calibrate tip" menu item. If the tip is not calibrated yet, the "[!]" sign would be displayed near the tip name on the main screen. There are two calibration modes in the current version of the controller firmware: automatic and manual.
First, turn the power on by pressing the encoder lightly to start calibration process from the first referense point. The iron start heating. When the reference temperature reached, the controller beeps and get ready to read the real temperature value. Check the iron temperature by the external thermo-couple and enter this temperature to the controller: rotate the encoder handle to select the real temperature then press the encoder lightly. Then the controller continues with the next reference point. This procedure finishes when you enter temperature of all 8 reference points or when the real temperature will be greater than 430 Celsius. During this procedure controller updates the tip calibration data.
In manual tip calibration you must "guess" the internal temperature readings that matches the calibration temperature. First, you should select one of the 4 calibration temperature and press the encoder lightly to start calibration process. This procedure is iterative: you start with the some preset temperature value in internal units (for example, calibrated by automatic procedure) the controller heats the tip to this preset temperature and gets ready. Then you measure the real temperature by the external thermo-couple. If the real temperature is not equal to the preset one, you should increase or decrease the internal preset temperature by rotating the encoder handle.
The progress bar in the lower part of the display shows the difference between preset and current temperature (in internal units) of the tip. The controller keeps the tip temperature near the preset value (vertical line on the progress bar) all the time. To increment the preset temperature, turn the encoder right, to decrease - turn it left.
When the low power (standby) mode activated, the controller shows the "standby" icon in the upper-right corner of the display lie shown on the picture below.
The "tune iron PID" and "gun setup->tune gun PID" menu items in the main menu allowing tuning PID parameters of soldering iron and Hot Air Gun. When tune PID mode activated, you can see three values of PID parameters on the display, Kp - proportional, Ki - integral, Kd - differential. First, choose the parameter you are going to change and press the encoder button. You turn into tuning test mode. There are two graphs: the temperature difference and power math dispersion. Both graphs are auto magnifying ones and its maximum value is shown on the Y-axis by the corresponding color.
Prebuilt version of the controller software can be downloaded from the github repository. To upload this hex file into controller, you can use stm32 st-linkutility.
In order to use your native language, the NLS data should be uploaded into SPI FLASH. To do so, you have to:Connect your SD-CARD reader (the TFT display board has one) to the JP11 connector via 4 wires: SD_CS (Chip Select), MOSI, MISO, SCK. If you have not implemet the JP11 socket, remember following: SD_CS (Chip Select) - PB12, MOSI - PB15, MISO - PB14, SCK - PB10.
When the controller copies files from SD-CARD to SPI FLASH, it reads thecfg.jsonfile and loads the language data accordingly with this file. For each language in the list, it checks the language consistency and copies data files when the language is consistent (have both message and font file). Yet, the controller copies only files that is newer that existed on SPI FLASH one. Font data file can be used for several languages. For instance, you can use ubuntu_we.font f