文件名称:RS-232
- 所属分类:
- 单片机(51,AVR,MSP430等)
- 资源属性:
- [Text]
- 上传时间:
- 2012-11-26
- 文件大小:
- 2kb
- 下载次数:
- 0次
- 提 供 者:
- zhong*****
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
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