??? 10/11/06 13:53 Read: times |
#126206 - read the ... datasheet Responding to: ???'s previous message |
I assume you want to store some data in the internal FLASH of the controller itself during the program run, i.e. "reprogram itself", a.k.a. In Application Programming - IAP.
First, you want to read the datasheet. Concentrate on chapter 7.9, particularly 7.2.6 In-Application Programming method. It describes which commands you can use for IAP, and how should you set up the registers to use them. It is only hinted HOW to call the IAP, but basically it means to switch on the BOOT FLASH be present on addresses 0000-1FFF and then call to 1FF0h (IAP_PGM). There are examples available on SST's website, for this chip appears to be identical to a SST's chip. Caveat, stop the interrupts before you switch to the BOOT FLASH. An example of IAP call (as I use it in the P89V51RD2 port of BASIC52): ;there is an ORG 2000h somewhere above this FLASH_API: PUSH IE ;DISABLE INTERRUPTS CLR EA ANL FCF,#0FCh ;enable boot sector - !!! this command MUST be located ABOVE 2000h!!! CALL 01FF0H ;call to ISP_API (modifies B register but no Rx) ORL FCF,#001h ;switch back to user FLASH POP IE RET Hope this helps a bit. Jan Waclawek |