文件名称:RS-232
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:2.51kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
void UART_init()
{
//初始化串行口和波特率发生器
SCON =0x58 //选择串口工作方式,打开接收允许
TMOD =0x21 //定时器1工作在方式2,定时器0工作在方式1
TH1 =0xfd //实现波特率9600(系统时钟11.0592MHZ)
TR1 =1 //启动定时器T1
ET1 =0
ES=1 //允许串行口中断
PS=1 //设计串行口中断优先级
EA =1 //单片机中断允许
}-void UART_init (){// to initialize the serial port and baud rate generator SCON = 0x58// Select the serial work, open the receiver to allow TMOD = 0x21// Timer 1 in Mode 2, Timer 0 work in a manner 1TH1 = 0xfd// to achieve 9600 baud rate (system clock 11.0592MHZ) TR1 = 1// start the timer T1ET1 = 0 ES = 1// allow the serial port interrupt PS = 1// Design of Serial Port Interrupt Priority class EA = 1// Single-chip Interrupt Enable)
{
//初始化串行口和波特率发生器
SCON =0x58 //选择串口工作方式,打开接收允许
TMOD =0x21 //定时器1工作在方式2,定时器0工作在方式1
TH1 =0xfd //实现波特率9600(系统时钟11.0592MHZ)
TR1 =1 //启动定时器T1
ET1 =0
ES=1 //允许串行口中断
PS=1 //设计串行口中断优先级
EA =1 //单片机中断允许
}-void UART_init (){// to initialize the serial port and baud rate generator SCON = 0x58// Select the serial work, open the receiver to allow TMOD = 0x21// Timer 1 in Mode 2, Timer 0 work in a manner 1TH1 = 0xfd// to achieve 9600 baud rate (system clock 11.0592MHZ) TR1 = 1// start the timer T1ET1 = 0 ES = 1// allow the serial port interrupt PS = 1// Design of Serial Port Interrupt Priority class EA = 1// Single-chip Interrupt Enable)
(系统自动生成,下载前可以参看下载内容)
下载文件列表
RS-232.txt
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.