📄 uart2xx.txt
字号:
Writing to the C2xx Asynchronous Serial Port in C V1.00
by Jeff Axelrod 3/26/97
Introduction
This program demonstrates how to write the C2xx asynchronous serial port
from the Texas Instruments C compiler. It is a C version of the uart.asm
file found in Example C-9 of Appendix C in the TMS320C2xx User's Guide
(SPRU127B). The program receives input from the serial port and echoes each
character as it is received.
Contents
File Description
main.c Main C module which initializes the serial port settings and
contains the interrupt service routines.
Header file included by main.c which contains all
registers.h memory-mapped registers which can be accessed in the C
language.
cvectors.asm Assembly file which generates the C2xx vectors including the
reset, and serial transmit and receive vectors.
c203.cmd Linker command file describing memory map and sections for
the C203.
uart2xx.doc This document (in Microsoft Word format).
uart2xx.htm This document (in HTML format).
uart2xx.txt This document (in plain text format).
uart2xx.out Executable file for sample C program to be loaded by C2xx
simulator or hardware.
build.bat Batch file for building uart2xx.out using only the Texas
Instruments toolset.
rts2xx.lib Runtime support library.
Usage
Just load serial.out into the debugger and then run it. Next, run a generic
terminal program such as Hyperterminal (included in Windows 95) and connect
the PC serial port to the serial port on the C2xx. Make sure to set the
baud rate to 9600 baud if running at 20 Mhz, or 19200 baud if running at 40
Mhz. If the device is functioning properly, you will see "c203 UART is
fine!" being transmitted repeatedly.
Modification
The baud rate and clock rate may be changed in the #define statements of
main.c. To build, just type build.bat from a DOS prompt. Or if using the
GODSP Code Composer development system, create a project with the following
files: rts2xx.lib, main.c, cvectors.asm, c203.cmd, and registers.h. Then
build as usual.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -