IAP and P89LPC9221

Started by markbng, February 24, 2006, 05:16:35 AM

Previous topic - Next topic

markbng

Hello,

At the moment I am working on a project with a P89LPC9221 device. I want to use the IAP routines to update the processor. I wrote some IAP-lite routines and these routines work fine. The IAP routines from this site don

markbng

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)