SoftUart.lst
上传用户:xhjmsc
上传日期:2019-09-13
资源大小:389k
文件大小:20k
- ##############################################################################
- # #
- # 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 #
- # filesSoftUart.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 #
- # filesSoftUart.c #
- # List file = E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
- # DebugListSoftUart.lst #
- # Object file = E:projectFaxProgramVson_Bryan_Fax_Conexant_070423 #
- # DebugObjSoftUart.r43 #
- # #
- # #
- ##############################################################################
- E:projectFaxProgramVson_Bryan_Fax_Conexant_070423filesSoftUart.c
- 1 //soft UART
- 2 //new bryan Jan. 23, 2007
- 3 //
- 4
- 5 #include "includeH.h"
- In segment DATA16_AN, at 0x20
- unsigned char const volatile __data P1IN
- P1IN:
- 000000 DS8 1
- In segment DATA16_AN, at 0x34
- unsigned char const volatile __data P6IN
- P6IN:
- 000000 DS8 1
- In segment DATA16_AN, at 0x35
- unsigned char volatile __data P6OUT
- P6OUT:
- 000000 DS8 1
- 6
- 7
- 8
- In segment CODE, align 2, keep-with-next
- 9 unsigned char SoftUartRxOneFrame(void)
- SoftUartRxOneFrame:
- 10 {
- 000000 0A12 PUSH.W R10
- 000002 0B12 PUSH.W R11
- 11 unsigned char ucGeneralCount=0,ucSoftUartRxData=0;
- 000004 4B43 MOV.B #0x0, R11
- 000006 4A43 MOV.B #0x0, R10
- 12 while ((SOFTUART_PORT_IN & bitSOFTUARTRX) == bitSOFTUARTRX)//wait start bit Low
- ??SoftUartRxOneFrame_0:
- 000008 E2B33400 BIT.B #0x2, &0x34
- 00000C 0F28 JNC ??SoftUartRxOneFrame_3
- 13 {
- 14 if ((gucGeneralStatus & bitModemActive) == bitModemActive)
- 00000E E2B3.... BIT.B #0x2, &gucGeneralStatus
- 000012 0C2C JC ??SoftUartRxOneFrame_3
- 15 break;
- 16 if (((KEY_PORT_IN & bitKeyRingNumDec) != bitKeyRingNumDec) ||
- 17 ((KEY_PORT_IN & bitKeyRingNumAdd) != bitKeyRingNumAdd) ||
- 18 ((KEY_PORT_IN & bitKeyAutoMode) != bitKeyAutoMode) ||
- 19 ((KEY_PORT_IN & bitKeyManualMode) != bitKeyManualMode)) //||
- 000014 D2B32000 BIT.B #0x1, &0x20
- 000018 0928 JNC ??SoftUartRxOneFrame_3
- 00001A E2B32000 BIT.B #0x2, &0x20
- 00001E 0628 JNC ??SoftUartRxOneFrame_3
- 000020 E2B22000 BIT.B #0x4, &0x20
- 000024 0328 JNC ??SoftUartRxOneFrame_3
- 000026 F2B22000 BIT.B #0x8, &0x20
- 00002A EE2F JC ??SoftUartRxOneFrame_0
- 20 //((KEY_PORT_IN & bitKeySendFaxSignal) != bitKeySendFaxSignal))
- 21 break;
- 22 }
- 23 if ( (SOFTUART_PORT_IN & bitSOFTUARTRX) != bitSOFTUARTRX)
- ??SoftUartRxOneFrame_3:
- 00002C E2B33400 BIT.B #0x2, &0x34
- 000030 362C JC ??SoftUartRxOneFrame_4
- 24 {
- 25 delay1us(6);//SoftUartDelay();
- 000032 3C400600 MOV.W #0x6, R12
- 000036 B012.... CALL #delay1us
- 26 for (ucGeneralCount=0;ucGeneralCount<8;ucGeneralCount++)
- 00003A 4B43 MOV.B #0x0, R11
- ??SoftUartRxOneFrame_1:
- 00003C 7B92 CMP.B #0x8, R11
- 00003E 1A2C JC ??SoftUartRxOneFrame_2
- 27 {
- 28 delay1us(2);//SoftUartDelayHalf();
- 000040 2C43 MOV.W #0x2, R12
- 000042 B012.... CALL #delay1us
- 29 ucSoftUartRxData=ucSoftUartRxData>>1;
- 000046 12C3 CLRC
- 000048 4A10 RRC.B R10
- 30 if ((SOFTUART_PORT_IN & bitSOFTUARTRX) == bitSOFTUARTRX)
- 00004A E2B33400 BIT.B #0x2, &0x34
- 00004E 0328 JNC ??SoftUartRxOneFrame_5
- 31 ucSoftUartRxData |= BIT7;//BIT7;//(1<<ucGeneralCount);//set Rx bit
- 000050 7AD08000 BIS.B #0x80, R10
- 000054 053C JMP ??SoftUartRxOneFrame_6
- 32 else
- 33 {ucSoftUartRxData &= ~BIT7;__no_operation();__no_operation();__no_operation();}//~BIT7;//~(1<<ucGeneralCount);//set Rx bit
- ??SoftUartRxOneFrame_5:
- 000056 7AC08000 BIC.B #0x80, R10
- 00005A 0343 NOP
- 00005C 0343 NOP
- 00005E 0343 NOP
- 34
- 35 delay1us(2);//SoftUartDelayHalf();
- ??SoftUartRxOneFrame_6:
- 000060 2C43 MOV.W #0x2, R12
- 000062 B012.... CALL #delay1us
- 36 __no_operation();
- 000066 0343 NOP
- 37 __no_operation();
- 000068 0343 NOP
- 38 __no_operation();
- 00006A 0343 NOP
- 39 __no_operation();
- 00006C 0343 NOP
- 40 __no_operation();
- 00006E 0343 NOP
- 41 }
- 000070 5B53 ADD.B #0x1, R11
- 000072 E43F JMP ??SoftUartRxOneFrame_1
- 42 //delay1us(6);
- 43 while ((SOFTUART_PORT_IN & bitSOFTUARTRX) != bitSOFTUARTRX) //wait stop bit High
- ??SoftUartRxOneFrame_2:
- 000074 E2B33400 BIT.B #0x2, &0x34
- 000078 122C JC ??SoftUartRxOneFrame_4
- 44 {
- 45 if ((SOFTUART_PORT_IN & bitSOFTUARTRX) == bitSOFTUARTRX)
- 00007A E2B33400 BIT.B #0x2, &0x34
- 00007E 0F2C JC ??SoftUartRxOneFrame_4
- 46 break;
- 47 gucFrhErrorStatus=0x00;//
- 000080 C243.... MOV.B #0x0, &gucFrhErrorStatus
- 48 if (gwTimeOverflowCount++ == 0xffff)
- 000084 1E42.... MOV.W &gwTimeOverflowCount, R14
- 000088 1F43 MOV.W #0x1, R15
- 00008A 0F5E ADD.W R14, R15
- 00008C 824F.... MOV.W R15, &gwTimeOverflowCount
- 000090 3E93 CMP.W #0xffff, R14
- 000092 F023 JNE ??SoftUartRxOneFrame_2
- 49 {gucFrhErrorStatus=0x03;gwTimeOverflowCount=0;break;}
- 000094 F2400300.... MOV.B #0x3, &gucFrhErrorStatus
- 00009A 8243.... MOV.W #0x0, &gwTimeOverflowCount
- 50 }
- 51 //delay1us(6);//SoftUartDelay();
- 52 }
- 53 return ucSoftUartRxData;
- ??SoftUartRxOneFrame_4:
- 00009E 4C4A MOV.B R10, R12
- 0000A0 3B41 POP.W R11
- 0000A2 3A41 POP.W R10
- 0000A4 3041 RET
- 54 }
- 55
- In segment CODE, align 2, keep-with-next
- 56 void SoftUartTxOneFrame(unsigned char ucSoftUartTxData)
- SoftUartTxOneFrame:
- 57 {
- 000000 0A12 PUSH.W R10
- 000002 0B12 PUSH.W R11
- 000004 4A4C MOV.B R12, R10
- 58 unsigned char ucGeneralCount=0;
- 000006 4B43 MOV.B #0x0, R11
- 59 __disable_interrupt();
- 000008 32C2 DINT
- 60 SOFTUART_PORT_OUT &= ~bitSOFTUARTTX; //reset Tx bit
- 00000A D2C33500 BIC.B #0x1, &0x35
- 61 delay1us(7);//115 9600//57 19200//17 57600 //7 115200
- 00000E 3C400700 MOV.W #0x7, R12
- 000012 B012.... CALL #delay1us
- 62 //__no_operation();
- 63 //__no_operation();
- 64 //__no_operation();
- 65 //delay1us(8);
- 66 for (ucGeneralCount=0;ucGeneralCount<8;ucGeneralCount++)
- 000016 4B43 MOV.B #0x0, R11
- ??SoftUartTxOneFrame_0:
- 000018 7B92 CMP.B #0x8, R11
- 00001A 132C JC ??SoftUartTxOneFrame_1
- 67 {
- 68
- 69 if ((ucSoftUartTxData & BIT0) == BIT0)
- 00001C 5AB3 BIT.B #0x1, R10
- 00001E 0328 JNC ??SoftUartTxOneFrame_2
- 70 {SOFTUART_PORT_OUT |= bitSOFTUARTTX;} //set Tx bit
- 000020 D2D33500 BIS.B #0x1, &0x35
- 000024 053C JMP ??SoftUartTxOneFrame_3
- 71 else
- 72 {SOFTUART_PORT_OUT &= ~bitSOFTUARTTX;__no_operation();__no_operation();__no_operation();} //reset Tx bit
- ??SoftUartTxOneFrame_2:
- 000026 D2C33500 BIC.B #0x1, &0x35
- 00002A 0343 NOP
- 00002C 0343 NOP
- 00002E 0343 NOP
- 73 delay1us(6);//115 9600 //56 19200//16 57600 //6 115200
- ??SoftUartTxOneFrame_3:
- 000030 3C400600 MOV.W #0x6, R12
- 000034 B012.... CALL #delay1us
- 74 //__no_operation();
- 75 __no_operation();
- 000038 0343 NOP
- 76 ucSoftUartTxData=ucSoftUartTxData>>1;
- 00003A 12C3 CLRC
- 00003C 4A10 RRC.B R10
- 77
- 78 }
- 00003E 5B53 ADD.B #0x1, R11
- 000040 EB3F JMP ??SoftUartTxOneFrame_0
- 79 __no_operation();
- ??SoftUartTxOneFrame_1:
- 000042 0343 NOP
- 80 __no_operation();
- 000044 0343 NOP
- 81 SOFTUART_PORT_OUT |= bitSOFTUARTTX; //set Tx bit
- 000046 D2D33500 BIS.B #0x1, &0x35
- 82 delay1us(7);//115 9600 //17 57600//7 115200
- 00004A 3C400700 MOV.W #0x7, R12
- 00004E B012.... CALL #delay1us
- 83 _EINT(); //enable interrupt
- 000052 32D2 EINT
- 84 }
- 000054 3B41 POP.W R11
- 000056 3A41 POP.W R10
- 000058 3041 RET
- 85
- 86
- In segment CODE, align 2, keep-with-next
- 87 void SoftUartDelay7us(void)
- SoftUartDelay7us:
- 88 {
- 89 unsigned wGeneralCount=0;
- 000000 0E43 MOV.W #0x0, R14
- 90 //BauRate1200 wGeneralCount<831 BauRate9600 wGeneralCount<96 BauRate115200 6 42 19200
- 91 for (wGeneralCount=0;wGeneralCount<4;wGeneralCount++)
- 000002 0E43 MOV.W #0x0, R14
- ??SoftUartDelay7us_0:
- 000004 2E92 CMP.W #0x4, R14
- 000006 032C JC ??SoftUartDelay7us_1
- 92 {
- 93 __no_operation();
- 000008 0343 NOP
- 94 }
- 00000A 1E53 ADD.W #0x1, R14
- 00000C FB3F JMP ??SoftUartDelay7us_0
- 95
- 96 }
- ??SoftUartDelay7us_1:
- 00000E 3041 RET
- 97
- In segment CODE, align 2, keep-with-next
- 98 void SoftUartDelay8p7us(void)
- SoftUartDelay8p7us:
- 99 {
- 100 unsigned wGeneralCount=0;
- 000000 0E43 MOV.W #0x0, R14
- 101 //BauRate1200 wGeneralCount<831 BauRate9600 wGeneralCount<96 BauRate115200 6 42 19200
- 102 for (wGeneralCount=0;wGeneralCount<4;wGeneralCount++)
- 000002 0E43 MOV.W #0x0, R14
- ??SoftUartDelay8p7us_0:
- 000004 2E92 CMP.W #0x4, R14
- 000006 042C JC ??SoftUartDelay8p7us_1
- 103 {
- 104 __no_operation();
- 000008 0343 NOP
- 105 __no_operation();
- 00000A 0343 NOP
- 106 }
- 00000C 1E53 ADD.W #0x1, R14
- 00000E FA3F JMP ??SoftUartDelay8p7us_0
- 107
- 108 }
- ??SoftUartDelay8p7us_1:
- 000010 3041 RET
- 109
- In segment CODE, align 2, keep-with-next
- 110 void SoftUartDelay(void)
- SoftUartDelay:
- 111 {
- 112 unsigned wGeneralCount=0;
- 000000 0E43 MOV.W #0x0, R14
- 113 //BauRate1200 wGeneralCount<831 BauRate9600 wGeneralCount<96 BauRate115200 6 42 19200
- 114 for (wGeneralCount=0;wGeneralCount<96;wGeneralCount++)
- 000002 0E43 MOV.W #0x0, R14
- ??SoftUartDelay_0:
- 000004 3E906000 CMP.W #0x60, R14
- 000008 032C JC ??SoftUartDelay_1
- 115 {
- 116 __no_operation();
- 00000A 0343 NOP
- 117 }
- 00000C 1E53 ADD.W #0x1, R14
- 00000E FA3F JMP ??SoftUartDelay_0
- 118 }
- ??SoftUartDelay_1:
- 000010 3041 RET
- 119
- In segment CODE, align 2, keep-with-next
- 120 void SoftUartDelayHalf(void)
- SoftUartDelayHalf:
- 121 {
- 122 unsigned wGeneralCount=0;
- 000000 0E43 MOV.W #0x0, R14
- 123 for (wGeneralCount=0;wGeneralCount<48;wGeneralCount++)//BauRate1200 wGeneralCount<831 BauRate9600 wGeneralCount<96
- 000002 0E43 MOV.W #0x0, R14
- ??SoftUartDelayHalf_0:
- 000004 3E903000 CMP.W #0x30, R14
- 000008 032C JC ??SoftUartDelayHalf_1
- 124 {
- 125 __no_operation();
- 00000A 0343 NOP
- 126 }
- 00000C 1E53 ADD.W #0x1, R14
- 00000E FA3F JMP ??SoftUartDelayHalf_0
- 127
- 128 }
- ??SoftUartDelayHalf_1:
- 000010 3041 RET
- 129
- In segment CODE, align 2, align-sorted
- 130 void Delay1us(void)
- Delay1us:
- 131 {
- 132 __no_operation();
- 000000 0343 NOP
- 133 __no_operation();
- 000002 0343 NOP
- 134 __no_operation();
- 000004 0343 NOP
- 135 __no_operation();
- 000006 0343 NOP
- 136 __no_operation();
- 000008 0343 NOP
- 137 __no_operation();
- 00000A 0343 NOP
- 138 __no_operation();
- 00000C 0343 NOP
- 139 __no_operation();
- 00000E 0343 NOP
- 140
- 141 }
- 000010 3041 RET
- Maximum stack usage in bytes:
- Function CSTACK
- -------- ------
- Delay1us 2
- SoftUartDelay 2
- SoftUartDelay7us 2
- SoftUartDelay8p7us 2
- SoftUartDelayHalf 2
- SoftUartRxOneFrame 6
- -> delay1us 6
- -> delay1us 6
- -> delay1us 6
- SoftUartTxOneFrame 6
- -> delay1us 6
- -> delay1us 6
- -> delay1us 6
- Segment part sizes:
- Function/Label Bytes
- -------------- -----
- P1IN 1
- P6IN 1
- P6OUT 1
- SoftUartRxOneFrame 166
- SoftUartTxOneFrame 90
- SoftUartDelay7us 16
- SoftUartDelay8p7us 18
- SoftUartDelay 18
- SoftUartDelayHalf 18
- Delay1us 18
-
- 344 bytes in segment CODE
- 3 bytes in segment DATA16_AN
-
- 344 bytes of CODE memory
- 0 bytes of DATA memory (+ 3 bytes shared)
- Errors: none
- Warnings: none