AN2504 Freescale Semiconductor / Motorola, AN2504 Datasheet - Page 27

no-image

AN2504

Manufacturer Part Number
AN2504
Description
On-Chip FLASH Programming API for CodeWarrior Software
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
MOTOROLA
On-Chip FLASH Programming API for CodeWarrior Software
/********************************************************************
Byte ProgramRangeX(Word *_ini, Byte
}
* ProgramRangeX: Programs a range of FLASH after verifying
*
*
*
* Parameters:
*
*
*
* Entry Conditions: DATA contains the data to be programmed
*
* Exit Conditions:
*
* Return:
*
* Remarks:
*/
Freescale Semiconductor, Inc.
Byte _test;
Byte _i;
Word _first;
for (_i=0; _i < _num; _i++) {
}
_first = *_ini;
FLBPR = 0xFF;
CPUSPD = OSC;
LADDRH = ((_first + _num - 1) & 0xFF00) >> 8;
LADDRL = ((_first + _num - 1) & 0x00FF);
__asm
PRGRNGE();
FLBPR = 0x00;
return SUCCESS;
For More Information On This Product,
_test =
if (_test != 0xFF) {
}
ldhx _first;
return FAIL;
Go to: www.freescale.com
(*(Byte*)(*_ini + _i));
the range is blank. If it isn't blank it
doesn't programs and returns FAIL.
_*ini: pointer to the starting address
_num:
None.
SUCCESS or FAIL.
_num must be less to or equal to 64
of the range.
length of the range.
// Disables write protection.
// Set Clock Bus Operation speed.
// Define Last Address High & Low
// Define first address.
// Call ROM-resident routine.
// Enables write protection.
_num) {
API Source Code
AN2504/D
27

Related parts for AN2504