?? cpu.lst
字號:
C51 COMPILER V8.02 CPU 10/19/2008 17:05:12 PAGE 1
C51 COMPILER V8.02, COMPILATION OF MODULE CPU
OBJECT MODULE PLACED IN .\CPU.obj
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE ..\CPU\CPU.c LARGE BROWSE DEBUG OBJECTEXTEND PRINT(.\CPU.lst) OBJECT(.\CPU.
-obj)
line level source
1 /********************************************************************************/
2 /* filename : CPU.h */
3 /* created : xillinx */
4 /* descript : 選擇CPU的類型 */
5 /********************************************************************************/
6 #include "../CPU/CPU.h"
7 #include "../CFG/CFG.h"
8 #include "../UART/UART.h"
9
10 extern unsigned int system_timer;
11 unsigned char data CPU_soft_timer_lo=0x0;
12 unsigned char data CPU_soft_timer_hi=0x0;
13
14 /********************************************************************************/
15 /* 地址定義表,由7412138譯碼,最高位必須為1<G引腳>,其余3位組合 */
16 /* +-----+-----+-----+-----+ */
17 /* | A15 | A14 | A13 | A12 | */
18 /* +-----+-----+-----+-----+ */
19 /* | 1 | 0 | 0 | 0 | 0x8000 */
20 /* +-----+-----+-----+-----+ */
21 /* | 1 | 0 | 0 | 1 | 0x9000 */
22 /* +-----+-----+-----+-----+ */
23 /* | 1 | 0 | 1 | 0 | 0xA000 */
24 /* +-----+-----+-----+-----+ */
25 /* | 1 | 0 | 1 | 1 | 0xB000 */
26 /* +-----+-----+-----+-----+ */
27 /* | 1 | 1 | 0 | 0 | 0xC000 */
28 /* +-----+-----+-----+-----+ */
29 /* | 1 | 1 | 0 | 1 | 0xD000 */
30 /* +-----+-----+-----+-----+ */
31 /* | 1 | 1 | 1 | 0 | 0xE000 */
32 /* +-----+-----+-----+-----+ */
33 /* | 1 | 1 | 1 | 1 | 0xF000 */
34 /* +-----+-----+-----+-----+ */
35 /********************************************************************************/
36 unsigned char volatile xdata c51_hc138_cs1[0x1000] _at_ 0x8000;
37 unsigned char volatile xdata c51_hc138_cs2[0x1000] _at_ 0x9000;
38 unsigned char volatile xdata c51_hc138_cs_io2[0x1000] _at_ 0xA000;
39 unsigned char volatile xdata c51_hc138_cs_lcd1[0x1000] _at_ 0xB000;
40 unsigned char volatile xdata c51_hc138_cs_lcd2[0x1000] _at_ 0xC000;
41 unsigned char volatile xdata c51_hc138_cs_keyr[0x1000] _at_ 0xD000;
42 unsigned char volatile xdata c51_hc138_cs_keyw[0x1000] _at_ 0xE000;
43 unsigned char volatile xdata c51_hc138_cs_mt[0x1000] _at_ 0xF000;
44
45 unsigned char volatile c51_U07_latch; //* U7數據寄存器
46 unsigned char volatile c51_U19_latch; //* CS-IO2寄存器
47
48 cpu_interrupt_function CPU_001_tick_process;
49 cpu_interrupt_function CPU_002_tick_process;
50 cpu_interrupt_function CPU_004_tick_process;
51 cpu_interrupt_function CPU_008_tick_process;
52 cpu_interrupt_function CPU_010_tick_process;
53 cpu_interrupt_function CPU_020_tick_process;
54 cpu_interrupt_function CPU_040_tick_process;
C51 COMPILER V8.02 CPU 10/19/2008 17:05:12 PAGE 2
55 cpu_interrupt_function CPU_080_tick_process;
56 cpu_interrupt_function CPU_100_tick_process;
57 cpu_interrupt_function CPU_200_tick_process;
58 cpu_interrupt_function CPU_400_tick_process;
59 cpu_interrupt_function CPU_extern_0_process;
60 cpu_interrupt_function CPU_extern_1_process;
61 cpu_interrupt_function CPU_timer_02_process;
62
63 /********************************************************************************/
64 /* fun_name : CPU_interrupt_proc_null() */
65 /* version : v1.00 */
66 /* created : xillinx */
67 /* 這個函數是中斷的缺省函數,什么也不做 */
68 /********************************************************************************/
69 void CPU_interrupt_proc_null(void)
70 { ;
71 1 }
72
73
74 /********************************************************************************/
75 /* system interrupt dispatch */
76 /* <0> <0003> INT_Extern_0 <==> HT9302D Recv dial number CLK INT */
77 /* <1> <000B> INT_Timer_0 <==> For system time */
78 /* <2> <0013> INT_Extern_1 <==> USB interrupt */
79 /* <3> <001B> INT_Timer_1 <==> Not used */
80 /* <4> <0023> INT_Serial <==> Sery interrupt */
81 /* <5> <002B> INT_Timer_2 <==> Not used */
82 /* <6> <0033> INT_Extern_2 <==> For codec chip read and write interrupt */
83 /* <7> <003B> INT_Extern_3 <==> Not used */
84 /********************************************************************************/
85
86 /********************************************************************************/
87 /* fun_name : CPU_uart_serial_initial() */
88 /* descript : 2'(SMOD) X Fosc */
89 /* load_val = 256 - ----------------- */
90 /* baud X 32 X 12 */
91 /* version : v1.00 */
92 /* created : xillinx */
93 /********************************************************************************/
94 void CPU_uart_serial_initial(void)
95 { PCON = 0x80; //* double baud
96 1 SCON = 0x50; //* SCON: mode 1, 8-bit UART, enable RECV
97 1 TMOD &= 0x0F;
98 1 TMOD |= 0x20; //* TMOD: timer 1, mode 2, 8-bit reload
99 1 TH1 = 0xFE; //* TH1: reload value for 115200 baud @ 44.2368MHz(22.1184Mx2)
100 1 TR1 = 1; //* TR1: timer 1 run
101 1 }
102
103 /********************************************************************************/
104 /* fun_name : CPU_timer_0_load_init_value() */
105 /* version : v1.00 */
106 /* created : xillinx */
107 /* descript : load value<==>65536-(oscxtime(s))/12=65536-44236800 x 0.002/12 */
108 /* 2MS定時器 */
109 /********************************************************************************/
110 void CPU_timer_0_load_init_value(void)
111 { TR0=0x00;
112 1 TH0=0xE3;
113 1 TL0=0x34;
114 1 TR0=0x01;
115 1 }
116
C51 COMPILER V8.02 CPU 10/19/2008 17:05:12 PAGE 3
117 /********************************************************************************/
118 /* fun_name : CPU_timer_0_initialize() */
119 /* version : v1.00 */
120 /* created : xillinx */
121 /* descript : clled by main intilize */
122 /********************************************************************************/
123 void CPU_timer_0_initialize(void)
124 { TMOD &= 0xF0; //* TMOD: timer 0, mode 1, 16-bit
125 1 TMOD |= 0x01; //* counter Fosc/12
126 1 CPU_timer_0_load_init_value(); //* TR0: timer 0 run
127 1 }
128
129 /********************************************************************************/
130 /* fun_name : CPU_timer_0_interrupt() */
131 /* version : v1.00 */
132 /* created : xillinx */
133 /********************************************************************************/
134 void CPU_timer_0_interrupt(void) interrupt 1
135 { CPU_timer_0_load_init_value(); //* TR0: timer 0 run
136 1 CPU_timer_interrupt();
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -