PG7: MOV R4,A ;SAVE THE BYTE IN R4 for error detect MOV DPH,R2 ;load data pointer with eeprom address MOV DPL,R0 MOVX @DPTR,A ;write the byte DB 07DH ;mov r5,#0 ; ZRO: NOP ;SETTLEING TIME + FP ZERO ;hier NOP ;Atenttion. This 6 NOP's a not only ; NOP ;for settleing time, it is also the ; NOP ;floating point zero! ; NOP ; MOV TEMP5,#15 ;hier #12 ;DELAY 30uS AT 12 MHZ ; DJNZ TEMP5,$ ACALL TIMER_LOAD ;START THE TIMER JNB TF1,$ ;WAIT FOR PART TO PROGRAM movx A,@DPTR ;Read back for error detect xrl A,R4 ;Test for error jz PG31 djnz R5,ZRO PG31: RET ; ;************************************************************** ; PGU: ;PROGRAM A PROM FOR THE USER (statement 'PGM') ; ;************************************************************** ; MOV PSW,#00011000B ;SELECT RB3 CJNE R6,#0,PG10 SJMP PG1 ; ;***************************************************************************** ;****** The new command "ERASE" to fill a EEPROM with 0FFH ******************* ;****** Boehling 3 *********************************************************** ; CERASE: mov R7,#20H ;Erase 8K byte mov R6,#00H ;hier mov R2,#HIGH ROMADR-1 ;Startaddress EEPROM ;mov R0,#LOW ROMADR-1 mov DPTR,#PROGS ;Point to EEPROM timeing acall LD_T ;Load the timer MOV DPTR,#ROMADR-1 ;load data pointer with eeprom address ERA1: ;hier ;hier lcall INC3210 ;Bump pointers ; mov A,#0FFH ;Fill the EEPROM with 0FFH ; acall PG7 ;Write the byte ; jnz PG6 ;Exit if error ; DJNZ R6,ERA1 ; DJNZ R7,ERA1 ;Do the loop ; ajmp C_K ;Exit to command mode MOV A,#0FFH ;EEPROM mit FFh füllen MOV R4,A ;Zum Vergleich in ZRO MOV r1,#64 EraLoop: INC DPTR MOVX @DPTR,A ;write the byte DEC R6 DJNZ R1,EraLoop INC R6 ;hier acall PG7 ;Write the byte acall ZRO ;Speicherpage schreiben jnz PG6 ;Exit if error DJNZ R6,ERA1 DJNZ R7,ERA1 ;Do the loop ajmp C_K ;Exit to command mode