PRELIMINARY
Assembly Source for Algorithms
A.1.5 Programming Algorithm, SPGM20.ASM
This code is an implementation of the program algorithm described in section
3.2on page
Entry point: GPGMJ
Parameters to be declared and initialized by the calling code are:
-PRG_bufaddr defines the destination start address.
-PRG_length defines the source buffer length.
-PRG_paddr defines the source buffer start address (data space).
-PROTECT defines the values of bits 8±15 of SEG_CTR during the pro- gramming algorithm.
Return value: ERROR (@BASE+15); 0 = Pass, 1 = Fail
**************************************************************
** | PROGRAM Subroutine | ** |
* |
| ** |
* | TMS320F2XX Flash Utilities. | ** |
* | Revision: 2.0, 9/10/97 | ** |
* | Revision: 2.0b, 12/5/97 | ** |
* | Revision: 2.1, 1/31/98 | ** |
* |
| ** |
* | Filename: spgm20.asm | ** |
* |
| ** |
*Called by: c2xx_bpx.asm or flash application programs. **
* | ** |
*!!CAUTION ± INITIALIZE DP BEFORE CALLING THIS ROUTINE!! **
* |
|
| ** |
* | Function: This routine programs all or part of the | ** | |
* | flash as specified by the variables: | ** | |
* | PRG_paddr | Destination start address | * |
* | PRG_length | Source buffer length | * |
* | PRG_bufaddr | Source buffer start address | * |
* |
|
| * |
* | 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±freq read±back margin on programmed | * |
PRELIMINARY | Assembly Source Listings and Program Examples |