?? main.lst
字號:
ARM COMPILER V2.00f, main 20/02/05 10:41:19 PAGE 1
ARM COMPILER V2.00f, COMPILATION OF MODULE main
OBJECT MODULE PLACED IN main.OBJ
COMPILER INVOKED BY: C:\Keil\ARM\BIN\CA.exe main.c THUMB OPTIMIZE(7,SPEED) BROWSE DEBUG TABS(4)
stmt level source
1 /************************************************************/
2 /* PROJECT NAME: Thumb */
3 /* Project: LPC2100 Training course */
4 /* Engineer: T Martin tmartin@hitex.co.uk */
5 /* Filename: main.c */
6 /* Language: C */
7 /* Compiler: Keil ARM V2.00b */
8 /* Assembler: */
9 /* */
10 /************************************************************/
11 /* COPYRIGHT: Hitex UK Ltd 2005 */
12 /* LICENSE: THIS VERSION CREATED FOR FREE DISTRIBUTION */
13 /************************************************************/
14 /* Function: */
15 /* */
16 /* */
17 /* */
18 /* Demonstrates edge capture with Timer 0 */
19 /* */
20 /* Oscillator frequency 12.000 Mhz */
21 /* Target board Keil MCB2100 */
22 /************************************************************/
23
24 #include <LPC21xx.H>
25
26 void T0isr(void) __irq;
27
28
29 int main(void)
30 {
31 1 VPBDIV = 0x00000002; //Set pclk to 30 Mhz
32 1 PINSEL0 = 0x00000020; //Enable pin 0.2 as capture channel0
33 1 T0PR = 0x0000001E; //Load prescaler for 1 Msec tick
34 1 T0TCR = 0x00000002; //Reset counter and prescaler
35 1 T0CCR = 0x00000005; //Capture on rising edge of channel0
36 1 T0TCR = 0x00000001; //enable timer
37 1
38 1 VICVectAddr4 = (unsigned)T0isr; //Set the timer ISR vector address
39 1 VICVectCntl4 = 0x00000024; //Set channel
40 1 VICIntEnable = 0x00000010; //Enable the interrupt
41 1
42 1 while(1)
43 1 {
44 2 ;
45 2 }
46 1 }
47
48
49 void T0isr (void) __irq
50 {
51 1 static int value;
52 1 value = T0CR0; // read the capture value
53 1 T0IR |= 0x00000001; //Clear match 0 interrupt
54 1 VICVectAddr = 0x00000000; //Dummy write to signal end of interrupt
55 1
56 1 }
57
58
ARM COMPILER V2.00f, main 20/02/05 10:41:19 PAGE 2
ASSEMBLY LISTING OF GENERATED OBJECT CODE
*** EXTERNALS:
EXTERN NUMBER (__startup)
*** PUBLICS:
PUBLIC T0isr?A
PUBLIC main
*** DATA SEGMENT '?DT0?main':
00000000 value:
00000000 DS 4
*** CODE SEGMENT '?PR?main?main':
29: int main(void)
00000000 B500 PUSH {LR}
31: VPBDIV = 0x00000002; //Set pclk to 30 Mhz
00000002 2102 MOV R1,#0x2
00000004 4800 LDR R0,=0xE01FC100
00000006 7001 STRB R1,[R0,#0x0]
32: PINSEL0 = 0x00000020; //Enable pin 0.2 as capture channel0
00000008 2120 MOV R1,#0x20
0000000A 4800 LDR R0,=0xE002C000
0000000C 6001 STR R1,[R0,#0x0]
33: T0PR = 0x0000001E; //Load prescaler for 1 Msec tick
0000000E 211E MOV R1,#0x1E
00000010 4800 LDR R0,=0xE000400C
00000012 6001 STR R1,[R0,#0x0]
34: T0TCR = 0x00000002; //Reset counter and prescaler
00000014 2102 MOV R1,#0x2
00000016 4800 LDR R0,=0xE0004004
00000018 6001 STR R1,[R0,#0x0]
35: T0CCR = 0x00000005; //Capture on rising edge of channel0
0000001A 2105 MOV R1,#0x5
0000001C 4800 LDR R0,=0xE0004028
0000001E 6001 STR R1,[R0,#0x0]
36: T0TCR = 0x00000001; //enable timer
00000020 2101 MOV R1,#0x1
00000022 4800 LDR R0,=0xE0004004
00000024 6001 STR R1,[R0,#0x0]
38: VICVectAddr4 = (unsigned)T0isr; //Set the timer ISR vector address
00000026 4900 LDR R1,=T0isr?A ; T0isr?A
00000028 4800 LDR R0,=0xFFFFF110
0000002A 6001 STR R1,[R0,#0x0]
39: VICVectCntl4 = 0x00000024; //Set channel
0000002C 2124 MOV R1,#0x24
0000002E 4800 LDR R0,=0xFFFFF210
00000030 6001 STR R1,[R0,#0x0]
40: VICIntEnable = 0x00000010; //Enable the interrupt
00000032 2110 MOV R1,#0x10
00000034 4800 LDR R0,=0xFFFFF010
00000036 6001 STR R1,[R0,#0x0]
45: }
00000038 L_1:
00000038 E7FE B L_1 ; T=0x00000038
0000003A BC08 POP {R3}
0000003C 4718 BX R3
0000003E ENDP ; 'main'
*** CODE SEGMENT '?PR?T0isr?A?main':
49: void T0isr (void) __irq
00000000 E92D0003 STMDB R13!,{R0-R1}
52: value = T0CR0; // read the capture value
00000004 E5100000 LDR R0,=0xE000402C
00000008 E5901000 LDR R1,[R0,#0x0]
0000000C E5100000 LDR R0,=value ; value
ARM COMPILER V2.00f, main 20/02/05 10:41:19 PAGE 3
00000010 E5801000 STR R1,[R0,#0x0] ; value
53: T0IR |= 0x00000001; //Clear match 0 interrupt
00000014 E5100000 LDR R0,=0xE0004000
00000018 E5901000 LDR R1,[R0,#0x0]
0000001C E3811001 ORR R1,R1,#0x0001
00000020 E5801000 STR R1,[R0,#0x0]
54: VICVectAddr = 0x00000000; //Dummy write to signal end of interrupt
00000024 E3A01000 MOV R1,#0x0
00000028 E5100000 LDR R0,=0xFFFFF030
0000002C E5801000 STR R1,[R0,#0x0]
56: }
00000030 E8BD0003 LDMIA R13!,{R0-R1}
00000034 E25EF004 SUBS R15,R14,#0x0004
00000038 ENDP ; 'T0isr?A'
Module Information Static
----------------------------------
code size = ------
data size = 4
const size = ------
End of Module Information.
ARM COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -