亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? f51mble2.a51

?? iap_sst89c58.zip:--------SST89C58/54單片機的iap在線編程/在線下載監控程序源程序(KC51)
?? A51
?? 第 1 頁 / 共 2 頁
字號:
;************************************************************************
;*        	   SST FlashFlex51 Boot-Strap Loader     		*
;*			(F51MBLE2.A51) 					*
;*			 Version 1.1D					*
;*									*
;* NOTE:								*
;* 1. This firmware code is for SST89C5x MCU with an external crystal 	*
;*    of 11.0592 MHz and a 38.4 Kbps baud setting for serial port.  	*
;* 2. This code is referred as the "Internal Memory Mode" by the PC.	*
;*									*
;************************************************************************
;* Developer: 	Frank Cirimele						*
;*		SST Embedded Controller Application Engineering		*
;*									*
;* Contact:	Silicon Storage Technology Inc.				*
;*		1171 Sonora Court					*
;*		Sunnyvale, CA 94086					*
;*		phone: 	(408)522-7352					*
;*		fax:	(408)749-9658					*
;*		email: 	cirimele@ssti.com				*
;*									*
;* Original Code Release Date: 5-15-00					*
;* Update Code Release Date: 9-12-2000                                  *
;*     Instruction that changes the re-mapping should be in the portion *
;*   of memory that is not affected by the re-mapping change.           *  
;*									*
;************************************************************************

$INCLUDE	(F51MBLE2.INC)
$INCLUDE	(REG52A.inc)

;
; (SECTOR 0 in BLOCK 1) Reset and interrupt vectors


bsl_main_pgm:

        org 0F000h       	; reset vector entered on bootup
				;  or system reset
        ajmp bsl_cold_start  	; jump to cold-boot code

        org 0F003h       	; external interrupt 0 vector
        reti		      	; disable interrupt

        org 0F00Bh       	; timer 0 overflow vector
        reti		      	; disable interrupt

        org 0F013h       	; external interrupt 1 vector
        reti		      	; disable interrupt

        org 0F01Bh       	; timer 1 overflow vector
        reti		      	; disable interrupt
        
        org 0F023h       	; serial I/O interrupt vector
        ljmp bsl_rs232		; jump to block 1 rs232 ISR for bootcode

	org 0F02Bh		; timer 2 overflow vector
	reti		      	; disable interrupt

;
;
	org 0F030h              ; Instruction that changes the re-mapping 
				; should be in the portion of memory that 
				; is not affected by the re-mapping change.

bsl_cold_start:
	orl  SFCF, #0C0h	; Enable BLOCK 1 flash, IAP operation and
				;  set MAP_EN[1:0]=01b to enable the 
				;  remapping of 1 KByte flash memory.
                                ; The memory-remapping affects only the 
				;  program counter.
;************************************************************************									
;*		      	 BOOT CODE OR USER CODE?			*								*
;************************************************************************
;
; Check the logic level at port 1 bit 0 (P1.0)
;  If P1.0 = LOW, then Continue with Boot Code
;  Else Go to User Code: enable block 1 flash but disable IAP operation,   
;   turn off re-mapping to allow program memory in normal configuration.
        
	jnb  P1.0, run_code	; continue run_code if P1.0=LOW
	ljmp usercode
				 
;************************************************************************
;*									*
;*		      	     DO FOREVER LOOP				*
;*									*
;************************************************************************
;*									*
;* The Do Forever Loop software has the task of interacting with the PC *
;* over the UART serial communication link.  It has the capability to 	*
;* respond to the pseudo commands sent from the host PC and issues one 	*
;* of eight IAP commands used by the code:				*
;*									*
;*	(1) Erase Flash Memory (Sector Erase)- PC issues sector by 	*
;*	    sector.							*
;*		INPUTS:  Starting Sector Address			*
;*		RETURNS: Send FLAGS byte to PC				*
;*		INPUT CMD FORMAT:					*
;*			Byte 1: IAP Cmd ID = 0Bh			*
;*			Byte 2: Starting Address High Byte		*
;*			Byte 3: Starting Address Low Byte		*
;*			Byte 4: Count of sector				*
;*									*
;*	(2) Program Flash Memory (Program Byte)				*
;*		INPUTS:	(1) Starting Address				*
;*			(2) Sector Byte Count				*
;*			(3) String of Sector Data Bytes			*
;*		RETURNS: (1) Send FLAGS byte to PC after each byte	*
;*			       been programmed				*
;*			 (2) Send FLAGS byte to PC after count of	*
;*				sector byte completed			*
;*		INPUT CMD FORMAT:					*
;*			Byte 1: IAP Cmd ID = 0Eh			*
;*			Byte 2: Starting Address High Byte		*
;*			Byte 3: Starting Address Low Byte		*
;*			Byte 4: No. of Sector Bytes 			*
;*			Byte 5: Data 1					*
;*			Byte 6: Data 2					*
;*			Byte 7: Data 3					*
;*				o					*
;*				o					*
;*				o					*
;*			Byte N: Data N - 4				*
;*									*
;*	(3) Read Byte (Verify Byte)					*
;*		INPUTS:  Starting Address, Byte Length to Read		*
;*		RETURNS: Data Bytes Requested				*	
;*		INPUT CMD FORMAT:					*
;*			Byte 1:	IAP Cmd ID = 0Ch	 		*
;*			Byte 2: Starting Address High Byte		*
;*			Byte 3: Starting Address Low Byte		*
;*			Byte 4: No. of Sector Bytes			*
;*									*
;*		RESPONSE FORMAT:					*
;*			Byte 1: Data byte 1				*
;*			Byte 2: Data byte 2				*
;*				   o					*
;*				   o					*
;*				   o					*
;*			Byte N: Data byte N				*
;*									*
;*	(4) Block Erase - Erase block 0 of flash memory			*
;*		INPUTS: Starting Address High Byte of block 0  		*
;*		RETURNS: Send FLAGS byte to PC				*
;*		INPUT CMD FORMAT:					*
;*			Byte 1: IAP Cmd ID = 0Dh			*
;*			Byte 2: Starting Address High Byte of block 0	*
;*			Byte 3: 00h or Don't care			*
;*			Byte 4: 01h or Don't care			*
;*									*
;*	(5) Program Flash Memory (Burst program)			*
;*		INPUTS:	(1) Starting Address				*
;*			(2) Row(one-half of a sector) Byte Count 	*
;*			(3) String of Sector Data Bytes			*
;*		RETURNS: Send FLAGS byte to PC after each row		*
;*			 been programmed				*
;*		INPUT CMD FORMAT:					*
;*			Byte 1: IAP Cmd ID = 06h			*
;*			Byte 2: Starting Address High Byte		*
;*			Byte 3: Starting Address Low Byte		*
;*			Byte 4: No. of Row Bytes 			*
;*			Byte 5: Data 1					*
;*			Byte 6: Data 2					*
;*			Byte 7: Data 3					*
;*				o					*
;*				o					*
;*				o					*
;*			Byte N: Data N - 4				*
;*									*
;*	(6) Security Lock - This cmd sets the security bit to one of   	*
;*	    lock states on the next system reset:                       *
;*		INPUTS: Security bit selection				*
;*		RETURNS: Nothing                                        *
;*		INPUT CMD FORMAT:					*
;*			Byte 1: Pseudo Cmd ID = 04h			*
;*			Byte 2: Security bit selection			*
;*				00h: MCU executes IAP CMD 0Fh to 	*
;*				     program SB1                        *
;*				01h: MCU executes IAP CMD 03h to 	*
;*				     program SB2                        *
;*				02h: MCU executes IAP CMD 05h to 	*
;*				     program SB3                        *
;*		                                                        *
;*  For the Boot code, which follows, the MCU register assignments are	*
;*  the following:  							*
;*									*
;*	ro =	temporary reg #1					*
;*	r1 =	temporary reg #2					*
;*	r2 =	PC command						*
;*	r3 =	PC data							*
;*	r4 =	address high						*
;*	r5 =	address low						*
;*	r6 =	byte count						*
;*	r7 =	running counter						*
;*									*
;* Use of r7 for other than as the default stack pointer means that 	*
;* the stack pointer has to be assigned to a new location higher up 	*
;* in RAM early in this code.						*
;*									*
;************************************************************************

;************************************************************************
;*									*
;*		      	   INITIALIZATION CODE				*
;*									*
;************************************************************************

run_code:
	mov  PSW, #ZEROB	; initialize registers 
        mov  a, #ZEROB
        mov  SP, #60h		; move the stack 

        mov  IE, #ZEROB
        mov  IP, #ZEROB
        clr  RX			; clear software flags
        clr  TX
        
; Initialize serial port as 8-bits, 1 stop bit, NO parity check.
; For both 12.0 and 11.0592 MHz OSC, use Timer 2 for baud rate generator,
; which can generate 9.6K, 19.2K & 38.4K Baud.

 	anl  SCON, #00001100b
        orl  SCON, #01010000b 	; serial port mode 1 (8-bit UART), 
				;  enable receiver

       	mov  T2CON, #00110100b	; baud rate generator for 12.0/11.0592 MHz OSC, 
				; receive & transmit have the same baud rate, 
				; use timer 2, mode 34H

	;mov  RCAP2H, #11111111b ; 12.0 MHz OSC, for 9.6K bps use FFH
        ;mov  RCAP2L, #11011001b ; 12.0 MHz OSC, for 9.6K bps use D9H

	;mov  RCAP2H, #11111111b ; 11.0592 MHz OSC, for 9.6K bps use FFH
        ;mov  RCAP2L, #11011100b ; 11.0592 MHz OSC, for 9.6K bps use DCH
	;mov  RCAP2H, #11111111b ; 11.0592 MHz OSC, for 19.2K bps use FFH
        ;mov  RCAP2L, #11101110b ; 11.0592 MHz OSC, for 19.2K bps use EEH

	mov  RCAP2H, #11111111b ; 11.0592 MHz OSC, for 38.4K bps use FFH
        mov  RCAP2L, #11110111b ; 11.0592 MHz OSC, for 38.4K bps use F7H

        mov  PCON, #ZEROB	; SMOD (PCON.7) = 0 (single baud rate)
      
        setb ES			; enable serial port interrupt
        setb EA			; enable all unmasked interrupts
   
        clr  TI			; clear transmit flag
	clr  RI			; clear receive flag

        ljmp loop               ; continue the forever loop
               
;************************************************************************
;*									*
;*     	 WAITING FOR PC COMMANDS IF SYSTEM IS UNLOCKED OR SOFTLOCKED	*
;*									*
;************************************************************************
;*									*
;* IMPORTANT NOTE:  Beginning here, only ACALL and AJMP instructions 	*
;* can be used for the remainder of the bootcode, which allows it to 	*
;* be copied to and executed from another 2K memory space within the 	*
;* overall flash memory address	space.  THAT IS, NO LCALL AND LJMP	*
;* INSTRUCTIONS FROM HERE ON!!!!!!!!					*
;*									*
;************************************************************************

	org  0F080h
 
loop:
       	jnb  RX, $		; wait for command from PC
        clr  RX			; clear receive flag
        mov  a, B		; get command from B register
        mov  CMD, a

hand_shaking:

	cjne a, #05h, cmd1	; jump to cmd1 if status cmd sent from PC
                                ; start of hand_shaking routine
	mov  a, SFCF		; read SFCF to check status of MAP_EN(bit 1,0)
	anl  a, #00000011b	
	mov  r0, a
	mov  a, SFST		; read SFST to check status of SecByte        
	orl  a, r0		; combine SECD(bit 7,6,5) & MAP_EN(bit 1,0)
				;  into one byte and send to host PC
	jnb  TX, $		
	clr  TX
 	mov  SBUF, a          	; send content of SFST & MAP_EN to PC
                                ; end of hand_shaking routine

;************************************************************************
;*									*
;*	   SECURITY LOCKED OR OK TO RUN IAP COMMANDS?			*
;*									*
;************************************************************************
;
; Verify that the security lock is not 'HardLocked' before proceeding with 
; the bootcode, else set an error status flag bit for the PC indicating 
; "Unable to run IAP commands because system is HardLocked" and stay in 
; software trap indefinitely

lock_check:                       
	mov a, SFST		; read SFST to check status of SecByte 
	anl a, #M80		; mask for highest SECD bit
	cjne a, #M80, loop	; continue main loop if unLock/softLock
	setb ERR1		;  else set error bit1 in the FLAGS bit
	ajmp lock_check		;  and stay in software trap indefinitely

cmd1:
	mov  FLAGS, #0C0h	; re-initialize FLAGS byte....

	cjne a, #SFCM_SE, cmd2	; continue if sector erase command
				; else try next command				
	mov  r0, #01h
	ajmp cmd_proc		; go to command processing routine

cmd2: 	
	cjne a, #SFCM_PB, cmd3	; continue if program byte command
				;  else try next command
	mov  r0, #02h
	ajmp cmd_proc		; go to command processing routine

cmd3: 	
	cjne a, #SFCM_VB, cmd4  ; continue if verify byte command
				;  else try next command
	mov  r0, #03h
        ajmp cmd_proc		; go to command processing routine

cmd4: 	
	cjne a, #SFCM_BE, cmd5	; continue if block erase command
				;  else try next command
	mov  r0, #04h
	ajmp cmd_proc		; go to command processing routine

cmd5: 	
	cjne a, #SFCM_BP, cmd6	; continue if burst-program command
				;  else try next command
	mov  r0, #05h
	ajmp cmd_proc		; go to command processing routine


cmd6: 	
	cjne a, #SFCM_SL, cmd_err; continue if security-lock command
				;  else indicate an error
	mov  r0, #06h
	ajmp cmd_proc		; go to command processing routine

cmd_err:
	setb ERR3		; set err3 bit (FLAGS.5), which indicates
				;  an incorrect command number received
        ajmp loop	     	; return to run_code loop
        nop
        nop
        nop
        ajmp loop     		; software trap
       	nop
        nop
        nop
        ajmp loop	      	; software trap
        nop
        nop
        nop

;************************************************************************
;*									*
;*	     		   COMMAND PROCESSING			 	*
;*									*
;************************************************************************

cmd_proc:
	clr  c
	mov  a, r0		; verify that the input command number is 
	subb a, #07h		;  in the range 1 to 6, else exit
	jnc  cp_e

	cjne r0, #kmd6, cmd_in	; if security bit cmd - command 6 
	sjmp cp_6		; then skip remaining inputs

cmd_in:				; else command is in range 1 to 5
	jnb  RX, $		; get remaining(3 bytes) common inputs 
        clr  RX			;  for any of the commands 1 to 5:
        mov  a, B		;  1) input high address byte
        mov  ADRHI, a
	mov  DPH, a
      
	jnb  RX, $
        clr  RX
        mov  a, B		;  2) input low address byte
        mov  ADRLO, a
	mov  DPL, a
     
	jnb  RX, $
        clr  RX
        mov  a, B		;  3) input count
        mov  COUNT, a

	mov a, r0		; now decide which command to call
	cjne a, #kmd1, cp_2	; jump if not command 1
	acall sector_e		; go to sector erase routine
	sjmp cp_e

cp_2:	
	cjne a, #kmd2, cp_3	; jump if not command 2
	acall program_b		; go to program byte routine
	sjmp cp_e

cp_3:	
	cjne a, #kmd3, cp_4	; jump if not command 3
	acall verify_b		; go to verify byte routine
	sjmp cp_e

cp_4:	
	cjne a, #kmd4, cp_5	; jump if not command 4			
	acall block_e		; go to block erase rtn
        sjmp cp_e
              
cp_5:		                ; command = 5        
	acall burst_p		; go to burst program routine
	sjmp cp_e


cp_6:				; command = 6
	jnb  RX, $
        clr  RX
        mov  a, B		; input security bit selection 
        mov  PCDATA, a

	acall security_lock	; go to security lock routine

cp_e:	
	ajmp loop		; return to main loop

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美国产成人精品| 国产成人超碰人人澡人人澡| 久久成人羞羞网站| 色综合天天视频在线观看| 欧美大胆一级视频| 一区二区成人在线视频| 国产一区二区不卡在线| 国产综合色在线视频区| 欧美私人免费视频| 国产偷国产偷精品高清尤物| 亚洲精选视频在线| 裸体歌舞表演一区二区| 欧美在线短视频| 久久久久久久综合| 日韩精品亚洲专区| 91一区二区在线| 日韩精品一区二区三区swag| 亚洲自拍偷拍图区| 不卡免费追剧大全电视剧网站| 91精品综合久久久久久| 亚洲精品福利视频网站| 丁香一区二区三区| 日韩三级视频在线看| 亚洲综合在线免费观看| 丁香一区二区三区| 国产网红主播福利一区二区| 青娱乐精品视频| 欧美午夜在线观看| 亚洲成a人片综合在线| 91久久精品网| 亚洲精品水蜜桃| 成人白浆超碰人人人人| www国产成人| 极品瑜伽女神91| 色视频欧美一区二区三区| 久久精品欧美日韩精品 | 欧美一区二区成人| 一级精品视频在线观看宜春院| 国产大片一区二区| 久久精品日韩一区二区三区| 日精品一区二区三区| 欧美午夜精品电影| 中文字幕日韩精品一区| 成人午夜电影网站| 国产午夜精品一区二区三区视频 | 亚洲视频一二区| 不卡在线观看av| 亚洲乱码中文字幕| 在线观看91视频| 亚洲国产精品综合小说图片区| 91免费在线看| 亚洲美女视频在线| 欧美日韩一级黄| 天天操天天色综合| 欧美一区二区三区不卡| 精品制服美女丁香| 久久女同精品一区二区| 国产91富婆露脸刺激对白| 国产精品国产三级国产aⅴ入口| 成人激情免费电影网址| 亚洲欧美日韩久久| 欧美挠脚心视频网站| 日韩精品免费专区| 日韩欧美一区在线| 国产99一区视频免费| 中文字幕一区在线| 99久久精品国产一区| 亚洲精品你懂的| 欧美精品777| 国产一区二区不卡老阿姨| 国产精品视频一二三区| 色哟哟国产精品免费观看| 天天爽夜夜爽夜夜爽精品视频| 欧美成人video| 国产精品白丝av| 亚洲欧美一区二区三区孕妇| 91精品午夜视频| 国产成人免费视频网站| 1024成人网色www| 欧美片在线播放| 国产91精品露脸国语对白| 亚洲国产一区二区三区| 久久久美女艺术照精彩视频福利播放| 成人av在线资源网站| 亚洲国产sm捆绑调教视频| 久久先锋影音av鲁色资源| 91色.com| 国产乱子伦视频一区二区三区| 亚洲精品久久久蜜桃| 欧美一区二区在线看| 91女厕偷拍女厕偷拍高清| 日日摸夜夜添夜夜添精品视频 | 日韩制服丝袜先锋影音| 日韩女优制服丝袜电影| 欧美主播一区二区三区美女| 国产精品一区二区免费不卡 | 亚洲尤物视频在线| 日韩一区二区三区av| caoporen国产精品视频| 国产另类ts人妖一区二区| 日本网站在线观看一区二区三区 | 中文字幕av一区二区三区免费看| 色av成人天堂桃色av| 国产精品2024| 欧美aⅴ一区二区三区视频| 亚洲婷婷在线视频| www国产亚洲精品久久麻豆| 在线成人小视频| 欧美性色欧美a在线播放| 成人理论电影网| 激情伊人五月天久久综合| 亚洲一区二区精品视频| 国产精品久久久久久亚洲伦| 精品久久久久香蕉网| 欧美丰满一区二区免费视频| 色av综合在线| 色婷婷av一区二区三区软件| 粉嫩高潮美女一区二区三区| 麻豆精品视频在线观看免费| 午夜精品一区在线观看| 亚洲欧美综合色| 精品美女在线观看| 欧美做爰猛烈大尺度电影无法无天| 一本大道久久a久久精品综合| 美女mm1313爽爽久久久蜜臀| 亚洲国产综合人成综合网站| 一区二区在线观看免费视频播放| 亚洲国产高清aⅴ视频| 国产精品色哟哟网站| 中文成人综合网| 国产精品日产欧美久久久久| 国产精品欧美综合在线| 国产精品福利一区二区三区| 国产精品三级av| 综合激情成人伊人| 一区二区在线观看av| 亚洲黄色性网站| 亚洲福利国产精品| 日韩主播视频在线| 久久精品国内一区二区三区| 另类的小说在线视频另类成人小视频在线 | 97久久久精品综合88久久| 国产成人av电影在线观看| 风间由美中文字幕在线看视频国产欧美| 国产自产v一区二区三区c| 国产一区二区久久| av在线这里只有精品| 91麻豆swag| 欧美美女网站色| 精品免费日韩av| 国产精品国产自产拍高清av| 亚洲女爱视频在线| 青娱乐精品视频在线| 国产 日韩 欧美大片| a亚洲天堂av| 欧美一三区三区四区免费在线看| 精品福利一区二区三区免费视频| 久久精品一区蜜桃臀影院| 成人欧美一区二区三区| 丝袜亚洲精品中文字幕一区| 麻豆精品精品国产自在97香蕉| 国产精品一区二区三区乱码| 国产一区二区0| 欧美系列亚洲系列| 精品毛片乱码1区2区3区| 一区二区三区在线视频免费| 久久国产精品露脸对白| 色一情一乱一乱一91av| 日韩丝袜美女视频| 中文字幕一区二区三区视频| 天天做天天摸天天爽国产一区| 国产精品一二三区在线| 91福利区一区二区三区| 久久久久久久网| 亚洲成在人线在线播放| 蜜桃传媒麻豆第一区在线观看| 精品亚洲国产成人av制服丝袜| 日本大香伊一区二区三区| 欧美日韩成人综合天天影院| 国产欧美日韩不卡| 蜜桃在线一区二区三区| 成人国产精品免费观看视频| 日韩一区二区三区电影在线观看 | 国产一区二区三区综合| 欧美人狂配大交3d怪物一区| 1024成人网色www| 韩国v欧美v日本v亚洲v| 欧美私人免费视频| 国产精品国产馆在线真实露脸 | 夜夜精品视频一区二区| 亚洲午夜电影在线观看| 国产在线精品免费| 欧美剧情电影在线观看完整版免费励志电影 | 国产精品一区一区三区| 欧美一区二区三区影视| 伊人开心综合网| 97久久精品人人爽人人爽蜜臀| 久久免费看少妇高潮| 蜜桃精品视频在线观看| 欧美猛男男办公室激情|