Uart.lst
上传用户:xhjmsc
上传日期:2019-09-13
资源大小:389k
文件大小:18k
- ##############################################################################
- # #
- # IAR MSP430 C/EC++ Compiler V2.10A/W32 23/Apr/2007 18:04:12 #
- # Copyright 1996-2003 IAR Systems. All rights reserved. #
- # #
- # __rt_version = 1 #
- # __double_size = 32 #
- # __reg_r4 = free #
- # __reg_r5 = free #
- # __pic = no #
- # Source file = E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
- # filesUart.c #
- # Command line = -I "C:Program FilesIAR SystemsEmbedded Workbench #
- # 3.2430INC" -I "C:Program FilesIAR #
- # SystemsEmbedded Workbench 3.2430INCCLIB" -lCN #
- # E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
- # DebugList -lA E:projectFaxProgramVson_Bryan_Fax_ #
- # Conexant_070423DebugList -o #
- # E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
- # DebugObj -z2 --no_cse --no_unroll --no_inline #
- # --no_code_motion --debug -e #
- # E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
- # filesUart.c #
- # List file = E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
- # DebugListUart.lst #
- # Object file = E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
- # DebugObjUart.r43 #
- # #
- # #
- ##############################################################################
- E:projectFaxProgramVson_Bryan_Fax_Conexant_070423filesUart.c
- 1 //UART
- 2 #include "includeH.h"
- In segment DATA16_AN, at 0x0
- unsigned char volatile __data IE1
- IE1:
- 000000 DS8 1
- In segment DATA16_AN, at 0x2
- unsigned char volatile __data IFG1
- IFG1:
- 000000 DS8 1
- In segment DATA16_AN, at 0x4
- unsigned char volatile __data ME1
- ME1:
- 000000 DS8 1
- In segment DATA16_AN, at 0x1a
- unsigned char volatile __data P3DIR
- P3DIR:
- 000000 DS8 1
- In segment DATA16_AN, at 0x1b
- unsigned char volatile __data P3SEL
- P3SEL:
- 000000 DS8 1
- In segment DATA16_AN, at 0x70
- unsigned char volatile __data UCTL0
- UCTL0:
- 000000 DS8 1
- In segment DATA16_AN, at 0x71
- unsigned char volatile __data UTCTL0
- UTCTL0:
- 000000 DS8 1
- In segment DATA16_AN, at 0x73
- unsigned char volatile __data UMCTL0
- UMCTL0:
- 000000 DS8 1
- In segment DATA16_AN, at 0x74
- unsigned char volatile __data UBR00
- UBR00:
- 000000 DS8 1
- In segment DATA16_AN, at 0x75
- unsigned char volatile __data UBR10
- UBR10:
- 000000 DS8 1
- In segment DATA16_AN, at 0x76
- unsigned char const volatile __data RXBUF0
- RXBUF0:
- 000000 DS8 1
- In segment DATA16_AN, at 0x77
- unsigned char volatile __data TXBUF0
- TXBUF0:
- 000000 DS8 1
- In segment DATA16_AN, at 0x57
- unsigned char volatile __data BCSCTL1
- BCSCTL1:
- 000000 DS8 1
- In segment DATA16_AN, at 0x58
- unsigned char volatile __data BCSCTL2
- BCSCTL2:
- 000000 DS8 1
- 3
- 4
- In segment CODE, align 2, keep-with-next
- 5 void InitUART(void) //初始化UART
- InitUART:
- 6 {
- 000000 0A12 PUSH.W R10
- 7 unsigned int ucGeneralCnt;
- 8 //WDTCTL=WDTPW+WDTHOLD; //close watch dog
- 9 //DCOCTL &= ~DCO2;
- 10 BCSCTL1|=XTS; //MCLK时钟源 Select LFXTCLK high frequency
- 000002 F2D040005700 BIS.B #0x40, &0x57
- 11 BCSCTL2|=SELM_3; //MCLK时钟源 Select LFXTCLK //+DIVM_3
- 000008 F2D0C0005800 BIS.B #0xc0, &0x58
- 12
- 13 do //等待时钟稳定
- 14 { IFG1 &= ~OFIFG;
- ??InitUART_1:
- 00000E E2C30200 BIC.B #0x2, &0x2
- 15 for(ucGeneralCnt=0;ucGeneralCnt<0xff;ucGeneralCnt++);
- 000012 0A43 MOV.W #0x0, R10
- ??InitUART_0:
- 000014 3A90FF00 CMP.W #0xff, R10
- 000018 022C JC ??InitUART_3
- 00001A 1A53 ADD.W #0x1, R10
- 00001C FB3F JMP ??InitUART_0
- 16 }while ((IFG1 & OFIFG)==OFIFG);
- ??InitUART_3:
- 00001E E2B30200 BIT.B #0x2, &0x2
- 000022 F52F JC ??InitUART_1
- 17
- 18 UCTL0=0X00;
- 000024 C2437000 MOV.B #0x0, &0x70
- 19 UCTL0|=SWRST; //disable soft reset
- 000028 D2D37000 BIS.B #0x1, &0x70
- 20 UCTL0|=CHAR; //8 bits
- 00002C F2D010007000 BIS.B #0x10, &0x70
- 21 //UCTL0|=LISTEN; //OPEN LISTEN
- 22 UTCTL0=SSEL0; //BaudRate generate select ACLK
- 000032 F24010007100 MOV.B #0x10, &0x71
- 23 UBR10=0X03;//0x1a;//0X03;//0X02; 0x03;//0X00; //BaudRate==9600
- 000038 F24003007500 MOV.B #0x3, &0x75
- 24 UBR00=0X41;//0x0a;//0X41;//0X2b; 0x41;//0X49;
- 00003E F24041007400 MOV.B #0x41, &0x74
- 25 UMCTL0=0X00;
- 000044 C2437300 MOV.B #0x0, &0x73
- 26 UCTL0&=~SWRST; //enable soft reset USART
- 000048 D2C37000 BIC.B #0x1, &0x70
- 27 ME1|=URXE0+UTXE0; //enable TXD and RXD
- 00004C F2D0C0000400 BIS.B #0xc0, &0x4
- 28 IE1|=URXIE0; //enable RX interrupt
- 000052 F2D040000000 BIS.B #0x40, &0x0
- 29 IE1|=UTXIE0; //enable TX interrupt
- 000058 F2D080000000 BIS.B #0x80, &0x0
- 30 IFG1=0X00; //clear IFG1
- 00005E C2430200 MOV.B #0x0, &0x2
- 31 P3SEL|=0x30;//0x00;//0X30; //P3.4 P3.5 for USART
- 000062 F2D030001B00 BIS.B #0x30, &0x1b
- 32 P3DIR|=BIT4; //P3.4 tx OUTPUT
- 000068 F2D010001A00 BIS.B #0x10, &0x1a
- 33
- 34 delay800ms();
- 00006E B012.... CALL #delay800ms
- 35 for(ucGeneralCnt=0;ucGeneralCnt<255;ucGeneralCnt++)
- 000072 0A43 MOV.W #0x0, R10
- ??InitUART_2:
- 000074 3A90FF00 CMP.W #0xff, R10
- 000078 042C JC ??InitUART_4
- 36 {
- 37 aucUartRxBuf[ucGeneralCnt]=0; //clear RX buffer
- 00007A CA43.... MOV.B #0x0, aucUartRxBuf(R10)
- 38 }
- 00007E 1A53 ADD.W #0x1, R10
- 000080 F93F JMP ??InitUART_2
- 39 _EINT(); //enable interrupt
- ??InitUART_4:
- 000082 32D2 EINT
- 40
- 41 }//InitUART()
- 000084 3A41 POP.W R10
- 000086 3041 RET
- 42
- 43
- 44
- In segment CODE, align 2, keep-with-next
- 45 void UartStart(void) //启动发送
- UartStart:
- 46 {
- 47 //ATcmdDelay();
- 48 //ATcmdDelay();
- 49 IE1 |= UTXIE0;
- 000000 F2D080000000 BIS.B #0x80, &0x0
- 50 gpucTxBufPnt = 0;
- 000006 C243.... MOV.B #0x0, &gpucTxBufPnt
- 51 gwTxNum = 4;
- 00000A A242.... MOV.W #0x4, &gwTxNum
- 52 while((UTCTL0&BIT0) != BIT0); //TXEPT: 1 empty 0 full
- ??UartStart_0:
- 00000E D2B37100 BIT.B #0x1, &0x71
- 000012 FD2B JNC ??UartStart_0
- 53 TXBUF0 = aucUartTxBuf[0];
- 000014 D242....7700 MOV.B &aucUartTxBuf, &0x77
- 54 gucTxBufCnt = 1;
- 00001A D243.... MOV.B #0x1, &gucTxBufCnt
- 55
- 56 //IFG1 |= UTXIFG0; //Entry TX interrupt
- 57
- 58 }
- 00001E 3041 RET
- 59
- 60
- 61
- In segment CODE, align 2, align-sorted
- 62 void UartReceive(void) //receive
- UartReceive:
- 63 {
- 64 gucTimeOverflowCount=0;//clear Rx Fax time flowover
- 000000 C243.... MOV.B #0x0, &gucTimeOverflowCount
- 65 gwTimeOverflowCount=0; //clear Rx Fax time flowover
- 000004 8243.... MOV.W #0x0, &gwTimeOverflowCount
- 66 aucUartRxBuf[gucUartRxCnt]=RXBUF0;
- 000008 5E42.... MOV.B &gucUartRxCnt, R14
- 00000C 3EF0FF00 AND.W #0xff, R14
- 000010 DE427600.... MOV.B &0x76, aucUartRxBuf(R14)
- 67 gucUartRxCnt+=1;
- 000016 D253.... ADD.B #0x1, &gucUartRxCnt
- 68 gdwRxQueueRearCnt++; //Queue length inc
- 00001A 9253.... ADD.W #0x1, &gdwRxQueueRearCnt
- 00001E 8263.... ADDC.W #0x0, &gdwRxQueueRearCnt + 0x2
- 69 gpucQueueRear++; //entry Queue Rear Point inc
- 000022 D253.... ADD.B #0x1, &gpucQueueRear
- 70
- 71 }//UartReceive
- 000026 3041 RET
- 72
- 73
- In segment CODE, align 2, keep-with-next
- 74 void UartSend(void) //transmit
- UartSend:
- 75 {
- 76 gpucTxBufPnt+=1; //TxBufCnt point to the second data.The second data will be sent now
- 000000 D253.... ADD.B #0x1, &gpucTxBufPnt
- 77 if(gpucTxBufPnt<gwTxNum)//check whether send next data
- 000004 5E42.... MOV.B &gpucTxBufPnt, R14
- 000008 3EF0FF00 AND.W #0xff, R14
- 00000C 1E92.... CMP.W &gwTxNum, R14
- 000010 0A2C JC ??UartSend_0
- 78 {
- 79 TXBUF0=aucUartTxBuf[gucTxBufCnt];
- 000012 5E42.... MOV.B &gucTxBufCnt, R14
- 000016 3EF0FF00 AND.W #0xff, R14
- 00001A D24E....7700 MOV.B aucUartTxBuf(R14), &0x77
- 80 gucTxBufCnt++;
- 000020 D253.... ADD.B #0x1, &gucTxBufCnt
- 000024 3041 RET
- 81 //if(gucTxBufCnt>22){gucTxBufCnt=0;}
- 82 }
- 83 else
- 84 {
- 85 gpucTxBufPnt=0;
- ??UartSend_0:
- 000026 C243.... MOV.B #0x0, &gpucTxBufPnt
- 86 gucTxBufCnt=0;
- 00002A C243.... MOV.B #0x0, &gucTxBufCnt
- 87 }
- 88 }
- 00002E 3041 RET
- 89
- 90 //**************************************************************/
- 91
- 92 #pragma vector=USART0TX_VECTOR
- In segment CODE, align 2, align-sorted
- 93 __interrupt void intUartTx(void)//发送中断响应
- intUartTx:
- 94 {
- 000000 0D12 PUSH.W R13
- 000002 0C12 PUSH.W R12
- 000004 0F12 PUSH.W R15
- 000006 0E12 PUSH.W R14
- 95 UartSend();
- 000008 B012.... CALL #UartSend
- 96 }
- 00000C 3E41 POP.W R14
- 00000E 3F41 POP.W R15
- 000010 3C41 POP.W R12
- 000012 3D41 POP.W R13
- 000014 0013 RETI
- 97
- 98 #pragma vector=USART0RX_VECTOR
- In segment CODE, align 2, align-sorted
- 99 __interrupt void intUartRx(void)//接收中断响应
- intUartRx:
- 100 {
- 000000 0D12 PUSH.W R13
- 000002 0C12 PUSH.W R12
- 000004 0F12 PUSH.W R15
- 000006 0E12 PUSH.W R14
- 101 gucGeneralStatus |= bitModemActive;
- 000008 E2D3.... BIS.B #0x2, &gucGeneralStatus
- 102 UartReceive();
- 00000C B012.... CALL #UartReceive
- 103 }
- 000010 3E41 POP.W R14
- 000012 3F41 POP.W R15
- 000014 3C41 POP.W R12
- 000016 3D41 POP.W R13
- 000018 0013 RETI
- In segment INTVEC, offset 0x10, root
- 000000 .... DC16 intUartTx
- In segment INTVEC, offset 0x12, root
- 000000 .... DC16 intUartRx
- Maximum stack usage in bytes:
- Function CSTACK
- -------- ------
- InitUART 4
- -> delay800ms 4
- UartReceive 2
- UartSend 2
- UartStart 2
- intUartRx 12
- -> UartReceive 12
- intUartTx 12
- -> UartSend 12
- Segment part sizes:
- Function/Label Bytes
- -------------- -----
- IE1 1
- IFG1 1
- ME1 1
- P3DIR 1
- P3SEL 1
- UCTL0 1
- UTCTL0 1
- UMCTL0 1
- UBR00 1
- UBR10 1
- RXBUF0 1
- TXBUF0 1
- BCSCTL1 1
- BCSCTL2 1
- InitUART 136
- UartStart 32
- UartReceive 40
- UartSend 48
- intUartTx 22
- intUartRx 26
- Others 4
-
- 304 bytes in segment CODE
- 14 bytes in segment DATA16_AN
- 4 bytes in segment INTVEC
-
- 308 bytes of CODE memory
- 0 bytes of DATA memory (+ 14 bytes shared)
- Errors: none
- Warnings: none