AN2504 Freescale Semiconductor / Motorola, AN2504 Datasheet - Page 17

no-image

AN2504

Manufacturer Part Number
AN2504
Description
On-Chip FLASH Programming API for CodeWarrior Software
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
API Source Code
MOTOROLA
On-Chip FLASH Programming API for CodeWarrior Software
/*
/*
/*
/*
}
/*==================================================================*
* Try to program again the section FLASH_TEST with ProgramRangeX
* It is going to fail since this section is not blank.
*/
* Erase section FLASH_TEST. Notice how interrupts won't be disabled.
*/
* Program section FLASH_TEST with ProgramRangeX.
* This time ProgramRangeX is going to succeed.
*/
* Finally Erase the entire FLASH.
*/
*
* Copyright (c) 2002, Motorola Inc.
* Motorola Application Note
*
* File name
* Author
* Department
*
* Description
*
*
*
*
*
*
*
* History
*
*==================================================================*/
Freescale Semiconductor, Inc.
__asm
__asm
__asm
__asm
__asm _FILL_RAM: STA ,X;
__asm
__asm
address = FLASH_TEST_ADDRESS;
size = 10;
temp = ProgramRangeX(&address, size);
if (temp == FAIL) {
}
EnableInterrupts;
ErasePageX(&address);
temp = ProgramRangeX(&address, size);
if (temp == FAIL) {
}
EraseFlash();
for ( ;; );
For More Information On This Product,
temp = temp + 1;
temp = temp + 1;
Go to: www.freescale.com
: MCU_constants.h
: Mauricio Capistran-Garza
: Guadalajara - SPS
: It contains the defines needed for all constants
:
used in flash_api.c for the following MCUs:
CPX #DATA_END;
INCX;
LDHX #DATA_START; // Where DATA begins
LDA #122;
DECA;
BNE _FILL_RAM;
// Do anything wanted
// Do anything wanted
// point to next location in RAM
// if DATA_END reached exit loop
// save the received byte
MC68HC908GR8,
MC68HC908KX8,
MC68HC908JL3,
MC68HC908JK3,
MC68HC908JB8.
API Source Code
AN2504/D
17

Related parts for AN2504