Skip to content

Flash W25Q64

Flash

常用的存储器件, 有一个物理特性就是只能写0, 不能写1, 可以进行擦除

主要有两种, NOR Flash 和NAND Flash

image-20240101105457598

FLashW25Q64

8M字节, nor flash, 支持双线和四线SPI, 标准模式104Mbit/s

image-20230705113847085

DO: MISO

DI: MDIO

/CS: 片选

/WP: 写保护

/HOLD: 暂停通讯

CLK: 时钟

Standard SPI instructions use the unidirectional DI (input) pin to serially write instructions, addresses or data to the device on the rising edge of the Serial Clock (CLK) input pin. Standard SPI also uses the unidirectional DO (output) to read data or status from the device on the falling edge CLK. (可以使用模式0或者模式3)

image-20230705120249483

W25Q64分为128个块, 每个块64kb, 块又分为16个扇区, 每一个4kb, 在写入的数据之前需要进行擦除, 只能把为1的数据位改为0, 擦除的时候只能按照最小的单元进行, 在写入的时候没有限制, 为nor Flash, nand Flash需要以扇区进行写入

image-20240101105932922

擦除的时候单位可以是扇区, 块, 或者整个片

写的时候是页写

有一个状态寄存器, BUSY位为忙状态

image-20230705123108519

  • 实际读写

image-20240101110313682

image-20230705123255295

image-20230705173533798

带括号的为返回值

擦除, 0x20之后发送三字节的地址

写入, 0x02

image-20230705124123214

几个id可以读取, 用来验证是否连接成功

image-20230705124036127

image-20240101110736419

image-20240101110813146

image-20240101110850188

image-20240101111620730

image-20240101111936481

image-20240101112057605

开发板情况

image-20230705135254082

指南者CS连接PC0

image-20240101105812580

QSPI模式

image-20240103150256723

image-20240103201116549

QE位就是控制是不是使用的QSPI模式

四字节地址使用的是W25Q256, 使用32位的地址

image-20240103201454566

image-20240103201808617

image-20240103202001887

image-20240103202145861

image-20240103202256014

image-20240103202443193