AN2504 Freescale Semiconductor / Motorola, AN2504 Datasheet - Page 25

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 TransmitRange(Word *_ini, Byte
}
* TransmitRange: It reads a range of FLASH memory and sends
*
*
* Parameters:
*
*
*
* Entry Conditions: None.
*
* Exit Conditions:
*
* Return:
*
* Remarks:
*/
Freescale Semiconductor, Inc.
Byte _backup1, _backup2, _backup3;
Byte _status = 0;
Word _first;
_first = *_ini;
_backup1 = COMMPORT;
_backup2 = COMMPORT_DIR;
COMMPORT &= 0xFE;
COMMPORT_DIR &= 0xFE;
LADDRH = ((_first + _num - 1) & 0xFF00) >> 8;
LADDRL = ((_first + _num - 1) & 0x00FF);
__asm
__asm
RDVRRNG();
__asm
__asm
__asm
__asm
*_ini = _backup3;
COMMPORT = _backup1;
COMMPORT_DIR = _backup2;
return _status;
For More Information On This Product,
ldhx _first;
lda
sta _backup3;
clra;
adc #0;
sta _status;
Go to: www.freescale.com
#0x00;
it out the communication port
_*ini: pointer to the starting address
_num:
The checksum is stored in _ini;
SUCCESS or FAIL
_num must be less to or equal to 64
of the range.
number of bytes to transmit.
// Backup port values.
// Configure COMMPORT as input.
// Define Last Address High & Low
// Define first address.
// Configure RDVRRNG() to transmit.
// Call ROM-resident routine.
// Store checksum.
// Store status.
// Restore port values.
_num) {
API Source Code
AN2504/D
25

Related parts for AN2504