??? 11/09/05 02:52 Read: times |
#103450 - 'sector erase' problem of P89LV51rd2 IAP |
Hi:
I get a problem when I use the ¡®sector erase¡¯ function of P89lv51rd2FA mcu¡¯s IAP. Once the mcu calls the PGM_MTP with the parameters of ¡®R1 = 08h, DPH = sector address MSB, DPL =sector address LSB¡¯, it will never return to the user¡¯s routines unless reset the mcu by a hardware reset. After that I read out the ROM and find that the calling dose erase the specifically sector. The other functions of IAP such as ¡®Read User Code¡¯ work well. My ¡®sector erase¡¯ routines are as follows: IAP_Erase_PAGE: PUSH ACC PUSH DPH PUSH DPL MOV R1,#08H ANL 0B1H,#0FCH MOV DPH, #MSB MOV DPL,#LSB LCALL 1FF0H MOV R7,A ORL 0B1H,#01H POP DPL POP DPH POP ACC RET END They are located at 0x2000 and I¡¯m sure the sector to be erased contains no routines so the erasing makes no affect to the whole program. The boot loader is ¡®P89V51RD2_BL_V05¡¯ from Phillips¡¯ web site. Here come my questions: 1. Is it my ¡®sector erase¡¯ routines or the boot loader or the MCU¡¯s problem which causes the ¡®not returning¡¯ problem? 2. How can I get out of the ¡®sector erase¡¯ IAP function without RESET? |
Topic | Author | Date |
'sector erase' problem of P89LV51rd2 IAP | 01/01/70 00:00 | |
interrupts, watchdog | 01/01/70 00:00 | |
Thank you!![]() | 01/01/70 00:00 |