29.01.2015 Views

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

RM0008<br />

Flexible static memory controller (FSMC)<br />

Figure 175. NAND/PC Card controller timing for common memory access<br />

HCLK<br />

A[25:0]<br />

NCEx (2)<br />

NREG,<br />

NIOW,<br />

NIOR<br />

NWE,<br />

NOE (1)<br />

High<br />

MEMxSET + 1 MEMxWAIT + 1 MEMxHOLD + 1<br />

MEMxHIZ + 1<br />

write_data<br />

read_data<br />

Valid<br />

ai14732c<br />

1. NOE remains high (inactive) during write access. NWE remains high (inactive) during read access.<br />

2. NCEx goes low as soon as NAND access is requested <strong>and</strong> remains low until a different memory bank is accessed.<br />

19.6.4 NAND Flash operations<br />

The comm<strong>and</strong> latch enable (CLE) <strong>and</strong> address latch enable (ALE) signals of the NAND<br />

Flash device are driven by some address signals of the FSMC controller. This means that to<br />

send a comm<strong>and</strong> or an address to the NAND Flash memory, the CPU has to perform a write<br />

to a certain address in its memory space.<br />

A typical page read operation from the NAND Flash device is as follows:<br />

1. Program <strong>and</strong> enable the corresponding memory bank by configuring the FSMC_PCRx<br />

<strong>and</strong> FSMC_PMEMx (<strong>and</strong> for some devices, FSMC_PATTx, see Section 19.6.5: NAND<br />

Flash pre-wait functionality on page 446) registers according to the characteristics of<br />

the NAND Flash (PWID bits for the databus width of the NAND Flash, PTYP = 1,<br />

PWAITEN = 1, PBKEN = 1, see section Common memory space timing register 2..4<br />

(FSMC_PMEM2..4) on page 450 for timing configuration).<br />

2. The CPU performs a byte write in the common memory space, with data byte equal to<br />

one Flash comm<strong>and</strong> byte (for example 0x00 for Samsung NAND Flash devices). The<br />

CLE input of the NAND Flash is active during the write strobe (low pulse on NWE), thus<br />

the written byte is interpreted as a comm<strong>and</strong> by the NAND Flash. Once the comm<strong>and</strong><br />

is latched by the NAND Flash device, it does not need to be written for the following<br />

page read operations.<br />

3. The CPU can send the start address (STARTAD) for a read operation by writing four<br />

bytes (or three for smaller capacity devices), STARTAD[7:0], then STARTAD[16:9],<br />

STARTAD[24:17] <strong>and</strong> finally STARTAD[25] for 64 Mb x 8 bit NAND Flash) in the<br />

common memory or attribute space. The ALE input of the NAND Flash device is active<br />

during the write strobe (low pulse on NWE), thus the written bytes are interpreted as<br />

Doc ID 13902 Rev 9 445/995

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!