Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/30/08 20:36
Read: times


 
#155306 - Atmel 89C51RC2-UM and IAP
So I searched for and found a 3 year old thread that seems
to be on the same subject, but the original poster never got
back to the forum to say whether he got it working.

I have been all over the IAP document, the uP data sheet,
and the example source code.

Using an Atmel 89C51RC2-UM, trying to get IAP to work.
The subroutine is as follows:

WRMEM:	ORL	AUXR1,#01H	;ENABLE DPTR1
	MOV	DPTR,#80H	;ADDRESS OF BLOCK TO READ
	ANL	AUXR1,#0FEH	;ENABLE DPTR0
	MOV	DPTR,#3000H	;ADDRESS OF BLOCK TO WRITE
	MOV	A,#09H		;WRITE BLOCK BYTE
	MOV	R1,A		;MUST BE IN R1 FOR API
	MOV	A,#128		;BYTES TO WRITE
	ORL	AUXR1,#20H	;ENABLE BOOT ROM
	LCALL	0FFF0H		;PGM_MTP API ENTRY POINT
	ANL	AUXR1,#0DFH	;DISABLE BOOT ROM
	RET


If I change the address of block to write it follows.
If I change the number of bytes to write it follows.

What does not work is that the data written to the flash
is not what is in the RAM (source) and in fact seems random.

(Interestingly enough, I get the same results by NOT enabling
and disabling boot rom.)


List of 9 messages in thread
TopicAuthorDate
Atmel 89C51RC2-UM and IAP            01/01/70 00:00      
   Check the datasheet of 89c51rc2-um            01/01/70 00:00      
   Erase the FLASH First?            01/01/70 00:00      
      take a note of            01/01/70 00:00      
         there's a difference between Atmel and Philips...            01/01/70 00:00      
            add that one to webster :)            01/01/70 00:00      
   looks good            01/01/70 00:00      
      Duh! I confused RAM and XRAM!            01/01/70 00:00      
         Now I can't get Erase Block working            01/01/70 00:00      

Back to Subject List