;
;
;                    chip_erase.txt
;
;    
;
;  "  "
;
;      PGX051
;   chip_erase.hex
;
;------------------------------------------------------------
;   #cmd_chip_erase (upgm_m0.txt)
;
 chip_erase:
     ELL_ON
     LLPRINT reinfo ;    
     setb data_key ;   data_key=1
     mov data_t,#cmd_chip_erase ;     R7
     orl P1,#1<<combas_3
     anl P1,#low ~(1<<combus_5 || 1<<combus_7)
		      ;  combas_3=1, combus_5=combus_7=0 
		      ; * c51asm   "~"   *
     acall pspi_txd ;  
     acall pspi_rxd ;   
     LLPRINT str3 ;"is it successfully executed"
		        ;     
		 orl P1,#(1<<combas_3 || 1<<combus_5 || 1<<combus_7)
				 ;  combas_3=combus_5=combus_7=1
    ELL_OFF ;
   mov a,#0xA5
   cjne a,data_t,chip_erase_er ;     
   ajmp res_user ;       
 chip_erase_er:
   LLPRINT str2 ; "FATAL ERROR"
   ajmp res_user ;       
;