This application not e provides with software guidelines and examples for programming ST10F269 and
ST10F280. More generally, this application note is applicable for any ST10 variant with 0.35µm
technology embedded Flash memory.
The first chapter gives an overview the ST10F269/ F2 80 em bedded Flash key features. It also shows the
differences between ST10F269/ST10F280 and ST10F 168.
The second chapter de scribes h ow to develop software for ST10’s embedded Flash t hrough guidelines,
examples and tips.
The last chapter is dedicat ed to embedded application aspects. More specifically, it gi ves advises for
Flash field reprogramming.
This application note do es not replace ST10 p roduct datashe ets. It refers to them and it is necessary to
have a copy the specific ST10 variant targetted by the user to follow some of the explanations.
1/16February 2002
AN1496 - APPLICAT ION NOTE
TABLE OF CONTENTSPAGE
1INTRODUCTION TO ST10 0.35MM EMBEDDED FLASH ......................................... 3
6APPLICATION NOTE VERSION INFORMATION...................................................... 16
6.1REVISION OF 26TH OF FEBRUARY 2002................................................................16
2/16
AN1496 - APPLICAT ION NOTE
1 - INTRODUCTION TO ST10 0.35µm EMB E DDED FL A SH
This chapter is describing the improvements made from the ST10F168 and the differences with
stand-alone Flash memories.
1.1 - Differences with ST10F168
1.1.1 - Single Supply
ST10 variants with 0.35µm embedded Flash do not require specific programming supply. On-chip charge
pumps will provide with the necessary programming supply from the external single 5 volt supply.
1.1.2 - New Erase/Program Controller
The 0.35µm Erase/Program Controller has been changed to be closer to the one of stand-alone Flas h
memories : erasing and programming of Flash memory cells is no more done by the ST10. This allows :
Savings on system stack :
–
ing and programming,
Improved efficiency during programming :
–
the time where the Erase/Program Controller is dealing with the Flash,
Improved clock scheme :
–
to specify it the CPU clock. This also simplifies the hand ling of special events (like PLL unlock) during
erasing/programming.
there is no more need to allocate space on the ST10 system stack f or eras-
ST10 CPU can be used to handle communication during
the Flash erase/program controller has its own clock; there is no more need
1.1.3 - Improved Granularity of Block Sizes
ST10 0.35µm embedded Flash has improved block granulaty (smaller blocks) and also features boot
block organisation :
– Block size is 64 Kbyte for standard blocks,
– Small blocks for the 4 boot blocks (16 Kbyte, then 8 Kbyte, 8 Kbyte, 32 Kbyte).
1.2 - Comparison with Stand-alone Flash Memories
1.2.1 - Similar But Different Erase/Program Commands
The Erase/program Controller of ST10F269/F280 is derived from the Common Flash memory Interface :
– To keep the same level of proven safety, the special sequence of commands of stand alone Flash mem-
ories has been kept,
– To differentiate from ex ternal Flash memories, the value of the commands (address and data) have
been slighlty modified.
This allows to re-use existing software written for stand-alone Flash memories with few modifications. The
following chapters describe them.
1.2.2 - Description of the Commands to the Flash Controller
The following table is describing the possible commands with ST10F269/F280 Erase/Program Controller.
Commands to the Flash are defined by a sequence of ST10 write cycles with specific addresses and data
within the Flash memor y range. The length of the seq uence varies from 1 cycle (ex : Read/Reset) to 6
cycles (chip erase).
Block erase command can be extended by 1 cycle per additional block to erase. This translates in a
maximum of 12 cycles for ST10F2 69 and of 16 cycles for ST10F280.
3/16
AN1496 - APPLICAT ION NOTE
Table 1 :
Commands for ST10 with 0.35µm embedded Flash
InstructionMneCycle
Read/ResetRD1+
Read/Reset RD3+
Program WordPW4
Block EraseBE6
Chip EraseCE6
Erase SuspendES1
Erase ResumeER1
Set Block/Code
Protection
SP4
Read
Protection
Status
RP4
Block
Temporary
BTU4
Unprotection
Code
Temporary
CTU1
Unprotection
Code
Temporary
CTP1
Protection
st
1
Cycle
Addr.
1
2
X
DataxxF0h
1
Addr.
x1554hx2AA8hxxxxxh
DataxxA8hxx54hxxF0h
1
Addr.
x1554hx2AA8hx1554hWA
DataxxA8hxx54hxxA0hWD
1
Addr.
x1554hx2AA8hx1554hx1554hx2AA8hBABA’
nd
2
Cycle
3rd Cycle4th Cycle
5th
Cycle
6th
Cycle
Read Memory Array until a new write cycle is initiated
Read Memory Array until a new write
cycle is initiated
3
Read Data Polling or
Toggle Bit until Program
4
completes.
7th
Cycle
DataxxA8hxx54hxx80hxxA8hxx54hxx30hxx30h
1
Addr.
DataxxA8hxx54hxx80hxxA8hxx54hxx10h
Addr.
DataxxB0h
Addr.
Dataxx30h
Addr.
DataxxA8hxx54hxxC0hWPR
x1554hx2AA8hx1554hx1554hx2AA8hx1554h
1
2
X
Read until Toggle stops, then read or program all data needed
from block(s) not being erased then Resume Erase.
1
2
X
Read Data Polling or Toggle bit until Erase completes or Erase
is supended another time.
1
x2A54hx15A8hx2A54hAny odd
word
address
9
7
Note
Addr.1x2A54hx15A8hx2A54hAny odd
word
address
DataxxA8hxx54hxx90hRead
Read Protection Register
9
until a new write cycle is
initiated.
PR
Addr.
1
x2A54hx15A8hx2A54hX
2
DataxxA8hxx54hxxC1hxxF0h
1
Addr.
DataFFFFh
1
Addr.
DataFFFBh
MEM
MEM
8
Write cycles must be executed from Flash.
8
Write cycles must be executed from Flash.
5
6
Notes 1. Address bi t A14, A15 and above are don’t care for coded address inputs.
2. X = Don’t Care.
3. WA = Write Address: address of memor y location t o be programmed.
4. WD = Write Data: 16-bi t data to be programmed
5. Optional, add i tional blocks addresses must be entered within a time-out delay (96 µs) after l ast wr i te entr y, timeout st at us can be
verified through FSB.3 value. When full command is entered, read Data Polling or Toggle bit until Erase is completed or suspend ed.
6. Read Data Polling or Toggle bit until Erase completes.
7. WPR = W rite protection r egister. To pr ot ect code, bi t 15 of WPR must be ‘0’. To protect block N (N=0,1,. .. ), bit N o f WPR mu st be
‘0’. Bit that are already at ‘0’ in protection register must also be ‘0’ in WPR, else a writing error will occurs (it is not possible to write a
‘1’ in a bit already programmed at ‘0’).
8. MEM = any address inside the Flash memory spa ce. Absolut e addressing mo de must be used (MOV MEM, Rn), and inst ruction
must be executed from F l ash memory space.
9. Odd word address = 4n-2 w here n = 0, 1, 2, 3..., ex. 00 02h, 0006h. ..
4/16
AN1496 - APPLICAT ION NOTE
1.2.3 - Same Flash Status Register
The Flash Status register is used to flag the status of the Flash memory and the result of an operation.
To maximise the re-use of Flash programming software, the Flash Status register of stand-alone Flash
memories has been kept.
This register can be accessed by Read cycles during the program-Erase Controller operations. The
Erase/Program operation can be controlled by data polling on bi t FSB7 of Status Re gister, detection of
Toggle on FSB6 and FSB2, or Error on FSB5 and Erase Timeout on FSB3 bits. Any read attempt in Flash
during Erase/Program. operation will automatically output these five bits. The E.P.C. sets bits FSB2,
FSB3, FSB5, FSB6 and FSB7. Other bits are reserved for future use and should be masked.
Flash Status (see note for address)
1514131211109876543210
BitFunction
FSB.7
FSB.6
FSB.5
FSB.3
FSB.2
Flash Status Bit 7: Data Polling Bit
Programming Op eration: this bit outputs the complement of the bit 7 of the word being programme d, and
after completion, will output the bit 7 of the word programmed.
Erasing Operation: outputs a ‘0’ during erasing, and ‘1’ after erasing completion.
If the Block selected for erasure is (ar e) pro tected, FSB.7 wi ll be se t to ‘0’ for about 100 µs, and th en ret ur n
to the previous addressed memory data value.
FSB.7 will also flag the Erase Suspend Mode by switching from ‘0’ to ‘1’ at the start of the Erase Suspend.
During Program o peration in Erase Suspend Mo de, FSB.7 will have the same behaviou r as in nor mal Pro-
gram execution outside the Suspend mode.
Flash Status Bit 6: Toggle Bit
Programming or Erasing Operations: successive read operations of Flash Status register will deliver complementar y values. FSB.6 will toggle each time the Flash Status register is read. The Program operation is
completed when two successive reads yield the same value. Th e next read will output the bit last programmed, or a ‘1’ after Erase operation
FSB.6 will be set to‘1 ’ if a re ad op eration is attempted on a n Erase S uspe nded block. In additio n, an Erase
Suspend/Resume command will cause FSB.6 to toggle.
Flash Status Bit 5: Error Bit
This bit is set to ‘1’ when there is a failure of Program, Block or Chip Erase operations.This bit will also be set
if a user tries to program a bit to ‘1’ to a Flash location that is currently programmed with ‘0’.
The error bit resets after Read/Reset instruction.
In case of success, the Error bit will be set to ‘0’ during Program or Erase and then will output the bit last pro-
grammed or a ‘1’ after erasing
Flash Status Bit 3: Erase Time-out Bit
This bit is set to ‘1’ by the P/E.C. when th e last Block Erase c ommand ha s been ente red to the C ommand
Interface and it is awaiting the Erase start. Wh en the time-out per iod is finished, aft er 96 µs, FSB.3 returns
back to ‘1’.
Flash Status Bit 2: Toggle Bit
This toggle bit, tog ether with FSB.6, can be used to dete rmine the chip status during the Erase Mode or
Erase Suspend Mode. It can be used also to identifiey the block being Erased Suspended. A Read operation
will cause FSB.2 to Toggle during the Erase Mode. If the Flash is in Erase Suspend Mode, a Read operation
from the Erase suspended block or a Program operation into the Erase suspended block will cause FSB.2 to
toggle.
When the Flash is in Pro gram Mode dur ing Eras e Susp end, FSB.2 will be read a s ‘1’ if ad dress used is the
address of the word being programmed.
After Erase completion with an Error status, FSB.2 will toggle when reading the faulty sector.
FSB.7 FSB.6 FSB.5FSB.3 FSB.2
RRRRR
Note :
The address of the Flash Status Register is the address o f the word being programmed when
Programming operation is in progress, or an address within the block being erased when Erasing
operation is in progress.
5/16
Loading...
+ 11 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.