USART

所属分类:处理器开发
开发工具:C/C++
文件大小:165KB
下载次数:419
上传日期:2008-08-31 14:06:28
上 传 者xionggang
说明:  STM32是以Cortex-M3为核的处理器,该例程介绍STM32下如何对串口进行操作。串口是最基本的调试输入输出接口。
(Cortex-M3 based STM32-core processor for the routine introduction STM32 how to operate on the serial port. Serial debugging is the most basic input-output interface.)

文件列表:
USART\Example1\main.c (8869, 2008-04-10)
USART\Example1\STM32F10x.s (8816, 2007-06-13)
USART\Example1\stm32f10x_conf.h (5578, 2008-04-10)
USART\Example1\stm32f10x_it.c (22695, 2008-04-10)
USART\Example1\stm32f10x_it.h (3267, 2008-04-10)
USART\Example1\USART.Opt (2794, 2007-06-13)
USART\Example1\USART.Uv2 (5762, 2007-06-15)
USART\Example10\Receive\main.c (9190, 2008-04-10)
USART\Example10\Receive\STM32F10x.s (8816, 2007-06-13)
USART\Example10\Receive\stm32f10x_conf.h (5574, 2008-04-10)
USART\Example10\Receive\stm32f10x_it.c (22695, 2008-04-10)
USART\Example10\Receive\stm32f10x_it.h (3267, 2008-04-10)
USART\Example10\Receive\USART.Opt (2800, 2007-06-13)
USART\Example10\Receive\USART.Uv2 (5768, 2007-06-15)
USART\Example10\Transmit\main.c (11093, 2008-04-10)
USART\Example10\Transmit\STM32F10x.s (8816, 2007-06-13)
USART\Example10\Transmit\stm32f10x_conf.h (5574, 2008-04-10)
USART\Example10\Transmit\stm32f10x_it.c (22695, 2008-04-10)
USART\Example10\Transmit\stm32f10x_it.h (3267, 2008-04-10)
USART\Example10\Transmit\USART.Opt (2800, 2007-06-13)
USART\Example10\Transmit\USART.Uv2 (5768, 2007-06-15)
USART\Example11\main.c (12469, 2008-04-10)
USART\Example11\STM32F10x.s (8816, 2007-06-13)
USART\Example11\stm32f10x_conf.h (5568, 2008-04-10)
USART\Example11\stm32f10x_it.c (23304, 2008-04-10)
USART\Example11\stm32f10x_it.h (3267, 2008-04-10)
USART\Example11\USART.Opt (2794, 2007-06-13)
USART\Example11\USART.Uv2 (5762, 2007-06-15)
USART\Example12\main.c (13633, 2008-04-10)
USART\Example12\STM32F10x.s (8816, 2007-06-13)
USART\Example12\stm32f10x_conf.h (5570, 2008-04-10)
USART\Example12\stm32f10x_it.c (23430, 2008-04-10)
USART\Example12\stm32f10x_it.h (3267, 2008-04-10)
USART\Example12\USART.Opt (2794, 2007-06-13)
USART\Example12\USART.Uv2 (5762, 2007-06-15)
... ...

/******************** (C) COPYRIGHT 2007 STMicroelectronics ******************** * File Name : readme.txt * Author : MCD Application Team * Version : V1.0 * Date : 10/08/2007 * Description : Description of the USART Example1. ******************************************************************************** * THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE * CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. *******************************************************************************/ Example description =================== This example provides a description of how to use the USART with hardware flow control and communicate with the Hyperterminal. First, the USART2 sends the TxBuffer to the hyperterminal and still waiting for a string from the hyperterminal that you must enter which must end by '\r' character (keypad ENTER button). Each byte received is retransmitted to the Hyperterminal. The string that you have entered is stored in the RxBuffer array. The receive buffer have a RxBufferSize bytes as maximum. The USART2 is configured as follow: - BaudRate = 115200 baud - Word Length = 8 Bits - One Stop Bit - No parity - Hardware flow control enabled (RTS and CTS signals) - Receive and transmit enabled Directory contents ================== stm32f10x_conf.h Library Configuration file stm32f10x_it.h Interrupt handlers header file stm32f10x_it.c Interrupt handlers source file main.c Main program Hardware environment ==================== - All the USART2 signals (Rx, Tx, RTS and CTS) must be connected to a DB9 connector using a RS232 transceiver. - Connect a null-modem female/female RS232 cable between the DB9 connector (CN5 on STM3210B-EVAL board) and PC serial port. - Hyperterminal configuration: - Word Length = 8 Bits - One Stop Bit - No parity - BaudRate = 115200 baud - flow control: Hardware How to use it ============= In order to make the program work, you must do the following : - Create a project and setup all your toolchain's start-up files - Compile the directory content files and required Library files : + stm32f10x_lib.c + stm32f10x_usart.c + stm32f10x_gpio.c + stm32f10x_nvic.c + stm32f10x_rcc.c + stm32f10x_flash.c - Link all compiled files and load your image into either RAM or Flash - Run the example ******************* (C) COPYRIGHT 2007 STMicroelectronics *****END OF FILE******

近期下载者

相关文件


收藏者