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