The Semiconductor is introduced for the STM32F4 series of MCUs to introduce the STM32F4-Discovery development board (about the evaluation of the STM32F4-Discovery board), and its MCU's function is gradually learned, and for a senior engineer, a set The STM32F4-Discovery board adds yourself DIY to test its function. But for a newcomer, although the development board uses a pin in needle, it will increase the difficulty. Here, you must introduce a supporting development component based on STM32F4 development board --- Yingji Discover-Mo :) series, providing an existing convenient peripheral component for engineers who don't like their DIY. . It mainly includes 3 parts: expansion board DM-STF4BB, LCD module DM-LCD35RT with touch screen, camera module DM-CAM 130, and a CD containing module basic functions, user manuals, DEMO routines. Today, I mainly tried to try 3 extended features of DM-STF4BB boards: serial port, micro-SD card, and Ethernet port.
First come to Zhang Quanjiao:
Look at the front of the expansion board DM-STF4BB
Plate back
Main hardware parameters of the DM-STF4BB substrate
Work and storage temperature: 0 ~ 45 ° C
Power consumption: + 5V @ 80mA (without screen)
Size: 97.03mm * 83mm
LCD parallel interface, support 16bit, 8080 mode
4-channel resistance screen touch interface
Camera interface (support 1.3M digital camera, multiplexed with UART6)
1 RS232 serial port (UART6, COM1 interface can be multiplexed by jumper JP1 and JP2 and camera interface)
1 Road 10 / 100Mbps Ethernet Interface
1 2.54mm spacing 2 * 20-pin extension interface, with the following hardware peripherals:
- 5 serial ports, TTL levels, through needle
- 1 4 channel PWM
- 1 SPI
1 Road I2C
- 1 channel CAN2.0B interface (need to expand CAN transceiver)
- 6 GPIO ports
Software Environment
Support UC / OS-II_V2.86 & UC / GUI_V3.90A, and provide BSP source code
Support for FATFS_VR0.08A file system (file system for SD card)
Support LWIP_V1.3.2 protocol stack
It is recommended to use Keil MDK4.22A and above and the above version of the IAR EWARM 6.40 and above development environment.
As can be seen from the above figure, the DM-STF4BB expansion board is very simple. There are only two ICs in front, one is a serial port converting IC SP3232EEY-L, and the other is the Ethernet transceiver IC LNA8720A, and there is no electronic component on the back of the board. However, it is precisely such a concise board to provide a very rich peripheral interface for the STM32F4-Discovery development board. And through the test, the connection integration of the board and the STM32F4-Discovery development board is very good, the entire look is very compact coordination, the plug is also very convenient, see a few connection portfoliographs.
Preparation of the side combination chart
Positive combination diagram after fully connected
Here, you will feel the three basic functions of DM-STF4BB, let readers have more understandings for DM-STF4BB Base Base Base Base.
Serial port
The TTL level is used by the UART of the STM32F4-Discovery board, while the RS232 interface of the computer is a standard RS232 level. To make the serial connection communication on the STM32F4-Discovery board and the PC must pass the level conversion, and via SP3232EEY-L The chip can realize the level conversion function, the schematic is as follows
After the COM1, the COM1 is used to communicate with the serial interconnection communication with the PC, the signal line of the COM1 port is shown below.
Understand the role of SP3232, next to the official test, the serial port after level conversion is started, first we need to prepare a USB cable and a cross-serial port, connect the combination panel to the picture.
The other end of the USB line is plugged into the PC, open the Keil software, then click Open Project, as shown below
Find the serial test routine provided by Yingji, open, as shown below
Select Rebuild All Target Files, as shown below
After the compilation is completed, we need to load the program into the MCU. You must set KEIL before downloading the program: Click Flash to find Configure Flash Tools Click, as shown below
Click Device again in the pop-up dialog, find STM32F407VG, point OK, as shown below
Go to the Configure Flash Tools dialog box Select Debug, select ST-link Debugger, select Setting next to it, as shown below
After entering setting, select the Debug shown in the red box in the next pop-up, SW
Then choose Flash Download, click Add as shown below.
Enter the new interface to find STM32F4XX Flash, note that the capacity is 1MB, then select Add, as shown below
Finally, enter the configure flash tools, select Utilities, and press the picture in the red box to configure it, click OK.
Finally, the configuration is complete, then download the program, make sure the USB port is powered, click on the Keil software Download, the board will automatically start downloading, only a few seconds waiting, after the download is completed, there will be prompts in the build output box, as shown below Shown
After the download is complete, open the Hyper Terminal on the PC. If you are Win7 users, you need to download a super terminal online, about the setting of the super terminal, the previous evaluation is also introduced. Note that the place in Figure 2 is short-line JP1 and JP2 (Note: UART6 interface is reused with camera interface through jumper JP1 & JP2, short-picking JP1 & JP2 is using UART6, disconnecting JP1 & JP2 is using camera function) See
Press the RESET button on the board, the super terminal will display the following information
This serial routine mainly describes how to redirect the Printf function in the C language library function to the UART, and implement print information using UART6 in the hyper terminal. As shown in the figure above, you have completed the UART test. Give you another serial tool -sscom32, you can also test this routine, see the figure below
The setting of the super terminal can refer to the settings in the map of the map, personal feeling this tool is better than the super terminal, you can use it with it.
Micro-SD
This will then test the Miro-SD card. Also use the routines provided in the CD included in the British special, this routine describes how to use the FATFS file system to read and write operations on the SD card.
Let's first look at the hardware schematic of the Micro-SD card.
Because the STM32F4-Discovery board comes with the Micro-SD card interface signal line, the hardware connection is very simple, just expand the card slot of the Micro-SD card, here is worth mentioning, the PC10, PC11 signal line in the figure UART4 multiplexing, PC12, PD2 signal line and UART5 are multiplexed, see the following schematic diagram Red frame box
It may be in consideration of cost, the SD card signal line does not pick up the TVS tube element like high-end electronic devices, a little regret. On the basis of the test serial port, we only plug in the SD card, pay attention to disconnect the power to then the Micro-SD card. It is recommended to use Kingston's 1G / 2G or SanDisk 2G card. Then use the Keil tool to download the compiled test SD card routine to start tested (Keil's configuration and the configuration of the test serial port), here is worth mentioning, Xiaobian uses SanDisk 8GB Card, can also be tested smoothly, see the figure below
The Terminal Output Test Completed, the test is complete and OK. It can be seen from the super terminal to print information, and the test program has read and write the SD card.
Ethernet
Finally, I will introduce you to the Ethernet interface. First we see the schematic connection of the Ethernet circuit
Because the MCU of the STM32F4Discovery board has integrated Ethernet media access controller (MAC), we have to implement Ethernet functions, and external only need to connect to a physical interface transceiver (PHY) and an Ethernet port HR911105A. Here we choose PHY is LAN8720A, which has a significant feature that minimizes 25MHz crystals to communicate data between Mac and PHY via the RMII mode through the RMII mode.
Plug your network to the Ethernet port of the DM-STF4BB board, and the other end is inserted to the network port of the computer PC. Next, you must configure the IP address on your computer, find local connection, click attribute, as shown below
Find the Internet protocol you are using, click attribute, as shown below
After clicking Go, select Advanced, then display the dialog box shown below, click Add
Enter the IP address and subnet mask as shown below
Finally click "Add" and click "OK" to complete the addition. This added IP address cannot be the same as the IP address set in the routine given by Yingji. The DM-STF4BB board is modified as follows: Open the Ethernet Test Program Project, click the STM324XG_EVAL submenu, find the USER fileware , Find mail.c, as shown below
Locate main.h under the subme menu of Main.c, double-click Open, find Static IP Address to set, as shown below
The IP address set in this program is the DM-STF4BB board preset address, but also the IP address will be used. Here Xiaobi default it is preset IP address 192.168.0.10. If you want to change your IP address, you can click Save, then compile, after downloading the program, open the Internet browser on your computer, enter 192.168.0.10, the browser will jump to the preset page in the program, as shown below
This routine is primarily introduced to view web pages on the DM-STF4BB board from the browser via the Ethernet port.
After reading the evaluation, I believe that many friends are very motivated, and the British Discover-Mo :) Series Development kit has brought us a lot of surprises, and in the point of view of the user's development, it is designed for this purpose. , Convenient, diverse development kits, only simply evaluate the DM-STF4BB substrate, follow-up to bring a screen module and the camera module.
Reference
DM-STF4BB detailed introduction
Devkit407 evaluation kit
ST product line
British Discover Mo :)
STM32 community
Original declaration: This article is originally created by the panel network, declined!
Our other product: