[DIY или Сделай сам, Дизайн, Мониторы и ТВ, Производство и разработка электроники, Разработка под Android] STM32 development board tutorial:use STONE STVC101WT-01 to control STM32

Автор Сообщение
news_bot ®

Стаж: 6 лет 3 месяца
Сообщений: 27286

Создавать темы news_bot ® написал(а)
07-Июл-2020 14:31

STM32 development board tutorial:use STVC101WT-01 to control STM32
Brief
This article mainly aims at making a simple design of beauty instrument, teaching everyone how to use STONE LCD screen to develop a beauty instrument with touch screen, as shown in Figure 1 below:
<img src="
" alt=«image»/>
Figure 1
Because I have a lot of contacts with ST, MCU like this type can generally plug in the screen through IIC or SPI or serial port, such as 0.96 inch display screen, 1602 LCD screen, and various TFT LCD screens, and I decided to use STONE LCD screen to do this project. Speaking of STM32 board.
Project requirements
Here we want to do a project about the use of medical devices and instruments. This project is mainly through our STVC101WT-01 serial port screen, through the touch mode. After pressing the key, the serial port screen sends the serial port command to STM32l053r8 through the serial port command. When our STM MCU receives the specific command, it starts to analyze the command, This resolution protocol is specific, which will be discussed later. After that, MCU will analyze and recognize specific fan instructions and led instructions, so as to realize the control of fan and led.
There are four functions:
①.Serial port screen realizes touch key function;
②.Send touch command;
③.MCU analyzing instruction;
④.Control the FAN and LED.
After the function is determined, we need to select the model of each module:
①. Type of touch screen;
②.What kind of MCU module do we use;
③.What kind of peripheral module to use.
I plan to use STVC101WT-01 serial port screen for touch screen, after all, it is very convenient to use, and the market also has a certain proportion, the most important thing is that it is easy to use; the problem of screen is solved, and then a MCU should be selected. Why do I use STM32l053r8 for MCU? Because the global market share of St MCU is more than 11% in 2015;
We use 5V 4W DC power supply for fan, so that it can be controlled directly through IO port; ordinary LED is used.
Introduction and principle of each hardware
Fan
Generally speaking, fans have fan blades, which are electric driven devices to generate current. The fans configured in the fans are powered and then turned into natural wind to achieve cool effect.
Structure
Rotor: it is composed of magnet, fan blade and shaft; stator: it is composed of silicon steel sheet, coil and bearing; control circuit: it is composed of IC induction magnet N.S. pole to control its coil conduction through circuit and generate internal excitation to make rotor rotate. Type: axial fan, DC fan. Size: 40mm * 40mm * 15mm.
<img src="
" alt=«image»/>
Figure 2
Working principle
The main components of the electric fan are: DC motor. Its working principle is: the electrified coil rotates under the force in the magnetic field. The transformation form of energy is: electrical energy is mainly converted into mechanical energy, and because the coil has resistance, it is inevitable that part of electrical energy will be converted into thermal energy.

Figure 3
LED
LED. It is made of compounds containing gallium (GA), arsenic (as), phosphorus (P), nitrogen (N), it can radiate visible light when electrons are combined with holes, so it can be used to make light-emitting diodes. In circuits and instruments as indicator lights, or composition of text or digital display.
<img src="
" alt=«image»/>
Figure 4
Describe of STVC101WT-01
10.1 inch 1024x600 industrial grade TFT panel and 4-wire resistance touch screen;
brightness is 300cd / m2, LED backlight;
RGB color is 65K;
visual area is 222.7mm * 125.3mm;
visual angle is 70 / 70 / 50 / 60;
working life is 20000 hours. 32-bit cortex-m4 200Hz CPU;
CPLD epm240 TFT-LCD controller;
128MB (or 1GB) flash memory;
USB port (U disk) download;
toolbox software for GUI design, simple and powerful hex instructions.
Basic functions
touch screen control / display image / display text / display curve / read and write data / play video and audio. It is suitable for various industries.
UART interface is RS232 / RS485 / TTL;
voltage is 6v-35v;
power consumption is 3.0w;
working temperature is — 20 ℃ / + 70 ℃;
air humidity is 60 ℃ 90%.
STVC101WT-01 module communicates with MCU through serial port, which needs to be used in this project. We only need to add the designed UI picture through the upper computer through the menu bar options to buttons, text boxes, background pictures, and page logic, then generate the configuration file, and finally download it to the display screen to run.
<img src="
" alt=«image»/>
Figure 5

Figure 6
The manual can be downloaded through the official website:
www.STONEitech.com/support/download

Figure 7
in addition to the data manual, there are user manuals, common development TOOLBox, drivers, some simple routine demos, video tutorials, and some for testing projects.
STM32L0538
The ultra-low power STM32l053x6 / 8 microcontroller combines the connection capability of universal serial bus (USB 2.0-less crystal) with the high-performance arm cortex — M0 + 32-bit RISC core running at 32 MHz.
STM32l053x6 / 8 device has many analog functions, one 12 bit ADC, one DAC, two ultra-low power comparators, multiple timers, one low power timer (LPTIM), three general 16 bit timers, one basic timer, one RTC and one systick can be used as time base. They also have two watchdog, a watchdog with independent clock and window functions, and a window watchdog based on bus clock.
In addition, STM32l053x6 / 8 device also embeds standard and advanced communication interfaces: up to two I2C, two SPI, one I2S, two USART, one low-power UART (LPUART) and one crystal free USB. The device provides up to 24 capacitive sensing channels, which can simply add touch sensing function to any application.
<img src="
" alt=«image»/>
Figure 8
Development steps
Generally speaking, the following steps are needed to develop a serial port screen:
①.Design with Tool 2019 software;
②.Realize the interface communication project between MCU and screen;
③.Realize MCU's analysis of each command and trigger the action of response.
STONE TOOLBox 2019 (free gui design software)
STONE TOOLBox 2019 and related USB serial port drivers can be downloaded from
www.stoneitech.com.
The software is as follows:
<img src="
" alt=«image»/>
Figure 9
STM32CubeMx
stm32 datasheet: www.st.com/resource/en/datasheet/stm32f205rb.pdf
Download link: www.st.com.
After installation, the interface will open as follows:

Figure 10
Click here to open, we just need to select MCU model STM 32l053r8, and then generate the project.
how to interface TFT LCD with microcontroller STM32
Hardware is the basis of all electronic design and the carrier of code. To make the code run, there must be hardware, and to ensure that the code can run normally, there must be a normal hardware connection. Therefore, the connection diagram is as follows:

Figure 11
TOOL 2019 interface design
Use the installed tool 2019, click the new project in the upper left corner, and then click OK.

Figure 12
After that, a default project will be generated, with a blue background by default. Select it and right-click, then select remove to remove the background. Then right click picture file and click Add to add your own picture background, as follows:

Figure 13
Then add the required controls, which are mainly button control, numerical addition and subtraction control, and data variable control.

Figure 14
The following operations are available when configuring the add / subtract buttons:

Figure 15
Expressed as follows:
①.configure the effect of button pressing;
②.configure the variable address of the control to write the value;
③. configure addition or subtraction;
④.configure the value range.
When configuring a digital text box:

Figure 16
Followed by:
① .set the variable address of the control;
②.set the number of digits;
③.set the size of the number;
④ .set the alignment of the numbers.
Finally, we click ‘generate configuration tool

Figure 17
Now the configuration is complete
The interface is mainly used to adjust the speed, dose and radio frequency, so as to achieve the cosmetic effect of the face and waist.
①. speed adjuSTMent address 0x0001
②. dose regulation address 0x0002
③. RF regulation address 0x0003
Note:
The relationship between touch addition and subtraction and digital display box is related by variable address, so it is necessary to maintain consistency to achieve correct control.
The development of STM32L053R8

Figure 18
After selecting the corresponding chip model, click start project to enter the configuration interface.

Figure 19
Configure and select the project name and storage path, then click generate code to generate the code. After adding the protocol code, the demo can be tested. The detailed code is as follows:
/* USER CODE BEGIN Header */
===========
Источник:
habr.com
===========

Похожие новости: Теги для поиска: #_diy_ili_sdelaj_sam (DIY или Сделай сам), #_dizajn (Дизайн), #_monitory_i_tv (Мониторы и ТВ), #_proizvodstvo_i_razrabotka_elektroniki (Производство и разработка электроники), #_razrabotka_pod_android (Разработка под Android), #_stm32, #_stone, #_lcd_screen, #_tft_lcd, #_diy_ili_sdelaj_sam (
DIY или Сделай сам
)
, #_dizajn (
Дизайн
)
, #_monitory_i_tv (
Мониторы и ТВ
)
, #_proizvodstvo_i_razrabotka_elektroniki (
Производство и разработка электроники
)
, #_razrabotka_pod_android (
Разработка под Android
)
Профиль  ЛС 
Показать сообщения:     

Вы не можете начинать темы
Вы не можете отвечать на сообщения
Вы не можете редактировать свои сообщения
Вы не можете удалять свои сообщения
Вы не можете голосовать в опросах
Вы не можете прикреплять файлы к сообщениям
Вы не можете скачивать файлы

Текущее время: 09-Май 01:45
Часовой пояс: UTC + 5