| ??? 02/23/06 20:14 Read: times |
#110628 - Not sufficient!!! Responding to: ???'s previous message |
Hi,
flash_Erase: MOV R7,#00 ; RAM POINTER
MOV R3,#64 ; 64 BYTES TO BE ERASED
MOV FMCON,#00H ; "LOAD" COMMAND
MOV FMADRH,#04H; ADDRESS HIGH
MOV FMADRL,#40H; ADDRESS LOW
MOV A,R7
MOV R0,A
LOAD_PAGE: MOV FMDATA,@R0
INC R0
DJNZ R3,LOAD_PAGE
MOV FMCON,#68H; "ERASE" COMMAND FOR 89LPC952
MOV R7,FMCON ; TO READ STATUS MOV A,R7
ANL A,#0FH; CHECK THE STATUS OF FMCON
JNZ BAD ; REGISTER AND IF ERASED IT IS ZERO
CLR C
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MOV R3,#64 ; 64 BYTES TO BE ERASED
MOV FMCON,#00H ; "LOAD" COMMAND
MOV FMADRH,#04H; ADDRESS HIGH
MOV FMADRL,#40H; ADDRESS LOW
LOAD_PAGE1: MOV FMDATA,#32H ; TO WRITE "32H" TO ADDRESS 0440H
DJNZ R3,LOAD_PAGE1; TO 0480H
RET
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
BAD: SETB C ; SET THE CARRY REGISTER IF NOT
RET ; ANY ERROR FOUND IN PROGRAMMING
The additional code which I have written should write "32h" to the code memory address 0440h to 0480h but when i ran the complied code I did not see the value "32h" being written to the addresses 440h to 480h.Obviously there is something else to this...probably a command for FMCON to write the values....(for example 68h for erase). Does anyone know this command? Thanks, Shruthi |
| Topic | Author | Date |
| 89LPC952 FLASH PROGRAMMING | 01/01/70 00:00 | |
| Notes on posting code | 01/01/70 00:00 | |
| rewrritten code 89LPC952 IAP code | 01/01/70 00:00 | |
| what more do you need | 01/01/70 00:00 | |
| Not sufficient!!! | 01/01/70 00:00 | |
| how did you not "see" that? | 01/01/70 00:00 | |
| I have written the code.... | 01/01/70 00:00 | |
| Looks to me like | 01/01/70 00:00 | |
| I have written the code | 01/01/70 00:00 | |
| How can writing a constant be "the next" | 01/01/70 00:00 | |
| Oh I see... | 01/01/70 00:00 | |
| Disreguard previous post | 01/01/70 00:00 | |
| a hint | 01/01/70 00:00 | |
| updated code for 89LPC952 IAP | 01/01/70 00:00 | |
| The above correction ('ONE' should be '1 | 01/01/70 00:00 | |
| Ok... | 01/01/70 00:00 | |
| That's exactly my question | 01/01/70 00:00 | |
| How about.... | 01/01/70 00:00 | |
| Thanks it worked!! | 01/01/70 00:00 | |
You're welcome | 01/01/70 00:00 | |
| Neat | 01/01/70 00:00 | |
| If we go there, then | 01/01/70 00:00 |



