Serial Flash Memory - Page 1
Forum section: electronics / general

author: German_EE
author_rank: Super Contributor
timestamp: July 04, 2015, 01:19:52 pm
content: When I first started to become interested in digital electronics memory was easy, you supplied an address to a chip and then either wrote a bit or read one from that location. Later on things became easier as memory chips were byte wide but the principle was the same.Now however I'm confused because I'm trying to find a 4Mb x 16 flash memory chip (this works out at 64Mb). All the available devices seem to be called 'serial flash' and they work on a page or block basis. Please could someone explain how these devices are used in practice and how I could split the memory map of a 64Mb device into eight separate sections sixteen bits wide?

author: Psi
author_rank: Super Contributor
timestamp: July 04, 2015, 01:34:57 pm
content: Flash is divided into pages because, due to how they work, you cannot change bytes any time you want.If you want to overwrite a byte you must first erase an entire page. Once erased all bits in the page are 1.You can write any byte whenever you want but only by changing its 1's to 0'sTo get any bits to 1 again the entire page has to be erased.This makes flash a bit annoying to deal with. Have you looked at EEPROMs ?

author: German_EE
author_rank: Super Contributor
timestamp: July 04, 2015, 01:41:51 pm
content: OK, so how do I address a point within a page? Suppose I want to start at the beginning of page 1234 and write ABCD, DCBA, DEAD, BEEF, FFFF?Working in pages is not a problem, I just assign a group of pages to each virtual memory location.

author: Psi
author_rank: Super Contributor
timestamp: July 04, 2015, 01:44:46 pm
content: If you talking about serial flash you need a microcontroller to send commands to the chip and tell it what address you want to read/write.Technically i guess you could make something with logic gates/ICs to interface to a serial flash chip with no microcontroller but that would be unusual.

author: amyk
author_rank: Super Contributor
timestamp: July 04, 2015, 02:41:15 pm
content: There are plenty of 4Mx16 parallel (NOR flash) available.

author: David_AVD
author_rank: Super Contributor
timestamp: July 04, 2015, 10:38:25 pm
content: You can get FLASH memory that is writable on a byte basis. These parts handle the read, erase, modify and rewrite themselves I believe. They are not as cheap or common as page type chips though.

author: retrolefty
author_rank: Super Contributor
timestamp: July 05, 2015, 12:54:02 am
content: I've moved onto using just SD memory modules and work at the file exchange basis.

author: bktemp
author_rank: Super Contributor
timestamp: July 05, 2015, 04:27:39 am
content: Quote from: David_AVD on July 04, 2015, 10:38:25 pmIt depends on the definition of writeable:There are some parts that allow updating of singe bytes of data and handle everything necessary internally. They are commonly called EEPROMs.The other type of memory allows writing single bytes, but it can only erase blocks (4k, 16k or 64k) of data like the Microchip/SST Supeflash.Page writes are faster in most cases, byte writes allow for more flexibility in data size.

author: Psi
author_rank: Super Contributor
timestamp: July 05, 2015, 04:40:00 am
content: You can get weird behavior when using flash memory with a build in controller if you don't understand how the memory works inside the chip.If, for example, you send commands to write 100 bytes spanning across the memory space (each byte in a different page) the write would require 100 pages be erased and copied back and that could take 10 seconds.Where as, if you write 100 bytes in one page the delay would be a few ms and not even noticeable.Of course, there's lots of fancy things that the IC could do internally to try and "hide" these delays and re-order the data after the write but this requires a file system and then your relying on the fact that the manufacture has written a filesystem that isn't going to get corrupt if the power fails while its doing something.This is why solid state hard drive reliability is a issue, not so much due to wearing out the flash but because the filesystems can have bugs.The OCZ Vortex 2 SSD's are a good example. They would often get corrupt.