PRELIMINARY

Assembly Source for Algorithms

A.1.2 Clear Algorithm, SCLR20.ASM

This code is an implementation of the clear (programming) algorithm de- scribed in section 3.2 on page 3-4. Recall that the clear algorithm is identical to the programming algorithm with the data forced to 0000h for all flash address- es.

Memory section: fl_clr

Entry point: GCLR

Parameters to be declared and initialized by the calling code are:

-PROTECT defines the values of bits 8±15 of SEG_CTR during the clear algorithm.

-SEG_ST defines the start address of the flash array to be cleared.

-SEG_END defines the end address of the flash array to be cleared.

Return value: ERROR (@BASE+15); 0 = Pass, 1 = Fail

**************************************************************

**

CLEAR Subroutine

**

*

 

**

*

TMS320F2XX Flash Utilities.

**

*

Revision: 2.0, 9/10/97

**

*

Revision: 2.1, 1/31/98

**

*

 

**

*

Filename: sclr20.asm

**

*

 

**

*Called by: c2xx_bcx.asm or flash application programs. **

*

**

*!!CAUTION ± INITIALIZE DP BEFORE CALLING THIS ROUTINE!! **

*

 

 

**

*

Function: Clears one or more contiguous segments of

**

*

array 0/1 as specified by the following

**

*

variables.

**

*

SEG_ST

Segment start address

**

*

SEG_END

Segment end address

**

*

PROTECT

Sector protect enable

**

*

 

 

*

*

The algorithm used is ºrow-horizontalº, which means that *

* an entire flash row

(32 words) is programmed in parallel.*

*

This method provides better uniformity of programming

*

*

levels between adjacent bits than if each address were

*

*

programmed independently. The algorithm also uses a

*

*

3-read check for VER0 margin (i.e.,the flash location is *

*read three times and the first two values are discarded.)*

* This provides low±frequency read±back margin on

*

PRELIMINARY

Assembly Source Listings and Program Examples

A-5

Page 57
Image 57
Texas Instruments TMS320F20x/F24x DSP manual Clear Algorithm, SCLR20.ASM, Segst, Segend, Protect