Unit-3 MPMC Final
Unit-3 MPMC Final
• This LCD has two registers, namely, Command and Data. The command
register stores the command instructions given to the LCD.
• The data register stores the data to be displayed on the LCD. The data is the
ASCII value of the character to be displayed on the LCD.
• The LCD display module requires 3 control lines as well as either 4 or 8 I/O lines for the data
bus.
• The user may select whether the LCD is to operate with a 4-bit data bus or an 8-bit data bus.
• If a 4-bit data bus is used the LCD will require a total of 7 data lines (3 control lines plus the 4
lines for the data bus).
• If an 8-bit data bus is used the LCD will require a total of 11 data lines (3 control lines plus the 8
lines for the data bus).
• LCD COMMANDS:
Interfacing LCD with 8051 Microcontroller – CIRCUIT
DIAGRAM
• In 4X4 matrix keypad, in which there are 4 push buttons in each of four rows. And the terminals of the
push buttons are connected according to diagram.
• In first row, one terminal of all the 4 push buttons are connected together and another terminal of 4
push buttons are representing each of 4 columns, same goes for each row.
1. First we have made all the Rows to Logic level 0 and all the columns to Logic level 1.
2. Whenever we press a button, column and row corresponding to that button gets
shorted and makes the corresponding column to logic level 0. Because that column
becomes connected (shorted) to the row, which is at Logic level 0. So we get the column
no. See main() function.
3. Now we need to find the Row no., so we have created four functions corresponding to each
column. Like if any button of column one is pressed, we call function row_finder1(), to find the
row no.
4. In row_finder1() function, we reversed the logic levels, means now all the Rows are 1 and
columns are 0. Now Row of the pressed button should be 0 because it has become connected
(shorted) to the column whose button is pressed, and all the columns are at 0 logic. So we have
scanned all rows for 0.
5. So whenever we find the Row at logic 0, means that is the row of pressed button. So now we
have column no (got in step 2) and row no., and we can print no. of that button using lcd_data
function.
Program Code:
External RAM & ROM -Interfacing Using 8051
Why need External Memory Interfacing in 8051 Microcontroller:
1. Limited internal memory: The 8051 microcontroller has a limited amount of internal memory, including 128 bytes of
RAM and 4KB of on-chip ROM. This memory may not be sufficient for some applications that require larger program
2. Larger programs: For applications that require larger programs, such as complex algorithms or multiple functions,
external memory interfacing can provide the necessary program memory space to store these programs.
3. Data storage: Applications that require the storage of large amounts of data, such as data logging or data analysis,
4. Flexibility: External memory interfacing provides greater flexibility in the design of embedded systems, allowing for
5. Cost-effective: External memory devices such as RAM and ROM are relatively inexpensive, making it cost-effective to
interface them with the microcontroller instead of using more expensive on-chip memory.
External RAM -Interfacing Using 8051
• External memory interfacing in 8051 microcontroller involves connecting external memory devices such as
RAM and ROM to the microcontroller to provide additional memory space.
• This allows the microcontroller to execute larger and more complex programs, store more data, and perform
more complex operations.
• External memory interfacing typically involves connecting the memory devices to the microcontroller
through a data bus and an address bus.
• The data bus is used to transfer data between the microcontroller and the memory device, while the address
bus is used to select a specific memory location in the memory device.
• To interface with external memory, the 8051 microcontroller uses dedicated pins such as ALE (Address Latch
Enable), PSEN (Program Store Enable), and RD (Read) and WR (Write) signals.
• These signals are used to control the flow of data between the microcontroller and the external memory
device.
External RAM -Interfacing Using 8051