Author Topic: IAP and P89LPC9221  (Read 3238 times)

markbng

  • Jr. Member
  • **
  • Posts: 3
    • View Profile
IAP and P89LPC9221
« on: February 24, 2006, 05:16:35 am »
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

  • Jr. Member
  • **
  • Posts: 3
    • View Profile
Re: IAP and P89LPC9221
« Reply #1 on: February 28, 2006, 06:11:14 am »
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)