📄 uart.lst
字号:
C51 COMPILER V7.08 UART 12/11/2005 15:43:15 PAGE 1
C51 COMPILER V7.08, COMPILATION OF MODULE UART
OBJECT MODULE PLACED IN uart.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE uart.c BROWSE DEBUG OBJECTEXTEND
line level source
1 /*= uart.c =========================================================================================
2 *
3 * Copyright (C) 2004 Nordic Semiconductor
4 *
5 * This file is distributed in the hope that it will be useful, but WITHOUT WARRANTY OF ANY KIND.
6 *
7 * Author(s): Ole Saether
8 *
9 * COMPILER:
10 *
11 * This program has been tested with Keil C51 V7.08 and 7.09
12 *
13 * $Revision: 3 $
14 *
15 *==================================================================================================
16 */
17 #include "reg9e5.h"
18 #include "uart.h"
19 unsigned char Buf_1[5],Counter,NewData;
20 void InitUart(void)
21 {
22 1 TH1 = 230; //9600 @16MHz (when T1M=1 and SMOD=1)
23 1 // TH1 = 243; // 19200@16MHz (when T1M=1 and SMOD=1)
24 1 // TH1 = 247; // 28800 16MHz (when T1M=1 and SMOD=1)
25 1 CKCON |= 0x10; // T1M=1 (/4 timer clock)
26 1 PCON = 0x80; // SMOD=1 (double baud rate)
27 1 SCON = 0x52; // Serial mode1, enable receiver
28 1 TMOD &= ~0x30;
29 1 TMOD |= 0x20; // Timer1 8bit auto reload
30 1 TR1 = 1; // Start timer1
31 1 P0_ALT |= 0x06; // Select alternate functions on pins P0.1 and P0.2
32 1 P0_DIR |= 0x02; // P0.1 (RxD) is input
33 1 ES = 0;
34 1 }
35
36
37
38 void sPutChar(char c)
39 {
40 1 TI = 0;
41 1 SBUF = c;
42 1 while(!TI)
43 1 ;
44 1 }
45
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 37 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 7 ----
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
C51 COMPILER V7.08 UART 12/11/2005 15:43:15 PAGE 2
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -