📄 pc_io_t1.lst
字号:
C51 COMPILER V7.07 PC_IO_T1 06/12/2006 21:12:15 PAGE 1
C51 COMPILER V7.07, COMPILATION OF MODULE PC_IO_T1
OBJECT MODULE PLACED IN PC_IO_T1.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE PC_IO_T1.c OPTIMIZE(6,SIZE) BROWSE DEBUG OBJECTEXTEND
stmt level source
1 /*------------------------------------------------------------------*-
2 PC_IO_T1.C (v1.00)
3 PC link library. Bidirectional. T1 used for baud rate generation.
4 Uses the UART, and Pins 3.1 (Tx) and 3.0 (Rx)
5 -*------------------------------------------------------------------*/
6
7 #include "Main.h"
8 #include "PC_IO_T1.h"
9 extern tByte In_read_index_G;
10 extern tByte In_waiting_index_G;
11 extern tByte Out_written_index_G;
12 extern tByte Out_waiting_index_G;
13
14 /* This (generic) version uses T1 for baud rate generation. */
15
16 void PC_LINK_IO_Init_T1(const tWord BAUD_RATE)
17 {
18 1 PCON &= 0x7F; // Set SMOD bit to 0 (don't double baud rates)
19 1 // Receiver enabled.
20 1 // 8-bit data, 1 start bit, 1 stop bit,
21 1 // Variable baud rate (asynchronous)
22 1 // Receive flag will only be set if a valid stop bit is received
23 1 // Set TI (transmit buffer is empty)
24 1 SCON = 0x72;
25 1 TMOD |= 0x20; // T1 in mode 2, 8-bit auto reload
26 1 TH1 = (256 - (tByte)((((tLong)OSC_FREQ / 100) * 3125)
27 1 / ((tLong) BAUD_RATE * OSC_PER_INST * 1000)));
28 1 TL1 = TH1;
29 1 TR1 = 1; // Run the timer
30 1 TI = 1; // Send first character (dummy)
31 1
32 1 // Set up the buffers for reading and writing
33 1 In_read_index_G = 0;
34 1 In_waiting_index_G = 0;
35 1 Out_written_index_G = 0;
36 1 Out_waiting_index_G = 0;
37 1 // Interrupt *NOT* enabled
38 1 ES = 0;
39 1 }
40
41
42
43
44
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 64 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = ---- ----
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILER V7.07 PC_IO_T1 06/12/2006 21:12:15 PAGE 2
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -