AN2504 Freescale Semiconductor / Motorola, AN2504 Datasheet - Page 28

no-image

AN2504

Manufacturer Part Number
AN2504
Description
On-Chip FLASH Programming API for CodeWarrior Software
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
AN2504/D
28
On-Chip FLASH Programming API for CodeWarrior Software
/********************************************************************
Byte VerifyRange(Word *_ini, Byte
}
* VerifyRange: Verifies a range of FLASH against the data
*
*
*
* Parameters:
*
*
*
* Entry Conditions: DATA contains the data to be verified.
*
* Exit Conditions:
*
*
* Return:
*
* Remarks:
*/
Freescale Semiconductor, Inc.
Byte _backup1;
Byte _status = 0;
Word _first;
_first = *_ini;
LADDRH = ((_first + _num - 1) & 0xFF00) >> 8;
LADDRL = ((_first + _num - 1) & 0x00FF);
__asm
__asm
RDVRRNG();
__asm
__asm
__asm
__asm
*_ini = _backup1;
return _status;
For More Information On This Product,
ldhx _first;
lda
sta _backup1;
clra;
adc #0;
sta _status;
Go to: www.freescale.com
contained in DATA. It can also be used to
read a range of FLASH into RAM.
#0x01;
_*ini: pointer to the starting address
_num:
DATA is overwritten with contents of FLASH.
The checksum is stored in _ini;
The byte received.
_num must be less to or equal to 64
of the range.
length of the range.
// Define first address.
// Config RDVRRNG() to store in RAM.
// Call ROM-resident routine.
// Store checksum.
// Store status.
// Define Last Address High & Low
_num) {
MOTOROLA

Related parts for AN2504