[Atria AT32WB415 Series Bluetooth BLE 5.0 MCU] + Bluetooth communication
[Copy link]
[Atria AT32WB415 Series Bluetooth BLE 5.0 MCU] + Bluetooth communication
- Bluetooth BLE Application Notes
- After checking the official website, I found the Bluetooth manual and started to learn and understand its functions and usage.
1.2. As shown in the figure, the Bluetooth function is introduced. The Bluetooth core has 8 GPIOs, 2 PWMs, and 2 USARTs.
1.3、AT32WB415 core diagram
1.4. All functional pins of the Bluetooth core require an external 16MHz crystal oscillator, reset pin, power supply pin, antenna pin and internal interconnection between the core UART21 and USART3.
2. Introduction to Bluetooth Kernel
2.1. When I open the ble project file downloaded from the official website, Keil reports an error, saying that the ARM9E driver is not installed.
2.2. After consulting the information, I found the system framework diagram of its Bluetooth kernel. Its kernel is ARM9 kernel. This project is an ARM9 project and needs to install Legacy Support to compile. Users can download it according to their own environment in the following path: www2.keil.com/mdk5/legacy/.
2.3. For details, please refer to BLE Application Note AN0077
2.4. Compilation is successful after installation is complete
3. Program Download
3.1. The DEMO program file is AN0077_AT32_BLE_Application_Note_V2.0.4, which can be found on the official website.
3.2、In the understanding and analysis of the system architecture in the first half of this article, we know that the Bluetooth program needs two parts, the first part is the MCU core program, and the second part is the BLE core program, which use serial port communication. Therefore, during the program download process, two parts of the program files also need to be downloaded.
3.3. The MCU starting address is 0x8000000, and the BLE starting address is 0x00000000.
4. Establish a normal communication connection between the mobile phone and Bluetooth.
4.1. I randomly downloaded a debugging assistant from the Internet, because I saw that the official mobile app of the routine did not seem to be independently developed. First, a connection was established.
4.2. BLE (Bluetooth) Demo project has two modes: transparent transmission function and command function. The command function mode will be redefined in the future development, so let's share the transparent transmission function. First try to use the serial port tool to establish PC communication, use the USER button to switch to the transparent transmission function, and the button switch is accompanied by the printing of the function description.
4.3. As shown in the figure, the transparent transmission function is intact and can be used normally. It is very easy to use. . .
4.1. The WB415 Bluetooth logic control program is still based on the MCU core, and the BLE core is only used for Bluetooth communication functions. The MCU core uses the usart3 interface for the communication port, and the host computer software can send or introduce strings and hexadecimal data exchange through the Bluetooth core.
4.2. Its software structure is still a bit difficult. The structure is used very smoothly in program design. When interpreting the code, you need to jump back and forth. Normally, you need to be familiar with it before further development and use.
The overall functions are complete, the ideas are clear, and I will use the manufacturer's chip design products in my future projects.
|