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

📄 main.lst

📁 ADC Demo Source for LPC214X. 这是214X的ADC的应用例程
💻 LST
📖 第 1 页 / 共 5 页
字号:
 00000024  4800      LDR         R2,=0x1000000
 00000026  4800      LDR         R0,=0xE0034000
 00000028  6801      LDR         R1,[R0,#0x0]
 0000002A  4311      ORR         R1,R2
 0000002C  6001      STR         R1,[R0,#0x0]
   93:   while ((AD0DR & 0x80000000) == 0);    // 等待转换结束
 0000002E          L_6:
 0000002E  4800      LDR         R0,=0xE0034004
 00000030  6800      LDR         R0,[R0,#0x0]
 00000032  4800      LDR         R1,=0x80000000
 00000034  4208      TST         R0,R1
 00000036  D0FA      BEQ         L_6  ; T=0x0000002E
   94:   AD0CR |= 1 << 24;                 // 再次启动转换
 00000038  4800      LDR         R2,=0x1000000
 0000003A  4800      LDR         R0,=0xE0034000
 0000003C  6801      LDR         R1,[R0,#0x0]
 0000003E  4311      ORR         R1,R2
 00000040  6001      STR         R1,[R0,#0x0]
   96:   while ((AD0DR & 0x80000000) == 0);    // 等待转换结束
 00000042          L_10:
 00000042  4800      LDR         R0,=0xE0034004
 00000044  6800      LDR         R0,[R0,#0x0]
 00000046  4800      LDR         R1,=0x80000000
 00000048  4208      TST         R0,R1
 0000004A  D0FA      BEQ         L_10  ; T=0x00000042
   97:   ADC_Data = AD0DR;                 // 读取ADC结果
 0000004C  4800      LDR         R0,=0xE0034004
 0000004E  6801      LDR         R1,[R0,#0x0]
 00000050  ---- Variable 'ADC_Data' assigned to Register 'R1' ----
   98:   ADC_Data = (ADC_Data >> 6) & 0x3ff;
 00000050  0989      LSR         R1,R1,#0x6 ; ADC_Data
 00000052  4800      LDR         R0,=0x3FF
 00000054  4001      AND         R1,R0
   99:   ADC_Data = ADC_Data * 2480;           // 参考电压经过3/4分压
 00000056  4800      LDR         R0,=0x9B0
 00000058  4341      MUL         R1,R0
  100:   ADC_Data = ADC_Data / 1024;
 0000005A  0A89      LSR         R1,R1,#0xA ; ADC_Data
  101:   return ADC_Data;
 0000005C  1C08      MOV         R0,R1 ; ADC_Data
 0000005E            ; SCOPE-END
  102: }
 0000005E  BC08      POP         {R3}
 00000060  4718      BX          R3
 00000062          ENDP ; 'GetAdcVal?T'


*** CODE SEGMENT '?PR?LcdClearBuffer?T?main':
  104: void LcdClearBuffer(void)//清除屏幕
 00000000  B410      PUSH        {R4}
  105: {
 00000002            ; SCOPE-START
  107:   for (i = 0;i < 4;i ++) {
 00000002  2000      MOV         R0,#0x0
 00000004  ---- Variable 'i' assigned to Register 'R0' ----
 00000004  E01E      B           L_17  ; T=0x00000044
  108:     for (j = 0;j < 16; j ++) {
 00000006          L_24:
 00000006  2100      MOV         R1,#0x0
 00000008  ---- Variable 'j' assigned to Register 'R1' ----
 00000008  E00E      B           L_22  ; T=0x00000028
 0000000A          L_23:
  109:       LcdBuffers.LcdBuff[i][j] = ' ';
 0000000A  2220      MOV         R2,#0x20
 0000000C  1C03      MOV         R3,R0 ; i
 0000000E  061C      LSL         R4,R3,#0x18 ; i
 00000010  0E24      LSR         R4,R4,#0x18
ARM COMPILER V2.42,  main                                                                  19/01/06  08:10:09  PAGE 15  

 00000012  2311      MOV         R3,#0x11
 00000014  435C      MUL         R4,R3
 00000016  1C0B      MOV         R3,R1 ; j
 00000018  061B      LSL         R3,R3,#0x18 ; j
 0000001A  0E1B      LSR         R3,R3,#0x18
 0000001C  18E4      ADD         R4,R3
 0000001E  4800      LDR         R3,=LcdBuffers ; LcdBuffers
 00000020  551A      STRB        R2,[R3,R4]
  110:     }
 00000022  3101      ADD         R1,#0x1
 00000024  0609      LSL         R1,R1,#0x18
 00000026  0E09      LSR         R1,R1,#0x18
 00000028          L_22:
 00000028  1C0A      MOV         R2,R1 ; j
 0000002A  0612      LSL         R2,R2,#0x18 ; j
 0000002C  0E12      LSR         R2,R2,#0x18
 0000002E  2A10      CMP         R2,#0x10
 00000030  DBEB      BLT         L_23  ; T=0x0000000A
  111:     LcdBuffers.LcdBuffWrFlag[i] = 0;
 00000032  2100      MOV         R1,#0x0
 00000034  1C02      MOV         R2,R0 ; i
 00000036  0613      LSL         R3,R2,#0x18 ; i
 00000038  0E1B      LSR         R3,R3,#0x18
 0000003A  4800      LDR         R2,=LcdBuffers + 0x44 ; LcdBuffers+68
 0000003C  54D1      STRB        R1,[R2,R3]
  112:   }
 0000003E  3001      ADD         R0,#0x1
 00000040  0600      LSL         R0,R0,#0x18
 00000042  0E00      LSR         R0,R0,#0x18
 00000044          L_17:
 00000044  1C01      MOV         R1,R0 ; i
 00000046  0609      LSL         R1,R1,#0x18 ; i
 00000048  0E09      LSR         R1,R1,#0x18
 0000004A  2904      CMP         R1,#0x4
 0000004C  DBDB      BLT         L_24  ; T=0x00000006
 0000004E            ; SCOPE-END
  113: }
 0000004E  BC10      POP         {R4}
 00000050  4770      BX          R14
 00000052          ENDP ; 'LcdClearBuffer?T'


*** CODE SEGMENT '?PR?LcdInit?T?main':
  117: void LcdInit(void) {
 00000000  B500      PUSH        {LR}
  119:   SSP_Init();
 00000002  F7FF      BL          SSP_Init?T  ; T=0x0001  (1)
 00000004  FFFD      BL          SSP_Init?T  ; T=0x0001  (2)
  127:   os_dly_wait (5);//延时100mS
 00000006  2005      MOV         R0,#0x5
 00000008  F7FF      BL          os_dly_wait?T  ; T=0x0001  (1)
 0000000A  FFFA      BL          os_dly_wait?T  ; T=0x0001  (2)
  129:   LcdClearBuffer();
 0000000C  F7FF      BL          LcdClearBuffer?T  ; T=0x0001  (1)
 0000000E  FFF8      BL          LcdClearBuffer?T  ; T=0x0001  (2)
  130:   LcdSendCommand(0x20);//发送4位控制命令
 00000010  2020      MOV         R0,#0x20
 00000012  F7FF      BL          LcdSendCommand?T  ; T=0x0001  (1)
 00000014  FFF5      BL          LcdSendCommand?T  ; T=0x0001  (2)
  131:   LcdSendCommand(0x02);//发送位址归位命令,设定DDRAM位址计数器为0
 00000016  2002      MOV         R0,#0x2
 00000018  F7FF      BL          LcdSendCommand?T  ; T=0x0001  (1)
 0000001A  FFF2      BL          LcdSendCommand?T  ; T=0x0001  (2)
  132:   LcdSendCommand(0x0c);//发送开显示关光标命令
 0000001C  200C      MOV         R0,#0xC
 0000001E  F7FF      BL          LcdSendCommand?T  ; T=0x0001  (1)
 00000020  FFEF      BL          LcdSendCommand?T  ; T=0x0001  (2)
  133:   LcdSendCommand(0x04);//发送进入点命令
ARM COMPILER V2.42,  main                                                                  19/01/06  08:10:09  PAGE 16  

 00000022  2004      MOV         R0,#0x4
 00000024  F7FF      BL          LcdSendCommand?T  ; T=0x0001  (1)
 00000026  FFEC      BL          LcdSendCommand?T  ; T=0x0001  (2)
  134:   LcdSendCommand(0x01);//发送清除显示命令
 00000028  2001      MOV         R0,#0x1
 0000002A  F7FF      BL          LcdSendCommand?T  ; T=0x0001  (1)
 0000002C  FFE9      BL          LcdSendCommand?T  ; T=0x0001  (2)
  135:   LcdSendCommand(0x80);//发送设定DDRAM地址0x00命令
 0000002E  2080      MOV         R0,#0x80
 00000030  F7FF      BL          LcdSendCommand?T  ; T=0x0001  (1)
 00000032  FFE6      BL          LcdSendCommand?T  ; T=0x0001  (2)
  141:   SetLcdDisplayPos(2, 0);//汉字定位到上行左端
 00000034  2002      MOV         R0,#0x2
 00000036  2100      MOV         R1,#0x0
 00000038  F7FF      BL          SetLcdDisplayPos?T  ; T=0x0001  (1)
 0000003A  FFE2      BL          SetLcdDisplayPos?T  ; T=0x0001  (2)
  142:   LcdDisplayString("汉字显示演示56");
 0000003C  4800      LDR         R0,=??S_1 ; ??S_1
 0000003E  F7FF      BL          LcdDisplayString?T  ; T=0x0001  (1)
 00000040  FFDF      BL          LcdDisplayString?T  ; T=0x0001  (2)
  143:   SetLcdDisplayPos(3, 0);//汉字定位到上行左端
 00000042  2003      MOV         R0,#0x3
 00000044  2100      MOV         R1,#0x0
 00000046  F7FF      BL          SetLcdDisplayPos?T  ; T=0x0001  (1)
 00000048  FFDB      BL          SetLcdDisplayPos?T  ; T=0x0001  (2)
  144:   LcdDisplayString("汉字显示演示78");
 0000004A  4800      LDR         R0,=??S_2 ; ??S_2
 0000004C  F7FF      BL          LcdDisplayString?T  ; T=0x0001  (1)
 0000004E  FFD8      BL          LcdDisplayString?T  ; T=0x0001  (2)
  145:   os_dly_wait (5);//延时100mS
 00000050  2005      MOV         R0,#0x5
 00000052  F7FF      BL          os_dly_wait?T  ; T=0x0001  (1)
 00000054  FFD5      BL          os_dly_wait?T  ; T=0x0001  (2)
  146: }
 00000056  BC08      POP         {R3}
 00000058  4718      BX          R3
 0000005A          ENDP ; 'LcdInit?T'


*** CODE SEGMENT '?PR?LcdSendCommand?T?main':
  151: void LcdSendCommand(unsigned char cCommand)
 00000000  B510      PUSH        {R4,LR}
 00000002  1C04      MOV         R4,R0 ; cCommand
 00000004  ---- Variable 'cCommand' assigned to Register 'R4' ----
  157:   SSP_SendData(0xf8);//发送LCD控制命令
 00000004  20F8      MOV         R0,#0xF8
 00000006  F7FF      BL          SSP_SendData?T  ; T=0x0001  (1)
 00000008  FFFB      BL          SSP_SendData?T  ; T=0x0001  (2)
  158:   SSP_SendData(cCommand & 0xf0);//发送高4位LCD控制命令
 0000000A  1C20      MOV         R0,R4 ; cCommand
 0000000C  0600      LSL         R0,R0,#0x18 ; cCommand
 0000000E  0E00      LSR         R0,R0,#0x18
 00000010  21F0      MOV         R1,#0xF0
 00000012  4008      AND         R0,R1
 00000014  F7FF      BL          SSP_SendData?T  ; T=0x0001  (1)
 00000016  FFF4      BL          SSP_SendData?T  ; T=0x0001  (2)
  159:   SSP_SendData(cCommand << 4);//发送低4位LCD控制命令
 00000018  1C20      MOV         R0,R4 ; cCommand
 0000001A  0600      LSL         R0,R0,#0x18 ; cCommand
 0000001C  0E00      LSR         R0,R0,#0x18
 0000001E  0100      LSL         R0,R0,#0x4
 00000020  F7FF      BL          SSP_SendData?T  ; T=0x0001  (1)
 00000022  FFEE      BL          SSP_SendData?T  ; T=0x0001  (2)
  165:   if (cCommand == 0x01) _delay_loop_(1600);//1.6mS
 00000024  1C20      MOV         R0,R4 ; cCommand
 00000026  0600      LSL         R0,R0,#0x18 ; cCommand
 00000028  0E00      LSR         R0,R0,#0x18
 0000002A  2801      CMP         R0,#0x1
ARM COMPILER V2.42,  main                                                                  19/01/06  08:10:09  PAGE 17  

 0000002C  D103      BNE         L_25  ; T=0x00000036
 0000002E  4800      LDR         R0,=0x640
 00000030  F7FF      BL          _delay_loop_?T  ; T=0x0001  (1)
 00000032  FFE6      BL          _delay_loop_?T  ; T=0x0001  (2)
 00000034  E002      B           L_26  ; T=0x0000003C
 00000036          L_25:
  166:   else _delay_loop_(72);//st7920要求等待72uS
 00000036  2048      MOV         R0,#0x48
 00000038  F7FF      BL          _delay_loop_?T  ; T=0x0001  (1)
 0000003A  FFE2      BL          _delay_loop_?T  ; T=0x0001  (2)
 0000003C          L_26:
  167: }
 0000003C  BC10      POP         {R4}
 0000003E  BC08      POP         {R3}
 00000040  4718      BX          R3
 00000042          ENDP ; 'LcdSendCommand?T'


*** CODE SEGMENT '?PR?LcdSendData?T?main':
  173: void LcdSendData(unsigned char cData)
 00000000  B510      PUSH        {R4,LR}
 00000002  1C04      MOV         R4,R0 ; cData
 00000004  ---- Variable 'cData' assigned to Register 'R4' ----
  179:   SSP_SendData(0xfa);//发送LCD显示数据
 00000004  20FA      MOV         R0,#0xFA
 00000006  F7FF      BL          SSP_SendData?T  ; T=0x0001  (1)
 00000008  FFFB      BL          SSP_SendData?T  ; T=0x0001  (2)
  180:   SSP_SendData(cData & 0xf0);//发送高4位LCD显示数据
 0000000A  1C20      MOV         R0,R4 ; cData
 0000000C  0600      LSL         R0,R0,#0x18 ; cData
 0000000E  0E00      LSR         R0,R0,#0x18
 00000010  21F0      MOV         R1,#0xF0
 00000012  4008      AND         R0,R1
 00000014  F7FF      BL          SSP_SendData?T  ; T=0x0001  (1)
 00000016  FFF4      BL          SSP_SendData?T  ; T=0x0001  (2)
  181:   SSP_SendData(cData << 4);//发送低4位LCD显示数据
 00000018  1C20      MOV         R0,R4 ; cData
 0000001A  0600      LSL         R0,R0,#0x18 ; cData
 0000001C  0E00      LSR         R0,R0,#0x18
 0000001E  0100      LSL         R0,R0,#0x4
 00000020  F7FF      BL          SSP_SendData?T  ; T=0x0001  (1)
 00000022  FFEE      BL          SSP_SendData?T  ; T=0x0001  (2)
  187:   _delay_loop_(72);//st7920要求等待延时72uS
 00000024  2048      MOV         R0,#0x48
 00000026  F7FF      BL          _delay_loop_?T  ; T=0x0001  (1)
 00000028  FFEB      BL          _delay_loop_?T  ; T=0x0001  (2)
  188: }
 0000002A  BC10      POP         {R4}
 0000002C  BC08      POP         {R3}
 0000002E  4718      BX          R3
 00000030          ENDP ; 'LcdSendData?T'


*** CODE SEGMENT '?PR?LcdDisplayBuffers?T?main':
  191: void LcdDisplayBuffers(void)
 00000000  B530      PUSH        {R4-R5,LR}
  192: {
 00000002            ; SCOPE-START
  194:   for (i = 0;i < 4;i ++) {
 00000002  2400      MOV         R4,#0x0
 00000004  ---- Variable 'i' assigned to Register 'R4' ----
 00000004  E035      B           L_29  ; T=0x00000072
 00000006          L_30:
  195:     if (LcdBuffers.LcdBuffWrFlag[i]) {//此行已被改写
 00000006  1C20      MOV         R0,R4 ; i
 00000008  0601      LSL         R1,R0,#0x18 ; i
 0000000A  0E09      LSR         R1,R1,#0x18
 0000000C  4800      LDR         R0,=LcdBuffers + 0x44 ; LcdBuffers+68
 0000000E  5C40      LDRB        R0,[R0,R1]
 00000010  2800      CMP         R0,#0x0
ARM COMPILER V2.42,  main                                                                  19/01/06  08:10:09  PAGE 18  

 00000012  D02B      BEQ         L_27  ; T=0x0000006C

⌨️ 快捷键说明

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