Intel TE28F320C3BA100 Flash读写函数的实现

JX44B0-1B教学实验板上用的是一块48引脚TSOP封装的Intel TE28F320C3BA100的Flash存储器,2M×16bit,Flash地址范围从0x00000000~0x003FFFFF共4MB,其扇区划分是sector00~07为8KB,sector08~70为64KB,8KB×8+64KB×63/1024=4MB,在Intel的数据手册上该Flash的容量用32-Mbit来描述。

这块Flash的特点在于所谓的3 Volt Advanced+ Boot Block,具有不对称的扇区划分(asymmetrically blocked)结构,Flash内部存在两种类型的block——8KB大小的parameter blocks和64KB大小的main blocks,因此也衍生出两种memory map——Top Boot Block(parameter blocks映射到高地址)和Bottom Boot Block(parameter blocks映射到低地址)。TE28F320C3BA100即属于Bottom Boot Block,由字母B指示。

Flash可以使用2.7V~3.6V的电压(Vpp)对其进行在系统(in-system)的读、擦除和编程,因为它的总线周期完全符合标准的微控制器的总线周期(All bus cycles to or from the flash memory conform to standard microcontroller bus cycles)。工作温度范围在-40~+85之间。

还值得一提的是该Flash灵活的存储块锁定(Flexible Block Locking)机制,对于任一存储块都可以提供2级的保护(锁定),第1级块锁定由软件控制,而第2级块锁定还需要硬件的参与。The Intel Advanced+ Boot Block Flash Memory(C3) device offers an instant, individual block locking scheme that allows any block to be locked or unlocked with no latency, enabling instant code and data protection.

根据JX44B0-1B教学实验板的原理图可以知道该Flash和Samsung S3C44B0X微控制器的连接方式为:S3C44B0X的ADDR1~ADDR21引脚接到Flash的A0~A20引脚,用以传送地址;S3C44B0X的DATA0~DATA15引脚接到Flash的DQ0~DQ15引脚,用以传送数据;S3C44B0X的nRESET引脚接到Flash的RP#引脚,用以复位;S3C44B0X的nOE引脚接到Flash的OE#引脚,用以使能输出;S3C44B0X的nWE引脚接到Flash的WE#引脚,用以使能写操作;S3C44B0X的nGCS0引脚接到Flash的CE#引脚,用以片选。

这块Flash使用Command User Interface(CUI)和内置的自动化算法(automated algorithms)来简化对Flash的编程和擦除操作。该Flash具有4种读模式Read Array、Read Identifier、Read Status和Read Query;2种写模式Program和Block Erase。对于Flash的各种操作和状态切换都通过向CUI写入相应的命令码来实现。

Flash中内置了一个状态寄存器(Status Register,SR)来指示Flash的当前工作状态和各种操作是否成功。要读取SR的当前值需要向CUI发送读状态寄存器命令(Read Status Register),命令码为0x70,SR中的内容将在DQ[7:0]上输出。The Read Status Register (0x70)command causes subsequent reads to output data from the SR until another command is issued. The SR bits are output on DQ[7:0].

CUI Command Codes and Descriptions

Code(HEX)       Device Mode

FF                         Read Array

40                          Program Set-up

20                          Erase Set-up

D0                         Erase Confirm

                               Program/Erase Resume

                               Unlock Block

B0                          Program Suspend

                               Erase Suspend

70                           Read Status Register

50                           Clear Status Register

90                           Read Identifier

60                           Block Lock Set-up

                                Block Unlock Set-up

                                Block Lock-Down Set-up

01                            Lock-Block

2F                            Lock-Down

98                            CFI Query

C0                           Protection Program Set-up 

10                            Alternative Program Set-up

00                            Invalid / Reserved

to be continued...

FAQ

参考资料:

Intel Advanced+ Boot Block Flash Memory(C3) datasheet

blob-2.0.5-pre2/src/blob/intel16.c source code

Understanding the Linux Kernel 2rd Edition

Programming Embedded Systems in C and C++

ARM System Developer's Guide:Designing and Optimizing System Software

你可能感兴趣的:(Embedded,Systems)