Tuesday, May 26, 2009

Memory




















Memory is place where we store what we call 'data'. Memory divided into 2 main categories.

1) Volatile
2) Non-Volatile

Volatile Memory
Volatile memory basically define as memory that its contents loss if the power to the memory gone. Example of such memory is:-

- SRAM (Static Ram)
- SDRAM or DRAM (Dynamic Random Access Memory)

Non-Volatile Memory
Non-volatile memory basically defines as memory that it's contents will not erase even when the power is gone. Example such memory is:-

- PROM, EEPROM
- Flash

Why not use everything non-volatile?
It will be very good if we could use all the memory in our design as non-volatile. The main issue to do this is speed. Non-volatile memory work much slower than volatile especially during write operations.
Both of this memory also are access differently. All volatile memory can be access randomly. Random access means that any memory location can be read on one instructions. Unlike flash memory, it need to be access semi-sequential. To read a particular byte from the memory, you need to read the whole page of the flash. In flash memory, page is group of 512bytes or 256bytes.

Internal & External Memory
If you look at the datasheets of MCU, it will specify something like internal SRAM - xxx kB, internal program memory - xxx kB. This means that both type of memory is inside the MCU IC itself. But this doesn't mean that the amount of memory it have is limit by that. Sometimes you could have some of the memory internal and some external. The limit of memory space basically depend on how big the address bus is. 16bit address line can adress up to 64K and 32bit can goes up to 4GB.

No comments: