AN1827 Freescale Semiconductor / Motorola, AN1827 Datasheet - Page 39

no-image

AN1827

Manufacturer Part Number
AN1827
Description
Programming and Erasing FLASH Memory on the MC68HC908AS60
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
* Part Family Software Routine Works With: HC08
* Part Module(s) Software Routine Works With: fls32k_a01
*
* Routine Size (Bytes):
* Stack Space Used (Bytes):
* RAM Used (Bytes):
* Global Variables Used:
* Subroutine Called:
*
* Full Functional Description Of Routine Design:
* Program.mrt is the main routine for the programming operation. It
*
*
*
*
*
************************************************************************************
*****
************************************************************************************
NOLIST
$INCLUDE
$INCLUDE
LIST
************************************************************************************
*****
************************************************************************************
* This routine initializes the 908AS60 before calling the programming
* routine, Prog8Bytes. If a user plans to incorporate Prog8Bytes into
* his/her program, make sure the FLASH control registers, FLASH_addr and
* data buffer are initialized before calling Prog8Bytes.
*
* After the initialization, Prog8Bytes is called to program 8 data bytes,
* or one page of FLASH memory. If programming was successful, then the
* program will jump to the branch always statement in "No_Error." If
* programming failed, then the program will remain at the branch always
* statement in "Load."
************************************************************************************
Start:
AN1827
MOTOROLA
demonstrates a smart programming algorithm that minimizes the amount
of time needed to program a page of FLASH 2TS memory on the
MC68HC908AS60. One page consists of eight consecutive bytes of FLASH
memory starting at either address $xxx0 or $xxx8.
org
org
mov
lda
sta
sta
ldhx
sthx
"H908as60.frk"
ram1
"Prog_er.var"
flash-2
#$71,config-1
#$00
flcr1
flcr2
#$8000
FLASH_addr
Freescale Semiconductor, Inc.
For More Information On This Product,
Program/Margin Read Main Routine
278
5
11
FLASH_addr, data, attempt
Prog8Bytes
Go to: www.freescale.com
Include Files
;Equates for all registers and bits in
; the MC68HC908AS60
;RAM variable definitions
;Turn off the COP, but leave the LVI on
;Set up the frequency divide control
; bits in flcr1 & 2 for the appropriate
; charge pump clock
;Load FLASH_addr with address of where
; the 8 bytes should start being
Assembly Source Code
Application Note
*****
*****
39
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*

Related parts for AN1827