??? 10/11/06 17:14 Read: times |
#126222 - P89V51 IAP (access) Responding to: ???'s previous message |
Jan is correct...
I am thinking you haven't got the concept of how the P89v51 IAP works. 1. There are 2 flash code areas on an P89v51 a. The main (user) executable area. starts 0x0000 b. the IAP function calls area. The P89v51 can execute code from either of these areas. 2. After Reset After reset + 400mS (typically) the P89v51 starts executing your code from 0x0000 like any normal 80c51 micro. 3. IAP Flash Programming To esase, program etc parts of the main (user) flash code area... you have to call the IAP function call flash area. 4. Accessing the IAP. Under normal user code execution the IAP is "swaped out" and can not be reached.. To get access to the IAP... you need to "swap it in" The IAP is "swaped in" by some SFR commands (the ones Jan mentions above). The IAP is swaped in (mapped) to address 0x0000 to 0x1FFF... hence your user code should be above 0x2000 when calling the IAP functions. 5. Now that you have mapped the IAP function calls in the address range 0x0000 to 0x1FFF - You can set up the registers and make calls to IAP to erase, program etc... as described in 7.2.6 *** S stress all interupts should be turned off during IAP flash programming. 6. Don't forget to "swap out" the IAP flash area so that normal execution of your user code can continune from address 0x000 to 0x1FFF I hope I haven't confused you... joe |