# How to write more than one page at once in Winbond W25Q32JV

I am using Eclipse IDE for firmware development. I am using Quectel MC60 module with Winbond W25Q32JV (4 MB memory). The thing is that I am able to read/write single page.

I am facing issue with multiple page writing at once. I have to write multiple pages at once since I had erased the sector (consists of 16 pages). Before writing one page, I had to erase 1 sector.

General algorithm for writing:

main()
{
// read from memory address adr

// erase sector (16 pages)

// write at address adr
}


I want to utilize memory pages for optimum performance. Any help will be appreciated.

Thanks for your prompt response.
My pseudocode is like this:

char buff[256];

sector_erase(0);   // erase first 16 pages

memset(buff,7,sizeof(buff));

for(int addr=0;addr<16;addr++)
{
write_enable();
page_program();
spi_write(addr,buff);    // write page one by one and hence increment the address
while(status_register);   // polling status register
}


## 1 Answer

Reading the datasheet, it’s clear that you cannot write more than one page in a single operation. For each page to be written, you’ll need to do the entire sequence of <write-enable>, <page-program> (or <quad-input-page-program>), and then poll the status register for completion. You’ll probably just want to put this sequence in a loop.

I don’t see a faster way to do this.

• Edited the question. Check if it's correct method. Thanks for your suggestions – Chandan Kumar Dec 19 '18 at 10:33