Hello,
The IAP code from this site works for the P89LPC9221 with a few modifications. PGM_MTP has to be FF03h instead of FF00h. I discovered that the code from the code memory was read out the right way when I changed PGM_MTP. I was still not able to write to the memory after I modified PGM_MTP. In the user manual there is a note about an authorization key. You must set the authorization key before you process any write/erase procedures. I added these 2 commands at every write/erase procedure (before the write/erase lcall instruction):
MOV R0,#0FFH ; IAP authorization key.
MOV @R0,#96H
Everything works after these modifications. I hope this will help somebody else.
Kind regards,
Mark
Post Edited (02-28-06 07:14)
The IAP code from this site works for the P89LPC9221 with a few modifications. PGM_MTP has to be FF03h instead of FF00h. I discovered that the code from the code memory was read out the right way when I changed PGM_MTP. I was still not able to write to the memory after I modified PGM_MTP. In the user manual there is a note about an authorization key. You must set the authorization key before you process any write/erase procedures. I added these 2 commands at every write/erase procedure (before the write/erase lcall instruction):
MOV R0,#0FFH ; IAP authorization key.
MOV @R0,#96H
Everything works after these modifications. I hope this will help somebody else.
Kind regards,
Mark
Post Edited (02-28-06 07:14)