Texas Instruments TMS320F20x/F24x DSP Computer Drive User Manual


 
Assembly Source for Algorithms
PRELIMINARY
A-25
Assembly Source Listings and Program Examples
PRELIMINARY
A.1.6 Subroutines Used By All Four Algorithms, SUTILS20.ASM
This assembly file includes two subroutines that change the flash module ac-
cess mode and one subroutine that performs software delays. More details on
the individual functions are given in the comments.
**************************************************************
** Delay And Access Mode Subroutines **
* **
* TMS320F2XX Flash Utilities. **
* Revision: 2.0, 9/10/97 **
* Revision: 2.1, 1/31/98 **
* **
* Filename: sutils20.asm **
* **
* Called by: These utilities are used by CLEAR,ERASE, **
* PROGRAM algorithms written for F2xx **
* devices. **
* Function: DELAY Delay loop specified by AR6. **
* REGS Clears MODE bit of F_ACCESS0/1 to **
* access flash module control registers. **
* ARRAY Sets MODE bit of F_ACCESS0/1 to access **
* the flash array. **
**************************************************************
.include ”svar20.h”
.def DELAY,REGS,ARRAY
.sect ”DLY”
*************************************
*Delays as follows: *
* LAR AR6,#N 2 Cycles *
* CALL DELAY 4 Cycles *
* RPT #DLOOP 2*(N+1) Cycles *
* NOP DLOOP*(N+1) Cycles *
* BANZ DLY_LP 4*N+2 Cycles *
* RET 4 Cycles *
* –––––––––––––––––––––––– *
* = DLOOP(N+1)+6*N+14 Cycles *
* Set N and DLOOP appropriately to *
* get desired delay. *
**************************************
DELAY ;AR6 = OUTER LOOP COUNT
DLY_LP RPT #DLOOP ;APPROX 5US DELAY
NOP
BANZ DLY_LP,*– ;LOOP UNTIL DONE
RET ;RETURN TO CALLING SEQUENCE
.page
**************************************************
* REGS Clears MODE bit of F_ACCESS0/1 to **
* access flash module control registers. **
*******************************************************
.sect ”REG”
REGS