⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 uart0demo.lst

📁 LPC2142 的Arm_Uart0_Demo_R程序
💻 LST
字号:
ARM COMPILER V2.53,  Uart0Demo                                                             09/08/06  14:11:10  PAGE 1   


ARM COMPILER V2.53, COMPILATION OF MODULE Uart0Demo
OBJECT MODULE PLACED IN .\Obj\Uart0Demo.obj
COMPILER INVOKED BY: C:\Keil\ARM\BIN\CA.exe Uart0Demo.c THUMB BROWSE DEBUG PRINT(.\LST\UART0DEMO.LST) TABS(4) OBJECT(.\O
                    -bj\Uart0Demo.obj) 

stmt  level    source

    1          /*============================================================
    2          LPC214X 串口功能演示
    3          作者: Mingtree  ycxms88@163.com   http://www.mcu123.com
    4          ==============================================================
    5          
    6          本例程的CCLK=60M.
    7          晶振采用12M
    8          倍频系数为:5
    9          分频系数为:2
   10          以上设置在Startup.s中设置
   11          */
   12          
   13          #include <LPC214X.H>
   14          #include <Uart0.H>
   15          #include <Config.H>
   16          
   17          
   18          #define UART_BAUD(baud) (unsigned  int)((FOSC*PLL_M) / (baud * 16))
   19          
   20          
   21          
   22          
   23           void Init_Uart0(unsigned int Baud)
   24           {
   25   1         /* initialize the serial interface   */
   26   1        PINSEL0 = 0x00000005;           /* Enable RxD0 and TxD0                     */
   27   1        U0LCR = 0x83;                   /* 8 bits, no Parity, 1 Stop bit            */
   28   1        U0DLM=(unsigned char)(Baud>>8);
   29   1        U0DLL = (unsigned char)Baud;                     
   30   1        
   31   1        U0LCR = 0x03;                   /* DLAB = 0     */
   32   1       }
   33          
   34          void delay (unsigned int i) {                        /* Delay function */
   35   1      unsigned int n;
   36   1      while(i>1)
   37   1      {
   38   2          for(n=65535;n>1;n--);
   39   2          i--;
   40   2      }
   41   1      }
   42          
   43           void main(void)
   44           {
   45   1      
   46   1       AD0CR   = 0x00200402;                        /* Setup A/D: 10-bit AIN0 @ 3MHz */
   47   1       PINSEL1 = 0x01000000;                        /* enable DAC */
   48   1      
   49   1       Init_Uart0(UART_BAUD(115200));
   50   1      
   51   1       while(1)
   52   1       {
   53   2       Sent_Str("www.mcu123.com \n") ;
   54   2       delay(200);
   55   2       }
   56   1       }
ARM COMPILER V2.53,  Uart0Demo                                                             09/08/06  14:11:10  PAGE 2   

ASSEMBLY LISTING OF GENERATED OBJECT CODE



*** EXTERNALS:
 EXTERN CODE16 (Sent_Str?T)
 EXTERN NUMBER (__startup)



*** PUBLICS:
 PUBLIC         Init_Uart0?T
 PUBLIC         delay?T
 PUBLIC         main



*** DATA SEGMENT '?CON?Uart0Demo':
 00000000          ??S_1:
 00000000            DB          'www.mcu123.com ',0x0A,0x00

*** CODE SEGMENT '?PR?Init_Uart0?T?Uart0Demo':
   23:  void Init_Uart0(unsigned int Baud)
 00000000  ---- Variable 'Baud' assigned to Register 'R0' ----
   26:   PINSEL0 = 0x00000005;           /* Enable RxD0 and TxD0                     */
 00000000  2205      MOV         R2,#0x5
 00000002  4800      LDR         R1,=0xE002C000
 00000004  600A      STR         R2,[R1,#0x0]
   27:   U0LCR = 0x83;                   /* 8 bits, no Parity, 1 Stop bit            */
 00000006  2283      MOV         R2,#0x83
 00000008  4800      LDR         R1,=0xE000C00C
 0000000A  700A      STRB        R2,[R1,#0x0]
   28:   U0DLM=(unsigned char)(Baud>>8);
 0000000C  1C02      MOV         R2,R0 ; Baud
 0000000E  0A12      LSR         R2,R2,#0x8 ; Baud
 00000010  0612      LSL         R2,R2,#0x18
 00000012  0E12      LSR         R2,R2,#0x18
 00000014  4800      LDR         R1,=0xE000C004
 00000016  700A      STRB        R2,[R1,#0x0]
   29:   U0DLL = (unsigned char)Baud;                     
 00000018  1C01      MOV         R1,R0 ; Baud
 0000001A  0609      LSL         R1,R1,#0x18 ; Baud
 0000001C  0E09      LSR         R1,R1,#0x18
 0000001E  4800      LDR         R0,=0xE000C000
 00000020  7001      STRB        R1,[R0,#0x0]
   31:   U0LCR = 0x03;                   /* DLAB = 0     */
 00000022  2103      MOV         R1,#0x3
 00000024  4800      LDR         R0,=0xE000C00C
 00000026  7001      STRB        R1,[R0,#0x0]
   32:  }
 00000028  4770      BX          R14
 0000002A          ENDP ; 'Init_Uart0?T'


*** CODE SEGMENT '?PR?delay?T?Uart0Demo':
   34: void delay (unsigned int i) {                        /* Delay function */
 00000000  ---- Variable 'i' assigned to Register 'R0' ----
 00000000            ; SCOPE-START
   36: while(i>1)
 00000000  E005      B           L_1  ; T=0x0000000E
   38:     for(n=65535;n>1;n--);
 00000002          L_9:
 00000002  4800      LDR         R1,=0xFFFF
 00000004  ---- Variable 'n' assigned to Register 'R1' ----
 00000004          L_5:
 00000004  3901      SUB         R1,#0x1
 00000006  1C0A      MOV         R2,R1 ; n
 00000008  2A01      CMP         R2,#0x1 ; n
 0000000A  D8FB      BHI         L_5  ; T=0x00000004
   39:     i--;
 0000000C  3801      SUB         R0,#0x1
   40: }
 0000000E          L_1:
 0000000E  1C01      MOV         R1,R0 ; i
ARM COMPILER V2.53,  Uart0Demo                                                             09/08/06  14:11:10  PAGE 3   

 00000010  2901      CMP         R1,#0x1 ; i
 00000012  D8F6      BHI         L_9  ; T=0x00000002
 00000014            ; SCOPE-END
   41: }
 00000014  4770      BX          R14
 00000016          ENDP ; 'delay?T'


*** CODE SEGMENT '?PR?main?Uart0Demo':
   43:  void main(void)
 00000000  B500      PUSH        {LR}
   46:  AD0CR   = 0x00200402;                        /* Setup A/D: 10-bit AIN0 @ 3MHz */
 00000002  4800      LDR         R1,=0x200402
 00000004  4800      LDR         R0,=0xE0034000
 00000006  6001      STR         R1,[R0,#0x0]
   47:  PINSEL1 = 0x01000000;                        /* enable DAC */
 00000008  4800      LDR         R1,=0x1000000
 0000000A  4800      LDR         R0,=0xE002C004
 0000000C  6001      STR         R1,[R0,#0x0]
   49:  Init_Uart0(UART_BAUD(115200));
 0000000E  2020      MOV         R0,#0x20
 00000010  F7FF      BL          Init_Uart0?T  ; T=0x0001  (1)
 00000012  FFF6      BL          Init_Uart0?T  ; T=0x0001  (2)
   51:  while(1)
 00000014          L_12:
   53:  Sent_Str("www.mcu123.com \n") ;
 00000014  4800      LDR         R0,=??S_1 ; ??S_1
 00000016  F7FF      BL          Sent_Str?T  ; T=0x0001  (1)
 00000018  FFF3      BL          Sent_Str?T  ; T=0x0001  (2)
   54:  delay(200);
 0000001A  20C8      MOV         R0,#0xC8
 0000001C  F7FF      BL          delay?T  ; T=0x0001  (1)
 0000001E  FFF0      BL          delay?T  ; T=0x0001  (2)
   55:  }
 00000020  E7F8      B           L_12  ; T=0x00000014
 00000022  BC08      POP         {R3}
 00000024  4718      BX          R3
 00000026          ENDP ; 'main'



Module Information          Static
----------------------------------
  code size            =    ------
  data size            =    ------
  const size           =        17
End of Module Information.


ARM COMPILATION COMPLETE.  0 WARNING(S),  0 ERROR(S)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -