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

📄 s12xe_flash.lst

📁 freescale 协处理器应用相关实例
💻 LST
📖 第 1 页 / 共 3 页
字号:
  003a 270b         [3/1]   BEQ   *+13 ;abs = 0047
  108:        		      FTM.fccob.word = ccob4; 			/* Write next data word to CCOB buffer. */
  003c ec85         [3]     LDD   5,SP
  003e 071e         [4]     BSR   *+32 ;abs = 005e
  109:                    if(++FTM.fccobix.byte != params) 
  0040 2705         [3/1]   BEQ   *+7 ;abs = 0047
  110:           		      FTM.fccob.word = ccob5; 			/* Write next data word to CCOB buffer. */
  0042 ec80         [3]     LDD   0,SP
  0044 7c0000       [3]     STD   FTM:10
  111:                 } 											
  112:              }  
  113:  	      }
  114:        }
  115:  	   FTM.fccobix.byte = params-1;				
  0047 e68f         [3]     LDAB  15,SP
  0049 53           [1]     DECB  
  004a 7b0000       [3]     STAB  FTM:2
  116:  					
  117:  					/* Clear command buffer empty flag by writing a 1 to it */
  118:  		FTM.fstat.byte = CCIF;
  004d c680         [1]     LDAB  #128
  004f 7b0000       [3]     STAB  FTM:6
  119:        while (!FTM.fstat.bit.ccif) {					/* wait for the command to complete */
  0052 1f000080fb   [5]     BRCLR FTM:6,#128,*+0 ;abs = 0052
  120:        } 
  121:     	    /* Return status. */
  122:     	return(FTM.fstat.byte);										/* programmed OK */
  0057 f60000       [3]     LDAB  FTM:6
  005a 21           [1]     SKIP1 
  123:  	} 
  124:  	else 
  125:  	{
  126:  	   return(FLASH_BUSY);								/* state machine busy */
  005b c7           [1]     CLRB  
  127:  	}
  128:  }
  005c 30           [3]     PULX  
  005d 0a           [7]     RTC   
  005e 7c0000       [3]     STD   FTM:10
  0061 720000       [4]     INC   FTM:2
  0064 f60000       [3]     LDAB  FTM:2
  0067 87           [1]     CLRA  
  0068 34           [2]     PSHX  
  0069 acb1         [3]     CPD   2,SP+
  006b 3d           [5]     RTS   
  129:  
  130:  /******************************************************************************
  131:  Function Name	:	ProgramP_FlashPhraseAtPtr
  132:  Engineer		:	r32151
  133:  Date			:	15/12/06
  134:  Arguments	:	*__far progAdr		Global pointer to the Flash location to be 
  135:                                   programmed - must be on a /8 boundary
  136:  					* data            16-bit data to be programmed
  137:  
  138:  Notes			:	This function must be located in RAM or a flash block not 
  139:  					being programmed.
  140:  ******************************************************************************/
  141:  tU08
  142:  ProgramP_FlashPhraseAtPtr(tU16 *__far progAdr, tU16 *data)
  143:  {

Function: ProgramP_FlashPhraseAtPtr
Source  : D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\Sources\S12XE_Flash.c
Options : -CPUHCS12XE -D__FAR_DATA -D__NO_FLOAT__ -Env"GENPATH=D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\bin;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\prm;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\cmd;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\Sources;C:\Program Files\Freescale\CW for HC12 V4.5\lib\HC12c\lib;C:\Program Files\Freescale\CW for HC12 V4.5\lib\HC12c\src;C:\Program Files\Freescale\CW for HC12 V4.5\lib\xgatec\lib;*C:\Program Files\Freescale\CW for HC12 V4.5\lib\xgatec\src;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\Sources\Configuration;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\defs_XEx100_M22E;C:\Program Files\Freescale\CW for HC12 V4.5\lib\HC12c\include;C:\Program Files\Freescale\CW for HC12 V4.5\lib\xgatec\include" -Env"LIBPATH=D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\bin;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\prm;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\cmd;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\Sources;C:\Program Files\Freescale\CW for HC12 V4.5\lib\HC12c\lib;C:\Program Files\Freescale\CW for HC12 V4.5\lib\HC12c\src;C:\Program Files\Freescale\CW for HC12 V4.5\lib\xgatec\lib;*C:\Program Files\Freescale\CW for HC12 V4.5\lib\xgatec\src;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\Sources\Configuration;D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\defs_XEx100_M22E;C:\Program Files\Freescale\CW for HC12 V4.5\lib\HC12c\include;C:\Program Files\Freescale\CW for HC12 V4.5\lib\xgatec\include" -Env"OBJPATH=D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\bin" -Env"TEXTPATH=D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\bin" -Lasm=%n.lst -Mb -ObjN="D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\Example_9_Data\Flash_P&E_target\ObjectCode\S12XE_Flash.c.o" -WmsgSd1106

  0000 3b           [2]     PSHD  
  144:  													      /* Clear any error flags*/	
  145:     FTM.fstat.byte = (FPVIOL | ACCERR); 
  0001 cc0630       [2]     LDD   #1584
  0004 7b0000       [3]     STAB  FTM:6
  146:  
  147:             /* Write the program command and the GPAGE part */
  148:  	FTM.fccobix.byte = 0;
  0007 790000       [3]     CLR   FTM:2
  149:  	FTM.fccob.byte.hi = PROGRAM_P_FLASH;
  000a 7a0000       [3]     STAA  FTM:10
  150:  	FTM.fccob.byte.lo = WP_PAGE(progAdr);
  000d e685         [3]     LDAB  5,SP
  000f 7b0000       [3]     STAB  FTM:11
  151:  				/* Write the 16-bit address part of phrase */
  152:  	FTM.fccobix.byte++;
  0012 720000       [4]     INC   FTM:2
  153:  	FTM.fccob.word = WP_ADDR(progAdr); 
  0015 ec86         [3]     LDD   6,SP
  0017 7c0000       [3]     STD   FTM:10
  154:  
  155:  	FTM.fccobix.byte++;
  001a 720000       [4]     INC   FTM:2
  156:     FTM.fccob.word = *data++;						/* Write next data word to CCOB buffer. */
  001d ee80         [3]     LDX   0,SP
  001f 0718         [4]     BSR   *+26 ;abs = 0039
  157:  
  158:  	FTM.fccobix.byte++;
  159:     FTM.fccob.word = *data++;						/* Write next data word to CCOB buffer. */
  0021 0716         [4]     BSR   *+24 ;abs = 0039
  160:  
  161:  	FTM.fccobix.byte++;
  162:     FTM.fccob.word = *data++;						/* Write next data word to CCOB buffer. */
  0023 0714         [4]     BSR   *+22 ;abs = 0039
  163:  
  164:  	FTM.fccobix.byte++;
  165:     FTM.fccob.word = *data;  						/* Write next data word to CCOB buffer. */
  0025 ec00         [3]     LDD   0,X
  0027 7c0000       [3]     STD   FTM:10
  166:  															/* Clear command buffer empty flag by writing a 1 to it
  167:  															   This launches the command. */
  168:  	FTM.fstat.byte = CCIF;
  002a c680         [1]     LDAB  #128
  002c 7b0000       [3]     STAB  FTM:6
  169:     while (!FTM.fstat.bit.ccif) {					/* wait for the command to complete */
  002f 1f000080fb   [5]     BRCLR FTM:6,#128,*+0 ;abs = 002f
  170:     } 
  171:  
  172:     return(FTM.fstat.byte);							/* return status */
  0034 f60000       [3]     LDAB  FTM:6
  173:  }
  0037 30           [3]     PULX  
  0038 0a           [7]     RTC   
  0039 ec31         [3]     LDD   2,X+
  003b 7c0000       [3]     STD   FTM:10
  003e 720000       [4]     INC   FTM:2
  0041 3d           [5]     RTS   
  174:  
  175:  /******************************************************************************
  176:  Function Name	:	ProgramP_FlashPhrase
  177:  Engineer		:	r32151
  178:  Date			:	15/12/06
  179:  Arguments	:	gpage		GPAGE of phrase to be programmed 
  180:                 addr     16-bit part of global addreess of phrase to be 
  181:                          programmed - must be on a /8 boundary
  182:  					* data            16-bit data to be programmed
  183:  Notes			:	This function must be located in RAM or a flash block not 
  184:  					being programmed.
  185:  ******************************************************************************/
  186:  tU08
  187:  ProgramP_FlashPhrase(tU08 gpage, tU16 addr, tU16 *data)
  188:  {

Function: ProgramP_FlashPhrase
Source  : D:\Profiles\b06321\My Documents\S12X\S12XE - Sailfish\Training\Training REV0\Solutions\Example 9\Sources\S12XE_Flash.c

⌨️ 快捷键说明

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