This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to Erase/Program External AM29F040 Flash on MCB167-NET

I am in need of some help.

I have a MCB167-NET board (configured as 16 bit addressing), which contains a 2xFlash modules from AMD (AM29F040B).

I am writing my own Bootloader to copy my program to external RAM, erase and then the program it to the flash.

The following code on chip erase (with AMD ERASE algorithm) works on 8-bit non-multiplexing mode. However, how do I get it modified to erase and program the FLASH in 16 bit addressing??

---------------------------------------------

ERASE_FLASH:    MOV		DPP2,#0001H   ;write 0xAA to [0x5555]
    		MOV		R12,#09555H
    		MOVB	RL1,#00AAH	
    	 	MOV		[R12], RL1
    		MOV		DPP2,#0000H   ;write 0x55 to [0x2AAA]
    		MOV		R12,#0AAAAH		
    		MOVB	RL1,#0055H
    		MOV		[R12], RL1
    		MOV		DPP2,#0001H   ;write 0x80 to [0x5555]
    		MOV		R12,#09555H
    		MOVB	RL1,#0080H
    		MOV		[R12], RL1
    		MOV		DPP2,#0001H   ;write 0xAA to [0x5555]
	        MOV		R12,#09555H
    		MOVB	RL1,#00AAH
	   	MOV		[R12], RL1 
    		MOV		DPP2,#0000H   ;write 0x55 to [0x2AAA]
    		MOV		R12,#0AAAAH		
    		MOVB	RL1,#0055H
    		MOV		[R12], RL1
    		MOV		DPP2,#0001H   ;write 0x10 to [0x2AAA]
    		MOV		R12,#09555H
    		MOVB	RL1,#0010H
    		MOV		[R12], RL1		
    		MOV		R13,#09555H
    		MOVB	RL2,#80H              ;wait till erase is ok by polling		
    		CALLR	ERASE_POLL
    	   	MOV		R4,#ERASE_OK
---------------------------------------------
Please help me.

0