Memory Interfacing | Embedded Systems (Web) - Computer Science Engineering (CSE) PDF Download

Instructional Objectives 

After going through this lesson the student would learn 

  • Requirement of External Memory  
  • Different modes of a typical Embedded Controller
  • Standard Control Signals for Memory Interface 
  • A typical Example 

Pre-Requisite 

Digital Electronics, Microprocessors 

Introduction 

Memory Interfacing | Embedded Systems (Web) - Computer Science Engineering (CSE)

CPU: The processing module of the microcontroller  

Fig. 12.1 The basic architecture of a Microcontroller 

Fig. 12.1 shows the internal architecture of single chip microcontroller with internal RAM as well as ROM. Most of these microcontrollers do not require external memory for simpler tasks.
 The program lengths being small can easily fit into the internal memory. Therefore it often provides single chip solutions. However the amount of internal memory cannot be increased beyond a certain limit because of the following reasons.

  • Power Consumption 
  • Size 

The presence of extra memory needs more power consumption and hence higher temperature rise. The size has to be increased to house the additional memory. The need for extra memory space arises in some specific applications.  Fig. 12.2 shows the basic block diagram of memory interface to a processor.  

Memory Interfacing | Embedded Systems (Web) - Computer Science Engineering (CSE)

Fig. 12.2 The Memory Interface 

External Memory Interfacing to PIC18F8XXX family of microcontrollers 

Memory Interfacing | Embedded Systems (Web) - Computer Science Engineering (CSE)

Fig. 12.3 External Memory Interface Diagram 

The above family of microcontroller can have both on-chip as well as off chip external memory. At times the on-chip memory is a programmable flash type. A special register inside the microcontroller can be programmed (by writing an 8 bit or 16-bit binary number) for using this external memory in various modes. In case of the PIC family the following modes are possible 

Microcontroller Mode 

The processor accesses only on-chip FLASH memory. External Memory Interface functions are disabled. Attempts to read above the physical limit of the on-chip FLASH causes a read of all ‘0’s (a NOP instruction).

Microprocessor Mode 

The processor permits execution and access only through external program memory; the contents of the on-chip FLASH memory are ignored. 

Microprocessor with Boot Block mode 

The processor accesses on-chip FLASH memory within only the boot block. The boot block size is device dependent and is located at the beginning of program memory. Beyond the boot block, external program memory is accessed all the way up to the 2-MByte limit. Program execution automatically switches between the two memories as required. 

Extended Microcontroller Mode 

The processor accesses both internal and external program memories as a single block. The device can access its entire on-chip FLASH memory; above this, the device accesses external program memory up to the 2-MByte program space limit. As with Boot Block mode, execution automatically switches between the two memories as required. 

Memory Interfacing | Embedded Systems (Web) - Computer Science Engineering (CSE)

Fig. 12.4 The memory Map in different modes 

Memory Interfacing | Embedded Systems (Web) - Computer Science Engineering (CSE)

Fig. 12.5 The address, data and control lines of the PIC18F8XXX microcontroller required for external memory interfacing 

The address, data and control lines of a PIC family of microcontroller is shown in Fig. 12.5 and are explained below. 

AD0-AD15: 16-bit Data and 16 bits of Address are multiplexed 

A16-A19: The 4 most significant bits of the address  

ALE: Address Latch Enable Signal to latch the multiplexed address in the first clock cycle 

Memory Interfacing | Embedded Systems (Web) - Computer Science Engineering (CSE) Write Low Control Pin to make the memory write the lower byte of the data when it is low 

Memory Interfacing | Embedded Systems (Web) - Computer Science Engineering (CSE)Write High Control Pin to make the memory write the higher byte of the data when it is low 

Memory Interfacing | Embedded Systems (Web) - Computer Science Engineering (CSE) Output Enable is made low when valid data is made available to the external memory 

Memory Interfacing | Embedded Systems (Web) - Computer Science Engineering (CSE) Chip enable line is made low to access the external memory chip  

BA0: Byte Address 0 

Memory Interfacing | Embedded Systems (Web) - Computer Science Engineering (CSE) Lower Byte Enable Control is kept low when the lower byte is available for the memory. 

Memory Interfacing | Embedded Systems (Web) - Computer Science Engineering (CSE) Upper Byte Enable Control is kept low when the upper byte is available for the memory. 

The microcontroller has a 16-bit wide bus for data transfer. These data lines are shared with address lines and are labeled AD<15:0>. Because of this, 16 bits of latching are necessary to demultiplex the address and data. There are four additional address lines labeled A<19:16>. The PIC18 architecture provides an internal program counter of 21 bits, offering a capability of 2 Mbytes of addressing.  

There are seven control lines that are used in the External Memory Interface: ALE, Memory Interfacing | Embedded Systems (Web) - Computer Science Engineering (CSE) . All of these lines except Memory Interfacing | Embedded Systems (Web) - Computer Science Engineering (CSE) may be used during data writes. All of these lines except WRL  and WRH may be used during fetches and reads. The application will determine which control lines are necessary. The basic connection diagram is shown in Fig. 12.6.  The 16-bit byte select mode is shown here. 

Memory Interfacing | Embedded Systems (Web) - Computer Science Engineering (CSE)

Fig. 12.6 The connection diagram for external memory interface in 16-bit byte select mode 

The PIC18 family runs from a clock that is four times faster than its instruction cycle. The four clock pulses are a quarter of the instruction cycle in length and are referred to as Q1, Q2, Q3, and Q4. During Q1, ALE is enabled while address information A<15:0> are placed on pins AD<15:0>. At the same time, the upper address information A<19:16> are available on the upper address bus. On the negative edge of ALE, the address is latched in the external latch. At the beginning of Q3, the Memory Interfacing | Embedded Systems (Web) - Computer Science Engineering (CSE) output enable (active low) signal is generated. Also, at the beginning of Q3, BA0 is generated. This signal will be active high only during Q3, indicating the state of the program counter Least Significant bit. At the end of Q4, Memory Interfacing | Embedded Systems (Web) - Computer Science Engineering (CSE) goes high and data (16-bit word) is fetched from memory at the low-to-high transition edge of Memory Interfacing | Embedded Systems (Web) - Computer Science Engineering (CSE). The timing diagram for all signals during external memory code execution and table reads is shown in Fig. 12.7. 

Memory Interfacing | Embedded Systems (Web) - Computer Science Engineering (CSE)

Fig. 12.7 Timing Diagram for Memory Read  

Conclusion 

This lesson discussed a typical external memory interface example for PIC family of microcontrollers. A typical timing diagram for memory read operation is presented. 

The document Memory Interfacing | Embedded Systems (Web) - Computer Science Engineering (CSE) is a part of the Computer Science Engineering (CSE) Course Embedded Systems (Web).
All you need of Computer Science Engineering (CSE) at this link: Computer Science Engineering (CSE)
47 videos|69 docs|65 tests

Top Courses for Computer Science Engineering (CSE)

FAQs on Memory Interfacing - Embedded Systems (Web) - Computer Science Engineering (CSE)

1. What is memory interfacing?
Ans. Memory interfacing refers to the process of connecting external memory devices, such as RAM or ROM, to a microprocessor or a computer system. It enables the microprocessor to access and manipulate data stored in these external memory devices.
2. Why is memory interfacing important in computer systems?
Ans. Memory interfacing is crucial in computer systems as it allows the microprocessor to access larger amounts of memory beyond its built-in memory capacity. It helps in storing and retrieving data from external memory devices, which enhances the overall performance and functionality of the computer system.
3. What are the different types of memory interfaces commonly used?
Ans. There are various types of memory interfaces used in computer systems, such as parallel memory interfaces, serial memory interfaces, synchronous memory interfaces, and asynchronous memory interfaces. Each type has its own advantages and is chosen based on the specific requirements of the system.
4. How does memory interfacing work in microcontrollers?
Ans. In microcontrollers, memory interfacing is typically done through the use of address and data buses. The microcontroller generates the memory address on the address bus, and the data to be read from or written to the memory is transferred through the data bus. This allows the microcontroller to communicate with external memory devices and access the required data.
5. What are some common challenges in memory interfacing?
Ans. Some common challenges in memory interfacing include addressing limitations, speed mismatches between the microprocessor and memory devices, power consumption, and signal integrity issues. These challenges require careful design considerations to ensure reliable and efficient memory interfacing in computer systems.
47 videos|69 docs|65 tests
Download as PDF
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

shortcuts and tricks

,

Memory Interfacing | Embedded Systems (Web) - Computer Science Engineering (CSE)

,

study material

,

past year papers

,

video lectures

,

Objective type Questions

,

Free

,

ppt

,

Important questions

,

Viva Questions

,

Summary

,

Extra Questions

,

Memory Interfacing | Embedded Systems (Web) - Computer Science Engineering (CSE)

,

pdf

,

MCQs

,

Exam

,

Memory Interfacing | Embedded Systems (Web) - Computer Science Engineering (CSE)

,

Sample Paper

,

practice quizzes

,

mock tests for examination

,

Semester Notes

,

Previous Year Questions with Solutions

;