CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Copy data from SPI Flash ROM W25Q64C

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Shishido



Joined: 09 Mar 2014
Posts: 10

View user's profile Send private message

Copy data from SPI Flash ROM W25Q64C
PostPosted: Wed Feb 25, 2015 7:51 pm     Reply with quote

Dear All, I would like to copy to new blank Flash W25Q64CROM data of BIOS flash ROM (Winbond W25Q64C )
which protocol is SPI by PIC18 or PIC 24.

we can get datasheet
http://www.alldatasheet.com/view.jsp?Searchword=W25Q64

I am sorry I have no idea how. Could you give me hint about this?
temtronic



Joined: 01 Jul 2010
Posts: 9243
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Feb 25, 2015 8:19 pm     Reply with quote

Sounds like a school project but here's some help..

1) choose a PIC that is of a 3 volt design.Typically they 18LFxxx, where the L says it will run at 3 volts with a fast clock.

This is important as the memory device you have is a 3 volt device

2) choose a PIC with 2 HARDWARE SPI interfaces. This you need as it appears you want to copy from one SPI memory device to another.

3) choose a PIC with a large amount of RAM.Something 3-4 times bigger than whatever a 'page' or 'block' of memory the SPI device use.

4) build a minimal test board with the PIC,20MHz xtal, 2 caps, LED and resistor as well as ICSP interface.

5) cut code for a '1Hz LED ' program,compile, download, test.

get #5 WORKING before you proceed

6) cut code for a 'PIC to PC via UART' program. Have the PIC receive data from a 'terminal program kbd on the PC' and send it back to the PC screen.

get #6 working before you proceed.

7) read the datasheets and wire up the 'BIOS' flash ROM to the PIC,say using SPI port #1. cut code to read the chip and send that data to the PC terminal program.

get #7 working before you proceed

8) wire up the 'blank' chip to the SPI #2 port and cut code to read/display onto PC screen. When that works, try storing 'ABC' to it, read it back, dsp on PC.

When #8 works fine, cut code to read 'bios' save to 'blank', using a RAM buffer of the correct size,

These are general comments, more a less the 'plan of attack' I'd use to 'clone the device. The actual program for 'cloning ' is simple, maybe a nights work. Most of your time will be spent doing the hardware and 'basic' programs to prove you've got the hardware correct!

Jay
Shishido



Joined: 09 Mar 2014
Posts: 10

View user's profile Send private message

Thanks Jay san
PostPosted: Thu Feb 26, 2015 3:15 am     Reply with quote

Dear Jay san, thank you for your good comments.
Actually, I have experienced developed I2C protocol device such as EEPROM ,I2C LCD ,etc controlled by PIC16,PIC18.

According datasheet of Winbond W25Q64C.
It seems to complicate write data about page write ,block write.

Anyway, I will try it spend my night time .


Thanks!
Ttelmah



Joined: 11 Mar 2010
Posts: 19539

View user's profile Send private message

PostPosted: Thu Feb 26, 2015 4:21 am     Reply with quote

Keep it simple.

Do the writes in pages.
Use the smallest erase sector (4KB).
The chip has three different 'sizes' associated with it for erase. a 4KB 'sector', or 32KB, and 64KB 'blocks' which automatically perform multi sector erases. Then a 256byte page for writes.
On wake up, send the 'continuous read disable' instruction. You need to do this if the chip has got into a confused state, otherwise it won't accept other commands. It shouldn't happen (since you won't use the continuous read mode), but can, so it's worth being safe. I had one arrive set in this mode, and swore at it till I realised what was wrong....

Then, erase the first 4KB sector on the target.
Then just use the simplest read operation to read 16 pages (4KB), non stop.
Then do 16 page writes to the target. For each one, 'write enable', 'page program', address (last byte 0), and clock in 256 bytes. Release CS. Then either just wait for the worst case write time (simple - 3mSec), or poll the busy flag (more complex but faster).

Get a PIC that has more than 4KB RAM (so a whole 4KB can be held).

I've played with another version from the same family (the X20), and provided I didn't try to do anything too complex/fast, it was easy to drive. Smile

So long as you don't mind taking it slightly slowly, it is easy, but go faster and you then have to start doing a lot more work to avoid timing issues. Watch out for the delay needed after the first byte is transferred on the page write.
Just using timing, it'll take about 3 minutes to perform the copy on this chip.
Shishido



Joined: 09 Mar 2014
Posts: 10

View user's profile Send private message

Done COPY SPI memory tool
PostPosted: Fri Apr 24, 2015 2:17 am     Reply with quote

Many Thanks , I done SPI memory copy tool .

Pic micom :PIC18F27J53 , clock 20M
When copy 64Mbit memory. the time is 6:30 sec include verify.
Since I hope speed up copy time. I will challenge update for using 32bit micom for the next time.





Ttelmah wrote:
Keep it simple.

Do the writes in pages.



Use the smallest erase sector (4KB).
The chip has three different 'sizes' associated with it for erase. a 4KB 'sector', or 32KB, and 64KB 'blocks' which automatically perform multi sector erases. Then a 256byte page for writes.
On wake up, send the 'continuous read disable' instruction. You need to do this if the chip has got into a confused state, otherwise it won't accept other commands. It shouldn't happen (since you won't use the continuous read mode), but can, so it's worth being safe. I had one arrive set in this mode, and swore at it till I realised what was wrong....

Then, erase the first 4KB sector on the target.
Then just use the simplest read operation to read 16 pages (4KB), non stop.
Then do 16 page writes to the target. For each one, 'write enable', 'page program', address (last byte 0), and clock in 256 bytes. Release CS. Then either just wait for the worst case write time (simple - 3mSec), or poll the busy flag (more complex but faster).

Get a PIC that has more than 4KB RAM (so a whole 4KB can be held).

I've played with another version from the same family (the X20), and provided I didn't try to do anything too complex/fast, it was easy to drive. Smile

So long as you don't mind taking it slightly slowly, it is easy, but go faster and you then have to start doing a lot more work to avoid timing issues. Watch out for the delay needed after the first byte is transferred on the page write.
Just using timing, it'll take about 3 minutes to perform the copy on this chip.
Very Happy Very Happy Very Happy
ciccioc74



Joined: 23 Mar 2010
Posts: 30

View user's profile Send private message Visit poster's website MSN Messenger

PostPosted: Wed Oct 21, 2015 11:31 am     Reply with quote

hi shishido can you post the code?
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group