Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: [AVR-Chat] Re: Frustration abounds..

2007-07-18 by David VanHorn

Here's page write:  Erase is similar

Loader_Page_Write:
	rcall	SPM_Ready	;
	rcall	Loader_MakePage	;

	ldi	TEMP,$05		;PGWRT and SPMEN
	sts	SPMCSR,TEMP	;
	spm	                                        ; Flash page write
	nop
	rcall	Enable_RWW
	ret
;
;****************************
;
Enable_RWW:

	rcall 	SPM_Ready
	clr	TEMP
	sbr 	TEMP, (1<<RWWSRE) | (1<<SPMEN)
	sts 	SPMCR, TEMP			
	spm
	ret
;
;******************************
;
; Wait till the SPM and EEprom writes are done
;
SPM_Ready:
	lds	TEMP,SPMCSR
	andi 	TEMP,(1<<SPMEN)
	brne 	SPM_Ready			

Wait_ee:
	sbic 	EECR, EEWE
	rjmp 	Wait_ee	
	ret
;

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.