STM32's USART0 and ZigBee's P02_RX and P03_TX pins realize serial bidirectional communication

Publisher:一条属马的龙Latest update time:2018-10-17 Source: eefocusKeywords:STM32  USART0  ZigBee Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

STM32's USART0 and ZigBee's P02_RX and P03_TX pins realize serial bidirectional communication

BY:T7

Date:20171214

At:YSU_B307

Development Environment:

uVision : V5.12.0.0 STM32F103V8T6

Library version: STM32F10x_StdPeriph_Lib_V3.5.0

1. Hardware connection:

1. STM32:

 

STM32's USART0 and ZigBee's P02_RX and P03_TX pins realize serial bidirectional communication

2. Zigbee

 STM32's USART0 and ZigBee's P02_RX and P03_TX pins realize serial bidirectional communication


3. Z-TEK ZY099 RS232 TO TTL (5V) serial port converter compatible with level 232 to TTL

 STM32's USART0 and ZigBee's P02_RX and P03_TX pins realize serial bidirectional communication


4. Nine-pin serial cable RS232 cable db9 male to male cross cable

 STM32's USART0 and ZigBee's P02_RX and P03_TX pins realize serial bidirectional communication


5. Connection diagram from STM32 to ZigBee

 STM32's USART0 and ZigBee's P02_RX and P03_TX pins realize serial bidirectional communication


2. Code:

1.STM32 code: Function: what the serial port receives and what it sends

Link: https://pan.baidu.com/s/1bGgurO Password: m9ls

3. ZigBee code: Function: serial port transparent transmission

Link: https://pan.baidu.com/s/1nvvHutz Password: 1k27

3. Experimental results:

Functional implementation: After the hardware is connected and the code is downloaded as described above, connect the ZigBee coordinator to the PC through the serial port, open sscom32, and send "This is the Serial Test!" to the coordinator. The coordinator sends the data to the terminal node through the serial port transparent transmission function. The terminal node receives the message and converts it to RS232 via P02_RX, P03_TX ----> TTL ---> STM32; then STM32 receives the data and converts it to TTL via RS232 ---> P02_RX, P03_TX (terminal node) ---> coordinator through the serial port, and then sends it to the sscom32 window of the PC through the serial port of the coordinator. As shown below:

 

STM32's USART0 and ZigBee's P02_RX and P03_TX pins realize serial bidirectional communication


Keywords:STM32  USART0  ZigBee Reference address:STM32's USART0 and ZigBee's P02_RX and P03_TX pins realize serial bidirectional communication

Previous article:The difference between JTAG and SWD modes of STM32
Next article:STM32 reads SD card using FATS file system without valid FAT volume

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号