Uart.lst
上传用户:xhjmsc
上传日期:2019-09-13
资源大小:389k
文件大小:18k
源码类别:

传真(Fax)编程

开发平台:

C/C++

  1. ##############################################################################
  2. #                                                                            #
  3. # IAR MSP430 C/EC++ Compiler V2.10A/W32                23/Apr/2007  18:04:12 #
  4. # Copyright 1996-2003 IAR Systems. All rights reserved.                      #
  5. #                                                                            #
  6. #    __rt_version  =  1                                                      #
  7. #    __double_size =  32                                                     #
  8. #    __reg_r4      =  free                                                   #
  9. #    __reg_r5      =  free                                                   #
  10. #    __pic         =  no                                                     #
  11. #    Source file   =  E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
  12. #                     filesUart.c                                           #
  13. #    Command line  =  -I "C:Program FilesIAR SystemsEmbedded Workbench    #
  14. #                     3.2430INC" -I "C:Program FilesIAR                 #
  15. #                     SystemsEmbedded Workbench 3.2430INCCLIB" -lCN     #
  16. #                     E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
  17. #                     DebugList -lA E:projectFaxProgramVson_Bryan_Fax_ #
  18. #                     Conexant_070423DebugList -o                         #
  19. #                     E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
  20. #                     DebugObj -z2 --no_cse --no_unroll --no_inline        #
  21. #                     --no_code_motion --debug -e                            #
  22. #                     E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
  23. #                     filesUart.c                                           #
  24. #    List file     =  E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
  25. #                     DebugListUart.lst                                    #
  26. #    Object file   =  E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
  27. #                     DebugObjUart.r43                                     #
  28. #                                                                            #
  29. #                                                                            #
  30. ##############################################################################
  31. E:projectFaxProgramVson_Bryan_Fax_Conexant_070423filesUart.c
  32.       1          //UART
  33.       2          #include "includeH.h"
  34.                                     In segment DATA16_AN, at 0x0
  35.       unsigned char volatile __data IE1
  36.                         IE1:
  37.       000000                        DS8 1
  38.                                     In segment DATA16_AN, at 0x2
  39.       unsigned char volatile __data IFG1
  40.                         IFG1:
  41.       000000                        DS8 1
  42.                                     In segment DATA16_AN, at 0x4
  43.       unsigned char volatile __data ME1
  44.                         ME1:
  45.       000000                        DS8 1
  46.                                     In segment DATA16_AN, at 0x1a
  47.       unsigned char volatile __data P3DIR
  48.                         P3DIR:
  49.       000000                        DS8 1
  50.                                     In segment DATA16_AN, at 0x1b
  51.       unsigned char volatile __data P3SEL
  52.                         P3SEL:
  53.       000000                        DS8 1
  54.                                     In segment DATA16_AN, at 0x70
  55.       unsigned char volatile __data UCTL0
  56.                         UCTL0:
  57.       000000                        DS8 1
  58.                                     In segment DATA16_AN, at 0x71
  59.       unsigned char volatile __data UTCTL0
  60.                         UTCTL0:
  61.       000000                        DS8 1
  62.                                     In segment DATA16_AN, at 0x73
  63.       unsigned char volatile __data UMCTL0
  64.                         UMCTL0:
  65.       000000                        DS8 1
  66.                                     In segment DATA16_AN, at 0x74
  67.       unsigned char volatile __data UBR00
  68.                         UBR00:
  69.       000000                        DS8 1
  70.                                     In segment DATA16_AN, at 0x75
  71.       unsigned char volatile __data UBR10
  72.                         UBR10:
  73.       000000                        DS8 1
  74.                                     In segment DATA16_AN, at 0x76
  75.       unsigned char const volatile __data RXBUF0
  76.                         RXBUF0:
  77.       000000                        DS8 1
  78.                                     In segment DATA16_AN, at 0x77
  79.       unsigned char volatile __data TXBUF0
  80.                         TXBUF0:
  81.       000000                        DS8 1
  82.                                     In segment DATA16_AN, at 0x57
  83.       unsigned char volatile __data BCSCTL1
  84.                         BCSCTL1:
  85.       000000                        DS8 1
  86.                                     In segment DATA16_AN, at 0x58
  87.       unsigned char volatile __data BCSCTL2
  88.                         BCSCTL2:
  89.       000000                        DS8 1
  90.       3          
  91.       4          
  92.                                     In segment CODE, align 2, keep-with-next
  93.       5          void InitUART(void)                    //初始化UART
  94.                         InitUART:
  95.       6          {      
  96.       000000   0A12                 PUSH.W  R10
  97.       7                 unsigned int ucGeneralCnt;
  98.       8                 //WDTCTL=WDTPW+WDTHOLD;              //close watch dog
  99.       9                 //DCOCTL &= ~DCO2;
  100.      10                 BCSCTL1|=XTS;     //MCLK时钟源  Select LFXTCLK high frequency
  101.       000002   F2D040005700         BIS.B   #0x40, &0x57
  102.      11                 BCSCTL2|=SELM_3;     //MCLK时钟源  Select LFXTCLK   //+DIVM_3 
  103.       000008   F2D0C0005800         BIS.B   #0xc0, &0x58
  104.      12                 
  105.      13                 do                                  //等待时钟稳定    
  106.      14                 {   IFG1 &= ~OFIFG;
  107.                         ??InitUART_1:
  108.       00000E   E2C30200             BIC.B   #0x2, &0x2
  109.      15                     for(ucGeneralCnt=0;ucGeneralCnt<0xff;ucGeneralCnt++);    
  110.       000012   0A43                 MOV.W   #0x0, R10
  111.                         ??InitUART_0:
  112.       000014   3A90FF00             CMP.W   #0xff, R10
  113.       000018   022C                 JC      ??InitUART_3
  114.       00001A   1A53                 ADD.W   #0x1, R10
  115.       00001C   FB3F                 JMP     ??InitUART_0
  116.      16                 }while ((IFG1 & OFIFG)==OFIFG);
  117.                         ??InitUART_3:
  118.       00001E   E2B30200             BIT.B   #0x2, &0x2
  119.       000022   F52F                 JC      ??InitUART_1
  120.      17                 
  121.      18                 UCTL0=0X00;
  122.       000024   C2437000             MOV.B   #0x0, &0x70
  123.      19                 UCTL0|=SWRST;                       //disable soft reset  
  124.       000028   D2D37000             BIS.B   #0x1, &0x70
  125.      20                 UCTL0|=CHAR;                         //8 bits
  126.       00002C   F2D010007000         BIS.B   #0x10, &0x70
  127.      21                 //UCTL0|=LISTEN;                       //OPEN LISTEN    
  128.      22                 UTCTL0=SSEL0;                  //BaudRate generate select ACLK    
  129.       000032   F24010007100         MOV.B   #0x10, &0x71
  130.      23                 UBR10=0X03;//0x1a;//0X03;//0X02;  0x03;//0X00; //BaudRate==9600
  131.       000038   F24003007500         MOV.B   #0x3, &0x75
  132.      24                 UBR00=0X41;//0x0a;//0X41;//0X2b;  0x41;//0X49;    
  133.       00003E   F24041007400         MOV.B   #0x41, &0x74
  134.      25                 UMCTL0=0X00;    
  135.       000044   C2437300             MOV.B   #0x0, &0x73
  136.      26                 UCTL0&=~SWRST;                      //enable soft reset USART    
  137.       000048   D2C37000             BIC.B   #0x1, &0x70
  138.      27                 ME1|=URXE0+UTXE0;                   //enable TXD and RXD    
  139.       00004C   F2D0C0000400         BIS.B   #0xc0, &0x4
  140.      28                 IE1|=URXIE0;                        //enable RX interrupt
  141.       000052   F2D040000000         BIS.B   #0x40, &0x0
  142.      29                 IE1|=UTXIE0;                        //enable TX interrupt    
  143.       000058   F2D080000000         BIS.B   #0x80, &0x0
  144.      30                 IFG1=0X00;                          //clear IFG1    
  145.       00005E   C2430200             MOV.B   #0x0, &0x2
  146.      31                 P3SEL|=0x30;//0x00;//0X30;                       //P3.4 P3.5 for USART    
  147.       000062   F2D030001B00         BIS.B   #0x30, &0x1b
  148.      32                 P3DIR|=BIT4;                         //P3.4 tx OUTPUT 
  149.       000068   F2D010001A00         BIS.B   #0x10, &0x1a
  150.      33                 
  151.      34                 delay800ms();
  152.       00006E   B012....             CALL    #delay800ms
  153.      35                 for(ucGeneralCnt=0;ucGeneralCnt<255;ucGeneralCnt++)
  154.       000072   0A43                 MOV.W   #0x0, R10
  155.                         ??InitUART_2:
  156.       000074   3A90FF00             CMP.W   #0xff, R10
  157.       000078   042C                 JC      ??InitUART_4
  158.      36                 { 
  159.      37                      aucUartRxBuf[ucGeneralCnt]=0;    //clear RX buffer
  160.       00007A   CA43....             MOV.B   #0x0, aucUartRxBuf(R10)
  161.      38                 }                      
  162.       00007E   1A53                 ADD.W   #0x1, R10
  163.       000080   F93F                 JMP     ??InitUART_2
  164.      39                 _EINT();                             //enable interrupt
  165.                         ??InitUART_4:
  166.       000082   32D2                 EINT
  167.      40                 
  168.      41          }//InitUART()
  169.       000084   3A41                 POP.W   R10
  170.       000086   3041                 RET
  171.      42              
  172.      43              
  173.      44              
  174.                                     In segment CODE, align 2, keep-with-next
  175.      45          void UartStart(void)                   //启动发送
  176.                         UartStart:
  177.      46          {    
  178.      47                 //ATcmdDelay();
  179.      48                 //ATcmdDelay();  
  180.      49                 IE1 |= UTXIE0;
  181.       000000   F2D080000000         BIS.B   #0x80, &0x0
  182.      50                 gpucTxBufPnt = 0;
  183.       000006   C243....             MOV.B   #0x0, &gpucTxBufPnt
  184.      51                 gwTxNum = 4;
  185.       00000A   A242....             MOV.W   #0x4, &gwTxNum
  186.      52                 while((UTCTL0&BIT0) != BIT0);        //TXEPT: 1 empty 0 full 
  187.                         ??UartStart_0:
  188.       00000E   D2B37100             BIT.B   #0x1, &0x71
  189.       000012   FD2B                 JNC     ??UartStart_0
  190.      53                 TXBUF0 = aucUartTxBuf[0];    
  191.       000014   D242....7700         MOV.B   &aucUartTxBuf, &0x77
  192.      54                 gucTxBufCnt = 1;
  193.       00001A   D243....             MOV.B   #0x1, &gucTxBufCnt
  194.      55                     
  195.      56                 //IFG1 |=  UTXIFG0;                //Entry TX interrupt
  196.      57                     
  197.      58          }
  198.       00001E   3041                 RET
  199.      59                     
  200.      60                     
  201.      61                 
  202.                                     In segment CODE, align 2, align-sorted
  203.      62          void UartReceive(void)                 //receive
  204.                         UartReceive:
  205.      63          {   
  206.      64                 gucTimeOverflowCount=0;//clear Rx Fax time flowover
  207.       000000   C243....             MOV.B   #0x0, &gucTimeOverflowCount
  208.      65                 gwTimeOverflowCount=0; //clear Rx Fax time flowover  
  209.       000004   8243....             MOV.W   #0x0, &gwTimeOverflowCount
  210.      66                 aucUartRxBuf[gucUartRxCnt]=RXBUF0;
  211.       000008   5E42....             MOV.B   &gucUartRxCnt, R14
  212.       00000C   3EF0FF00             AND.W   #0xff, R14
  213.       000010   DE427600....         MOV.B   &0x76, aucUartRxBuf(R14)
  214.      67                 gucUartRxCnt+=1;
  215.       000016   D253....             ADD.B   #0x1, &gucUartRxCnt
  216.      68                 gdwRxQueueRearCnt++;    //Queue length inc
  217.       00001A   9253....             ADD.W   #0x1, &gdwRxQueueRearCnt
  218.       00001E   8263....             ADDC.W  #0x0, &gdwRxQueueRearCnt + 0x2
  219.      69                 gpucQueueRear++;       //entry Queue Rear Point inc
  220.       000022   D253....             ADD.B   #0x1, &gpucQueueRear
  221.      70                       
  222.      71          }//UartReceive
  223.       000026   3041                 RET
  224.      72                         
  225.      73                         
  226.                                     In segment CODE, align 2, keep-with-next
  227.      74          void UartSend(void)                    //transmit
  228.                         UartSend:
  229.      75          {   
  230.      76                 gpucTxBufPnt+=1; //TxBufCnt point to the second data.The second data will be sent now
  231.       000000   D253....             ADD.B   #0x1, &gpucTxBufPnt
  232.      77                 if(gpucTxBufPnt<gwTxNum)//check whether send next data      
  233.       000004   5E42....             MOV.B   &gpucTxBufPnt, R14
  234.       000008   3EF0FF00             AND.W   #0xff, R14
  235.       00000C   1E92....             CMP.W   &gwTxNum, R14
  236.       000010   0A2C                 JC      ??UartSend_0
  237.      78                 {   
  238.      79                    TXBUF0=aucUartTxBuf[gucTxBufCnt];          
  239.       000012   5E42....             MOV.B   &gucTxBufCnt, R14
  240.       000016   3EF0FF00             AND.W   #0xff, R14
  241.       00001A   D24E....7700         MOV.B   aucUartTxBuf(R14), &0x77
  242.      80                    gucTxBufCnt++;
  243.       000020   D253....             ADD.B   #0x1, &gucTxBufCnt
  244.       000024   3041                 RET
  245.      81                    //if(gucTxBufCnt>22){gucTxBufCnt=0;}               
  246.      82                 }    
  247.      83                 else     
  248.      84                    {     
  249.      85                       gpucTxBufPnt=0;                        
  250.                         ??UartSend_0:
  251.       000026   C243....             MOV.B   #0x0, &gpucTxBufPnt
  252.      86                       gucTxBufCnt=0;                                      
  253.       00002A   C243....             MOV.B   #0x0, &gucTxBufCnt
  254.      87                    }
  255.      88          }
  256.       00002E   3041                 RET
  257.      89                      
  258.      90          //**************************************************************/            
  259.      91                      
  260.      92          #pragma vector=USART0TX_VECTOR            
  261.                                     In segment CODE, align 2, align-sorted
  262.      93          __interrupt void intUartTx(void)//发送中断响应
  263.                         intUartTx:
  264.      94          {
  265.       000000   0D12                 PUSH.W  R13
  266.       000002   0C12                 PUSH.W  R12
  267.       000004   0F12                 PUSH.W  R15
  268.       000006   0E12                 PUSH.W  R14
  269.      95                 UartSend();
  270.       000008   B012....             CALL    #UartSend
  271.      96          }
  272.       00000C   3E41                 POP.W   R14
  273.       00000E   3F41                 POP.W   R15
  274.       000010   3C41                 POP.W   R12
  275.       000012   3D41                 POP.W   R13
  276.       000014   0013                 RETI
  277.      97          
  278.      98          #pragma vector=USART0RX_VECTOR
  279.                                     In segment CODE, align 2, align-sorted
  280.      99          __interrupt  void intUartRx(void)//接收中断响应
  281.                         intUartRx:
  282.     100          {
  283.       000000   0D12                 PUSH.W  R13
  284.       000002   0C12                 PUSH.W  R12
  285.       000004   0F12                 PUSH.W  R15
  286.       000006   0E12                 PUSH.W  R14
  287.     101              gucGeneralStatus |= bitModemActive;
  288.       000008   E2D3....             BIS.B   #0x2, &gucGeneralStatus
  289.     102              UartReceive();   
  290.       00000C   B012....             CALL    #UartReceive
  291.     103          } 
  292.       000010   3E41                 POP.W   R14
  293.       000012   3F41                 POP.W   R15
  294.       000014   3C41                 POP.W   R12
  295.       000016   3D41                 POP.W   R13
  296.       000018   0013                 RETI
  297.                                     In segment INTVEC, offset 0x10, root
  298.       000000   ....                 DC16    intUartTx
  299.                                     In segment INTVEC, offset 0x12, root
  300.       000000   ....                 DC16    intUartRx
  301.    Maximum stack usage in bytes:
  302.      Function         CSTACK
  303.      --------         ------
  304.      InitUART             4
  305.        -> delay800ms      4
  306.      UartReceive          2
  307.      UartSend             2
  308.      UartStart            2
  309.      intUartRx           12
  310.        -> UartReceive    12
  311.      intUartTx           12
  312.        -> UartSend       12
  313.    Segment part sizes:
  314.      Function/Label Bytes
  315.      -------------- -----
  316.      IE1               1
  317.      IFG1              1
  318.      ME1               1
  319.      P3DIR             1
  320.      P3SEL             1
  321.      UCTL0             1
  322.      UTCTL0            1
  323.      UMCTL0            1
  324.      UBR00             1
  325.      UBR10             1
  326.      RXBUF0            1
  327.      TXBUF0            1
  328.      BCSCTL1           1
  329.      BCSCTL2           1
  330.      InitUART        136
  331.      UartStart        32
  332.      UartReceive      40
  333.      UartSend         48
  334.      intUartTx        22
  335.      intUartRx        26
  336.       Others           4
  337.  
  338.  304 bytes in segment CODE
  339.   14 bytes in segment DATA16_AN
  340.    4 bytes in segment INTVEC
  341.  
  342.  308 bytes of CODE memory
  343.    0 bytes of DATA memory (+ 14 bytes shared)
  344. Errors: none
  345. Warnings: none