We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I am using P89V51RD2, and I am coding in C. I want my code to begin at address 0x2001. How can I do that with the help of C code?
The IAP is located in a parallel memory page to your application. That memory page has a size of 8K bytes and shares the address space 0x0000 - 0x1fff. By setting the flash bank select and calling into the IAP you are permitting the IAP (running in its memory page) to perform any operation you request on any memory within your microprocessor.
The key is making sure that you are not calling from an address that is in the parallel page address range. If your call is located in the overlaping address range, when you switch the flash bank bit, the next instruction executed will be from the IAP memory ... not your program.