AN1827 Freescale Semiconductor / Motorola, AN1827 Datasheet - Page 50

no-image

AN1827

Manufacturer Part Number
AN1827
Description
Programming and Erasing FLASH Memory on the MC68HC908AS60
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Application Note
/* block of 64 bytes, 512 bytes, 16 Kbytes or 32bytes depending on the
/* value in the control registers. FLASH_addr is any address within the
/* block that will be erased. This program does not verify that the
/* operation was successful.
/**********************************************************************************/
void main ()
{
}
/**********************************************************************************/
/****
/**********************************************************************************/
#include
/**********************************************************************************/
/**********************************************************************************/
/*
/*
/*
/**********************************************************************************/
/* File Name: Prog_mrt.c
/*
/* Current Revision: 1.0
/* Current Release Level: RP
/* Current Revision Release Date:
/*
/* Current Release Written By: Adeela Gill
/*
/*
/*
/* Compiled Under: HiCross HC08 (HiWare)
/*
/* Project Folder Name: FLASH_2TS
/*
/* Part Family Software Routine Works With: HC08
/* Part Module(s) Software Routine Works With: fls32k_a01
50
Program / Margin Read FLASH 2TS Memory on the MC68HC908AS60
CONFIG1 = 0x71;
FLCR1 = 0x00;
FLCR2 = 0x00;
FLASH_addr=(unsigned char *)0x4001;
writeFLCR(eraseallrows);
EraseRoutine ();
while (1);
<prog_er_srt.c>
Freescale Semiconductor, Inc.
For More Information On This Product,
Subroutine Body Includes
Motorola Systems Engineering
Austin, Texas
Go to: www.freescale.com
10/02/99
Copyright (c) Motorola 1999
Ver.: 5.0.5
/*Turn off the COP, but leave the
/*
/*Set up the frequency divide
/* control bits in flcr1 & flcr2
/*
/*
/*Set address of erase block. This
/*
/*
/*Set BLK1 and BLK0 in appropriate
/*
/*
/*Erase the block of FLASH including
/* the specified address
/*Prog8Bytes, WriteFLCR and Delay
/*
Subroutines
FLASH control register to specify */
LVI on
for an appropriate charge pump
clock
is any address within the block
that will be erased
the size of block to erase
MOTOROLA
AN1827
****/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/

Related parts for AN1827