0
\$\begingroup\$

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
    }
\$\endgroup\$
2
\$\begingroup\$

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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.