Sample Assembly Code to Erase and Reprogram the TMS320F240
PRELIMINARY
**************************************************************
** | Now that the data to be programmed is ready, the | ** |
** | programming algorithm is invoked. Note: Four parameters | ** |
** | must be initialized before calling the algorithm. | ** |
**************************************************************
LDP #PARMS
**********Put parameters where they belong.**********
splk | #0ff00h,PROTECT | |
splk | #0380h,PRG_bufaddr | |
splk | #00000h,PRG_paddr | |
splk | #3,PRG_length |
|
***********Next, program flash************ | ||
CALL | GPGMJ | ;Program flash from buffer. |
LACL | ERROR | ;Check for program error. |
BCND | prg_error,neq | ;If error then clear ACC. |
B | prg_done | ;Else, No errors programming. |
prg_error:
**********************************************************
** | If here, then an error occurred during programming. | ** |
** | In an actual application, the system takes some | ** |
** | action to indicate that service is required. | ** |
**********************************************************
B | prg_error | ;Error while programming. |
prg_done:
**********************************************************
**If here, then flash has been successfully programmed. *
**********************************************************
B | prg_done | ;Done programming. |
PRELIMINARY |