Memory of Microcontroller used in the development of Projects

 Memory Associated with Micro-controllers

The memory for microcontrollers is an important part. Here we will discuss the types of memories associated with microcontrollers. There are various memory types like RAM, ROM, and EEPROM etc. We will discuss all types of memories one by one.

Data Memory:

The MCU uses data memory to store the real time calculation results temporary which are normally available until the power is available to the system. The data that is stored in data memory is short-lived, but it will be valid for as long as the CPU is running. To store the useful results permanently the MCU needs some permanent memories. The microcontrollers have normally on-chip data memory.

Instruction Memory:

The instruction memory is that where the actual program instruction are stored and read one by one for the execution purposes. In microcontrollers the instruction memory is usually integrated right into the chip or MCU. This type of memory is the most prominent uses of memory in or around a CPU. In between the data memory and Instruction memory there are some other type of hardware memories used for data exchange between these two like registers, caches, various buffers etc. The size of such on-chip memory is limited. It is often not possible to expand this type of memory externally and sometimes as whole a n external memory is used but it increase cost and design complexity too. As the MCUs are most often used for relatively simple tasks and hence do not need excessive amounts of memory. Normally the data and instruction memory on the chip remain enough for general purpose projects which is the beauty of MCU. Therefore the total system cost is decreased considerably. The Different model and manufacturer of MCU usually provide different amounts of memory. The functional difference of memory types above is based on the way the memory is used in the project.

Therefore before designing a circuit of a project one should have to select the appropriate MCU for the application under consideration the memory of MCU is one of the critical parameters used in selection of right MCU.  So you can choose a particular MCU which offers the appropriate memory space for your project.

Other Types of memories:

  • Volatile memory
  • Non-volatile memory
  • Volatile memory

    Volatile means that the contents of the memory are gone or lost or not available as soon as the system’s power is switched off. Volatile memory can be static or dynamic memory. It means that the volatile memory retains its contents only so long as the system is powered on. The important feature of Volatile memories is that it is normally very fast, as the access time of volatile memories remains in order of nanoseconds range. The volatile memory is generally called RAM (Random Access Memory). RAM allowed direct access to any address or location of whole memory and at the same time one can only be read and written sequentially. The random access memory reflects the fact that, from the memory’s perspective, any ‘random’, i.e., arbitrary, address could be accessed.

    Static RAM

    The Static Random Access Memory (SRAM) is the first type of volatile memory to be widely used in the field of computers, microcontrollers and microprocessors. The SRAM chip consists of an array of cells called flip-flop, each flip-flop is capable of storing one bit of information. A flip-flop is used to store a bit of information which basically consists of multiple transistors and associated electronics components. One SRAM flip-flop has the inputs and outputs which are described as under:

    Data In Din: On this input, the flip-flop accepts the one bit of data to be stored.

    Data Out Dout: This output reflects the bit that is stored in the flip-flop.

    Read/Write:

    The R/W operation is possible using this input pin of flip-flop, the type of access or operation whether we want to read or write is specific to logical level on this pin. For example, the logical level 0 means the flip-flop is to be used for write operation means the bit is required to store into the flip-flop, i.e., the current state of Din will be stored in the flip-flop. The logical level, 1 means that the flip-flop is used to be read, so it should set Dout according to the stored value in flip-flop.

    Cell Select: The CS pin on flip-flop is used to select the chip for any operation it is enable or disable through logic levels. If the input signal on CS is logical 0, the flip-flop does not accept any data present at Din and keeps its output Dout in a so-called high resistance state, which in fact disconnects it from the rest of the circuit of the project where the memory is being used. On a rising edge, the flip-flop either accepts the state at Din as the new bit to store or it sets Dout to the currently stored value depends upon the requirement of operation through other input control signal like read or write pin.

    Non-volatile memory

    The Non-volatile means that the contents of the memory remain even if the system’s power is switched off. There is quite a variety of non-volatile memory types: ROM, PROM, EPROM, EEPROM, FLASH, NV-RAM etc. The non-volatile memories retain their content even when power is cut off as compared to above stated SRAMs and DRAMs. The non-volatile memory types are usually much slower as compared to the Volatile memory.

    ROM

    The Read Only Memories (ROMs) are the first types of non-volatile semiconductor memories. As the name indicates, it is read only memory and simply cannot be used for write operation. The vender or manufacture stores the data once during the manufacturing time; it cannot be changes by user after that. A common type of ROM is the called Mask-ROM (MROM). During the fabrication of MROM the vender normally uses masks in IC to create the layers in memory.

    PROM

    Programmable Read Only Memory (PROM) is basically matrices of memory cells, each containing a silicon fuse. Initially, each fuse is unbroken and every cell reads as a logical 1. By selecting a cell and applying a brief but high current pulse, the cell’s fuse is often destroyed, thereby programming a logical level 0 into the chosen cell. Sometimes, you'll encounter so-called just the once Programmable (OTP) microcontrollers. Those contain PROM as instruction memory on chip. PROMs and OTP microcontrollers are, of course, not suitable for development, where the content of the memory should still have to be changed. But once the event process is finished, they're well-suited for middle range production.

    EPROM

    Erasable Programmable Read Only Memory (EPROM) overcomes the drawbacks of ROM and PROM and facilitates the developer to alter the contents of program memory if required. The re-programming of EPROM is non-destructive. Memory is stored in field effect transistors (FETs), or rather in one in every of their pins called gate. It’s aptly named floating gate, because it is totally insulated from the remainder of the circuit. However, by applying an appropriately high voltage, it's possible to charge the floating gate via a physical process called avalanche injection. So, rather than burning fuses, electrons are injected into the floating gate, thus closing the transistor switch. Once a cell is programmed, the electrons should remain within the floating gate indefinitely. To program the EPROM, the developer should apply a special programming voltage to the EPROM, which is typically over the operating voltage. A UV source of illumination is required to erase EPROM.

    EEPROM

    The EEPROM (Electrically Erasable and Programmable ROM) has all the benefits of an EPROM with none additional arrangements. By using EEPROMs, we don’t need any special voltage which was required within the case of EPROMs for programming operations on that. Similarly no more UV source of illumination is required for erasing. The EEPROM works very kind of like EPROM, except that the electrons are aloof from the floating gate by applying an elevated voltage. a limited number of write/erase cycles only (usually within the order of 100000 cycles). EEPROMs are used quite regularly in microcontroller applications. One example where EEPROMs are best used is that the storage of calibration parameters.

    Flash

    Flash could be a variant of EEPROM where erasing isn't possible for every address, but just for larger blocks or maybe the complete memory (erased ‘in a flash’). thanks to the actual fact that it’s unimaginable to erase single bytes, Flash EEPROM is usually used for program, not data memory. The Flash-EEPROMs often have a lower write/erase cycle as compared to EEPROMs about 10 times lesser. 

    NVRAM

    The Non-Volatile RAM (NVRAM) may be a form of memory that mixes the benefits of volatile and non-volatile memories. a technique is to only add a little internal battery to an SRAM device, in order that when external power is changed, the SRAM still retains its content. Another variant is to mix a SRAM with an EEPROM in one package. Upon power-up, data is copied from the EEPROM to the SRAM. During operation, data is read from and written to the SRAM. When power is bring to a halt, the information is copied to the EEPROM.

    FAQ for Memory Organization of Microcontrollers:

    How to use the memory in the development of Microcontroller projects?

    As we know that the microcontrollers are a large-scale integrated chip system having the processor, the memory and interfaces of peripherals. Thus, the Microcontroller are used in the designing of an embedded system. The microcontrollers have built in memory with them. Like, the Microcontrollers have volatile memory named as Random Access Memory (RAM) and non-volatile memory like flash memory, and Erasable Programmable Read Only Memory (EPROM). Some microcontrollers have electrically Erasable Programmable Read Only Memory (EEPROM) with in the same chip if microcontroller. The construction of a microcontroller project involves the use of memory during the storage of program in microcontroller, execution of program during run time memory usage, and save the results into memory after performing some calculations. All three main usages as describes involve the use of memory in microcontrollers.

    How to manage memory in programmatically?

    The hex file is burned into microcontroller program memory ROM, code is run and executed in RAM, and temporarily changes in parameters are stored in EEPROM of microcontrollers.

    How do memory management consider in application development?

    Normally the microcontrollers have enough memory for small and medium size projects. The memory issues come in larger projects. Then appropriate microcontroller are selected which can hold large programs and additional external memories are attached with them.

    What are the main differences between the Microcontrollers and microprocessors?

    The microcontrollers do have their RAM, ROM, EEPROM with them on single chip and are ready to direct interface with real world through their input/ output port, requires less addition components to perform basic tasks. At the other hand the microprocessors need use of external RAM, external ROM, and external EPROMs. There are buses for communication between various memories and other external devices. The focus in microprocessor is on powerful computation abilities rather than smart design.

    Do the microcontroller have external memory interfaces?

    Normally the need of external memory is felt in bigger projects and microcontrollers have provisions to interface memories externally. When an embedded system has a microcontroller unit in it and program does not fit in the program memory of microcontroller, then additional memory is attached. In some cases, the microcontroller does not have program memory at all like the microcontroller from 8051 family number 8031 has no program memory on the chip. Now an external memory is necessarily interface with it to perform any task by these 8031 microcontrollers. Therefor we can say that the External memory interfacing in microcontroller involves interfacing external memory chips such as RAM and ROM to the any microcontroller for additional memory spaces. It will make easy the microcontroller to execute larger and more complex programs in complex operations. Thus, the external memory interfacing is connecting the memory chips to the microcontroller with its data bus and address buses. As we know that the data bus is to transfer data between the microcontroller and the memory and the address bus is for addressing the specific memory location within attached memory.

    Can we add external RAM to microcontroller?

    Yes, the external RAM chips can be added with the microcontroller using the interfaces like SPI or I2C.

    Which memory rating identifies the fastest memory?

    Overall in the all types of memories used in computer world the Cache memory is considered the fastest system memory. The Cache memory is built to keep up the CPU as it fetches and executes instructions very quickly. The data which is to be used most frequently by the CPU itself is stored in cache memory. The memory chips used for cache memory are Static Random Access Memory (SRAM).

    Do microcontrollers have memory?

    Yes the microcontrollers do have their own RAM, ROM with them.

    What is the History of Microcontrollers?

    Microcontrollers were first invented in the early 1970s and later on becoming commercially available around 1974. Gary Boone which is an engineer from Texas Instruments invented the initial concept of the microcontroller.

    What is program memory in microcontroller?

    The microcontroller requires two types of Memories for work which are the Program Memory and the Data Memory. The Program Memory stores the program which is consisting of the instructions to be executed by the CPU. The Program Memory is a Read Only Memory or ROM. On the other hand, the Data Memory is used to store the temporary value of various parameters, variables in the form of data while executing the program. The Data Memory is a Random Access Memory or RAM. program memory size of pic microcontroller

    What are the types of memories named nonvolatile memory?

    The nonvolatile memory are of five types. The names of nonvolatile memory are Flash Memory, Ferroelectric Random Access Memory (FeRAM), Magnetic Random Access Memory (MRAM), Phase Change Memory (PCM), and RRAM. Similarly these memories are also considered in the category of non-volatile memory like Read-Only Memory (ROM), Flash Memory, Magnetic Computer Storage Devices, Hard Disks, Floppy Discs, Magnetic Tape, Optical Discs, Paper Tape and Punched Cards.

    Can a microcontroller work on Linux?

    The Linux is an operating system used in larger microprocessor based computers. The use of Linux in microcontroller world is limited. So we say that the LINUX operating system as a larger operating system will not run on 8051, AVR, PIC Microcontroller, Cortex-M, or other similar sized microcontroller having similar kind of architectures. So to run Linux the minimum processer like ARM Cortex-A, ARM926EJ-S will be required. The important difference between processors and above said microcontroller is memory management. The microprocessors have a memory management unit (MMU) which the small microcontroller do not have with them. The Tiny Microcontroller on which the Linux can run is Jupiter Nano. Similarly the Raspberry Pi OS which is formerly known as Raspbian is an embedded system board which can run Linux.

    The developers and designers like to use Linux in embedded system due to some best features like LINUX is an open-source and also have good developer support by providing efficient tools. So up to this point one thing is very clear that the Linux is not a coding language for any kind of programming but it is an operating system (OS) which can support some embedded devices that are capable to run on an OS. Secondly the other thing is also well cleared that the LINUX runs on powerful processors like the Cortex A series, and the Raspberry Pi. Every project of embedded system will be starting with customizing, and deploying the toolchain, the bootloader, the kernel, and the root filesystem in LINUX. Interestingly one important thing to be shared here is that the 8088 family processor can also be used to run the Linux on them for limited tasks and operations as the capabilities of 8088 processors are not enough to handle the requirements of linux. There are some Linux systems having full vendor support but these need a have lots of memory, flash, MMC disk, SD card slot, PCI slots for wireless cards, HDMI outputs etc. For a prototype experiments the developer or designer may use  Raspberry Pi . After the maturity of application the own PCB having a mid range CPU with MMU, enough memory to run a standard system, enough flash to keep it can be designed. 

    What are the types of memory in microcontroller based project?

    The microcontroller have RAM, ROM and some of the microcontroller can have EEPROM with them. microcontroller memory organization,

    What is data memory in microcontroller?

    The RAM is the data memory of microcontroller.

    Which memory of the microcontroller stores the .hex file ?

    The ROM of microcontroller carries the information stored in hex file but in other format base on the microcontroller memory organization.

    Does a microcontroller need external memory?

    It has been already addressed in above question that the Microcontrollers may do not have enough internal memory for larger applications as the size of ROM/RAM is limited to design of microcontroller make & model. In these cases, external memory is necessary. 

    No comments:

    Post a Comment

    Please ask if you have any question regarding the programming of MCU, or have any problem in development of your electronics project. microcontroller51.blogspot.com

    Popular Post (All Time)