Flash Memory Programming Example - Fujitsu MB96300 series Hardware Manual

F2mc-16fx 16-bit
Hide thumbs Also See for MB96300 series:
Table of Contents

Advertisement

CHAPTER 33 FLASH MEMORY
33.9

Flash memory programming example

This section presents a Flash memory programming example.
■ Programming example
Flash memory sample program:
;====================================================================
; THIS SAMPLE CODE IS PROVIDED AS IS AND IS SUBJECT TO ALTERATIONS.
;
FUJITSU MICROELECTRONICS ACCEPTS NO RESPONSIBILITY OR LIABILITY
;
FOR ANY ERRORS OR ELIGIBILITY FOR ANY PURPOSES.
;
;
;====================================================================
;
; This program erases Main Flash sector SA2 and programms 0xAA55
; to SA2. Afterwards the results are output on port P00 as follows:
;
; Bit# 0 1 2 3 4 5 6 7
;
;
;
;
;
;
;
;
;
.PROGRAM
.TITLE
; Defines
#setPOK00x0001
#setPOK10x0002
#setPERR0x0004
#setEOK00x0010
#setEOK10x0020
#setEERR0x0040
#setDQ30x0008; sector erase start
#setDQ50x0020; time out bit
#setDQ70x0080; data polling bit
; I/O
PDR00.EQU0x0000; Port data register 00
DDR00.EQU0x0430; Port direction register 00
MFMCS.EQU0x03F1; Main Flash Timing 1
MFMTC.EQU0x03F2; Main Flash Timing2
FMWC1.EQU0x03F9; Sector SA0 - SA7 unlock
CKSR.EQU0x0401; Clock select
882
(C) FUJITSU MICROELECTRONICS EUROPE 1998-2007
---------------
| | |
| | |
| | |
| | |
| | |
| | +---- EERR: Erase time out error
| | |
| +------ EOK1: Sucessfully erased (with "time out warning")
| | |
+-------- EOK0: Sucessfully erased
| | +------------ PERR: Program time out error
| +-------------- POK1: Sucessfully programmed (with "time out warning")
+---------------- POK0: Sucessfully programmed
FLASH_W_E
FLASH_WRITE_ERASE

Advertisement

Table of Contents
loading

Table of Contents