It stands for Read-Only Memory (ROM). The memory from which we can only read but cannot write on it.
This type of memory is non-volatile.
The information is stored permanently in such memories during manufacture.
A ROM stores such instructions that are required to start a computer (e.g. System Program).
ROM chips are not only used in the computer but also in other electronic items like in a washing machine and microwave oven.
It stands for Programmable Read-Only Memory (PROM).
Users can burn information into.
One Time Programmable (OTP)
For every bit, there is a fuse to blow
If burnt wrong then the whole PROM is to be discarded.
ROM burner/ programmer needed.
It stands for Erasable Programmable ROM (EPROM).
Thousands of time erasable
Erasing techniques are of two types, i.e. UV-PROM, EE PROM
UV-PROM stands for Ultra Violet PROM.
Need 20 mins UV light to erase.
12.5V ROM burner voltage-Vpp.
Separate programmer & eraser.
Electrically Erasable PROM.
Thousands of times it can be erased.
One byte can be selected to erase.
Does not require external erasure and programming devices.
Erases all contents in a second
Electrical method
No byte erasure but some can have a block erasure option
Inboard so used in BIOS ROM.
Computer: - A computer is a machine that can be programmed to carry out sequences of instruction automatically. OR A computer is a programmable device that stores, retrieves & process data.
Micro µComputer: - Microcomputer is a device with a microprocessor as its “central processing unit (CPU)”
Course content:
Computer organization architecture
µprocessor architecture & programming
Generic µP
8085µp 8086µp
6800µp 68000µp
Interfacing
The world’s first µ.p was the intel 4004 (early 1970). It was a 4-bit µprocessor. It addressed 4096 locations /addresses. Its Instruction set contains 45 instructions. It has a Clock speed of 50 KIPS(Kilo Instruction Per Second).
Video games, µp-based control system, µ wave oven, tv remote etc.
µp is an IC that contains much of the processing capabilities of a large computer. The µp is a small but extremely complex LSI (large-scale integrated) circuit/device that is programmable. A microprocessor is also known as a central processing unit in which numbers of peripherals’ are fabricated on a single chip. It has ALU (arithmetic and logic unit), a control unit, registers, bus systems and a clock to perform computational tasks.
The microcomputer is a computer with a CPU, mouse, keyboard, screen, mouse, etc. This type of computer is also known as a PC or desktop PC. This computer is smaller than a mainframe and supercomputer. PC is used at the home or in some commercial areas. The following are the main advantages of microcomputers given below.
Small in size
Fast
Low cost
Assignment:
Basic components of computer:
1. CPU/MP
2. Input device
3. Output device
4. Memory unit
5. Control unit.
The physical units (which can be seen/touched) are referred to as Hardware.
They contain information/instructions to tell the CPU what to do?
Preparing the list of instructions is called programming.
The list of instructions is called a program.
It is stored permanently/temporary in program memory.
These programs manipulate or extract information called data.
"Software is a set of instructions, data or programs used to operate computers and execute specific tasks. It is the opposite of hardware, which describes the physical aspects of a computer. Software is a generic term used to refer to applications, scripts and programs that run on a device."
OR
It is the term used to represent all the programs.
Software is used to control a computer.
There are different types of software that can run on a computer: system software, utility software, and application software.
It is software that is permanently programmed in Program memory and is referred to as firmware.
OR
Firmware is a software program or set of instructions programmed on a hardware device. It provides the necessary instructions for how the device communicates with the other computer hardware.
A µcomputer system is a digital computer. It is a microcomputer because of smaller in size & low cost. The µprocessor forms the CPU section of the µcomputer. The µcomputer contains all the basic parts of a digital computer.
ALU or CPU
Control unit
Input devices
Output devices
Memory unit
The µprocessor controls all the units of a computer system using control lines/bus. e.g. Read/Write, Chipset, Set/Reset, etc.
The bus is a set of parallel conductors. Address bus selects a certain memory location, input or output ports. It is a unidirectional bus.
The data bus is a two-way bus for transferring data in & out of µp.
For permanent storage, ROM is used. (For more detail see Semiconductor memories).
For temporary storage, RAM is used. (For more detail see Semiconductor memories).
These are the separate ICs.
Bit (Bit is a Binary digIT. It has values 0 or 1), Nibble (A group of 4 bits), Byte (A group of 8 bits or pair of two nibbles). A very important characteristic of any microprocessor is the size of the accumulator (heart of ALU) register. If the microprocessor is an 8-bit µp then the word size of that µp is also an 8-bit. In that case, 1 byte makes up a word.
Word: A word is a group of bits that are processed as a single number/instruction.
Hint: The size of the data bus/width of the data bus also indicates word size.
µP architecture.
Instruction set
Minimal system using the microprocessor
Control signal
Pin functions
The Architecture includes the Internal components of the microprocessors, e.g. Arithmetic and Logic Unit, Registers inside the microprocessor, and Data & Address buses. The timing and control circuitry synchronizes the operations.
A list of all the operations that a microprocessor can perform is called the instruction set. Along with the operations, the machine code is also present. The machine code is a binary number that is unique for each instruction collectively all the instructions are called the Instruction set of a microprocessor. These instructions include data transfer instructions, arithmetic instructions, logic instructions, shift instructions, and others.
Instructions use various addressing modes to read/access the data from memory and registers. Usually, the instruction set is included in a document called the Data Sheet and comes with the microprocessor. The instruction sets are not standardized that’s why they are different from processor to processor.
The system uses the address bus to identify/activate a particular device connected to the system (memory, input and output). Since there are a number of memory locations/input ports/ output ports in a system, the CPU issues a unique address on the address bus which only activates one location/port in the system. The control signals from the CPU then coordinate the CPU-Device communication. The CPU-RAM interaction where the CPU first issues an address of a RAM byte and then informs the memory about the nature of operations through a read (RD)/WR signal.
A microprocessor on its own is not much functional until it is connected with the other devices in the system. A system with a microprocessor as a CPU requires at least the following sections to function, such as,
ROM,
RAM,
Input devices
Output devices
A clock
address decoder etc
Such a system is called a minimal system as shown in above figure. As a student, we need such a minimal system to learn a new microprocessor. Several training kits nowadays available that have a minimal system with necessary power connections and I/O ports and enough amount of memory to learn the programming of a particular microprocessor, Such as
MAT-385 Microprocessor training kit
MDA 8086 Training Kit
The centre of all operations is the MPU (Micro Processor Unit) which needs a power supply and clock connections. The clock may be a separate circuit or may reside within the microprocessor chip. The simplified up might have 16 address lines, which form a one-way address bus, and it has 8-buffered data lines, which connect to the two-way data bus. The figure of a minimal system shows two types of semiconductor memories in this minimal system.
Writing into or reading from an storage location is called “accessing memory”.
Data is a sequential access is located by searching in serial fashion through all storage locations.
e.g magnetic tape, secondary memory.
In random access, any storage location can be written into or read from in a given time called “access time.”
The page number is the term used to describe the chunk of memory and is equal to the hexadecimal of the High Order Byte of the address. The open address means there is no memory available & accessing this memory will cause garbage values.
So in technical terms, we can say that
ROM is located on page no. 00h.
RAM is located at page no.20h
Both RAM and ROM are 256 byte and can store.
256x8 bits 1 IC
256x4x2 bits 2 ICs
256x1x8 bits 8 ICs
Here is a list of some commonly used instructions for the 8085 microprocessor, along with their mnemonics, opcodes, and purposes:
MOV (Move Data) - 8-bit Data Transfer
Mnemonic: MOV Rd, Rs
Opcode: Opcode: 0 1 D D D S S S
Purpose: Transfers data from the source register (Rs) to the destination register (Rd).
MVI (Move Immediate) - Immediate Data Transfer
Mnemonic: MVI R, data
Opcode: 0 0 D D D 1 1 0 (*DDD see at the end)
Purpose: Loads immediate data into the specified register or memory location.
LXI (Load Immediate) - Load 16-bit Immediate Data
Mnemonic: LXI Rp, data16
Opcode: 01 (for BC), 11 (for DE), 21 (for HL), 31 (for SP)
Purpose: Loads a 16-bit immediate value into the specified register pair.
LDA (Load Accumulator) - Load Data from Memory
Mnemonic: LDA address
Opcode: 3A
Purpose: Loads the content of the memory address into the accumulator.
STA (Store Accumulator) - Store Data into Memory
Mnemonic: STA address
Opcode: 32
Purpose: Stores the accumulator's content into the specified memory address.
LHLD (Load H and L Direct) - Load Data into HL Register Pair
Mnemonic: LHLD address
Opcode: 2A
Purpose: Loads the 16-bit data from the specified memory address into the HL register pair.
SHLD (Store H and L Direct) - Store HL Register Pair Data
Mnemonic: SHLD address
Opcode: 22
Purpose: Stores the content of the HL register pair into the specified memory address.
ADD (Addition) - Add Accumulator and Register
Mnemonic: ADD R
Opcode: 1 0 0 0 0 S S S
Purpose: Adds the content of the specified register (R) to the accumulator.
ADC (Addition with Carry) - Add Accumulator and Register with Carry
Mnemonic: ADC R
Opcode: 1 0 0 0 1 S S S
Purpose: Adds the content of the specified register (R) plus the carry flag to the accumulator.
SUB (Subtraction) - Subtract Register from Accumulator
Mnemonic: SUB R
Opcode: 1 0 0 1 0 S S S
Purpose: Subtracts the content of the specified register (R) from the accumulator.
SBB (Subtraction with Borrow) - Subtract Register from Accumulator with Borrow
Mnemonic: SBB R
Opcode: 1 0 0 1 1 S S S
Purpose: Subtracts the content of the specified register (R) plus the borrow flag from the accumulator.
INR (Increment) - Increment Register
Mnemonic: INR R
Opcode: 0 0 D D D 1 0 0
Purpose: Increments the specified register (R) by 1.
DCR (Decrement) - Decrement Register
Mnemonic: DCR R
Opcode: 0 0 D D D 1 0 1
Purpose: Decrements the specified register (R) by 1.
CPI (Compare Immediate) - Compare with Accumulator
Mnemonic: CPI data
Opcode: FE
Purpose: Compares the accumulator with an immediate value and sets flags accordingly.
JMP (Jump) - Unconditional Jump
Mnemonic: JMP address
Opcode: C3
Purpose: Transfers control to the specified memory address unconditionally.
Please note that the "DDD" in the opcodes represents different register codes, such as 000 for B, 001 for C, 010 for D, 011 for E, 100 for H, 101 for L, 110 for M (HL memory), and 111 for A (accumulator) in binary. There are many more instructions in the 8085 microprocessor's instruction set, but these are some of the fundamental ones.
The programming model of the 8085 microprocessor is a framework that describes the organization of its registers and their functions. Here is a description of the programming model of the 8085 microprocessor:
1. Accumulator (A):
The accumulator is an 8-bit register used for most arithmetic and logical operations.
It is the primary register for data manipulation.
The result of most operations is stored in the accumulator.
2. General-Purpose Registers (B, C, D, E, H, L):
These are 8-bit registers that can be used for various data manipulation operations.
They can be used individually or paired to form 16-bit register pairs (BC, DE, HL).
The HL pair is commonly used for memory operations.
3. Stack Pointer (SP):
The stack pointer is a 16-bit register used to manage the stack.
It stores the memory address of the top of the stack.
Stack operations, such as push and pop, are performed using SP.
4. Program Counter (PC):
The program counter is a 16-bit register that keeps track of the memory location of the next instruction to be executed.
It is automatically incremented after fetching each instruction.
5. Flags Register (F):
The flags register contains various status flags that reflect the outcomes of arithmetic and logical operations:
Zero (Z) Flag: Set if the result of an operation is zero.
Sign (S) Flag: Indicates the sign of the result (set for negative).
Parity (P) Flag: Set if the result has an even number of set bits.
Carry (CY) Flag: Set if there is a carry out of the most significant bit during an operation.
Auxiliary Carry (AC) Flag: Used for binary-coded decimal (BCD) operations.
Problem Statement 1:- Write an assembly language program for an 8085 mp that adds two numbers 05h and F0h. Store the sum at 2500h.
Solution:-
; Initialize registers and variables
MVI A, 05H ; Load the first number (05H) into register A
MVI B, F0H ; Load the second number (F0H) into register B
; Add the two numbers
ADD B ; Add the contents of register B to A
; Store the result in memory or a register
STA 2500H ; Store the result in memory location 2500H
; Halt the processor
HLT ; End of program
Problem Statement 2:- Write a program for complement the accumulator 10 times and store the results starting from 2000h. Consider accumulator contains your roll number 05h.
Solution:-
; Initialize registers and variables
MVI A, 05H ; Load the initial value (your roll number) into the accumulator
MVI B, 0AH ; Set the loop counter to 10 (complement 10 times)
LXI H, 2000H ; Load the memory address where the result will be stored
; Main loop to complement the accumulator
LOOP: CMA ; Complement the accumulator (A)
STA M ; Store the complemented value in memory
INX H ; Increment memory address
DCR B ; Decrement the loop counter
JNZ LOOP ; Continue the loop until the counter reaches zero
; Halt the processor
HLT ; End of program
Microcontroller (MC) may be called computer on chip since it has basic features of microprocessor with internal ROM, RAM, Parallel and serial ports within single chip. Or we can say microprocessor with memory and ports is called as microcontroller.
The 8051 microcontroller is a popular and widely used microcontroller in the field of embedded systems and microcontroller programming. It was first introduced by Intel in 1980, and it quickly gained popularity due to its versatile features and easy-to-use architecture. The 8051 microcontroller has become a standard for many embedded systems applications and is still relevant today, even though it has been around for several decades. The detail description of its architecture, features, and its significance in the world of embedded systems is given in the sequel.
The 8051 microcontroller was developed by Intel's Embedded Control Operation in the early 1980s. It was initially intended for use in embedded systems applications, particularly in control systems, but it quickly found applications in a wide range of industries, including automotive, industrial automation, consumer electronics, and more.
The 8051 microcontroller features a Harvard architecture, which means it has separate buses for program memory and data memory. It is an 8-bit microcontroller, meaning it processes data in 8-bit chunks. Here are some key components of its architecture:
CPU Core: The central processing unit of the 8051 microcontroller is an 8-bit processor that can execute a wide range of instructions. It has four general-purpose registers (R0, R1, R2, R3) and a variety of special function registers (SFRs) for specific control and data handling tasks.
Memory: The 8051 microcontroller has two types of memory: program memory (ROM) and data memory (RAM). The program memory is typically 4KB in size and stores the program code, while data memory is usually 128 bytes in size.
I/O Ports: The 8051 microcontroller typically has four parallel I/O ports, each of which can be configured as input or output. These ports are essential for interfacing with external devices.
Timers and Counters: The 8051 microcontroller features two 16-bit timers/counters which are versatile and can be used for various timing and counting applications.
Serial Communication: It has a UART (Universal Asynchronous Receiver/Transmitter) for serial communication, which makes it suitable for applications requiring communication with other devices.
Interrupt System: The 8051 microcontroller has a priority-level interrupt system, allowing for effective handling of external events and time-critical operations.
The 8051 microcontroller is known for its versatile features, which contribute to its widespread use in embedded systems. Some of its notable features include:
Low Power Consumption: The 8051 microcontroller is designed to operate efficiently with minimal power consumption, making it suitable for battery-powered and low-power applications.
High-Speed Clock: It can operate at high clock frequencies, typically up to 12 MHz, which allows for rapid execution of instructions.
Large Ecosystem: Over the years, the 8051 microcontroller has amassed a vast ecosystem of development tools, compilers, simulators, and a broad range of support in terms of documentation and community.
Versatility: Its flexible architecture and rich set of peripherals make it suitable for a wide range of applications, from simple LED blinking to complex control systems.
The 8051 microcontroller's longevity and continued relevance can be attributed to its robust architecture, ease of use, and extensive support. It has become a standard choice for many embedded systems engineers, and its familiarity has led to the development of an extensive knowledge base and a thriving community. Additionally, many derivatives and variations of the 8051 microcontroller have been produced by various manufacturers, ensuring its adaptability to evolving technology needs.
In conclusion, the 8051 microcontroller is a foundational element in the world of embedded systems. Its architecture, features, and historical significance make it an important microcontroller to study and work with for engineers and developers in the field of embedded systems and microcontroller programming.
The 8051 microcontroller includes on-chip ROM (Read-Only Memory) that stores the program code and instructions required for the microcontroller to operate. This ROM is often referred to as "Program Memory" or "Code Memory" and is an essential component of the microcontroller's memory system. The on-chip ROM contains the firmware or program that the 8051 microcontroller executes.
The on-chip ROM of the 8051 microcontroller stores the machine code or binary instructions that the microcontroller will execute. It contains the firmware or program that defines the behavior of the microcontroller, including instructions for data manipulation, control flow, and interaction with various peripherals.
The size of the on-chip ROM is fixed for a given 8051 microcontroller model and cannot be changed or expanded. In most standard 8051 microcontrollers, the ROM size is 4 kilobytes (4KB) or 8 kilobytes (8KB).
Non-Volatile:
The contents of the on-chip ROM are non-volatile, meaning the program remains stored in the ROM even when the microcontroller is powered off. This allows the microcontroller to retain its program between power cycles.
Masked ROM vs. Flash ROM:
There are two common types of on-chip ROM used in 8051 microcontrollers:
Masked ROM: In older 8051 microcontroller models, the ROM is implemented using a masked ROM, which means the program is "burned" into the silicon during manufacturing and cannot be modified.
Flash ROM: In more modern variants, particularly in 8051 microcontroller derivatives, a flash ROM is used. Flash ROM allows for in-circuit programming, enabling users to erase and reprogram the microcontroller's memory as needed.
MC 8051 has 128 byte Random Access memory for data storage. During execution for storing the data the RAM is used. RAM consists of the register banks, stack for temporary data storage. It also consists of some special function register (SFR) which are used for some specific purpose like timer, input output ports etc. Normally microcontroller has 256 byte RAM in which 128 byte is used for user space which is normally Register banks and stack. But other 128 byte RAM which consists of SFRs.
Now what is the meaning of 128 byte RAM. What are address range which is provided for data storage. We will discuss here. We know that 128 byte = 2^7 byte. Since 2^7 bytes so last 7 bits can be changed so total locations are from 00H to 7F H. This procedure of calculating the memory address is called as “memory mapping”. We can save data on memory locations from 00H to 7FH. Means total 128 byte space from 00H to 7FH is provided for data storage as shown in above figure.
EA/VPP (Pin 1): EA stands for External Access Enable, and it is used to enable or disable the external program memory. VPP is used for programming in some variants.
ALE/PROG (Pin 2): ALE stands for Address Latch Enable, and it is used to indicate the availability of a valid address on the address bus. PROG is used for programming in some variants.
PSEN (Pin 3): PSEN stands for Program Store Enable, and it indicates that external program memory is being accessed.
P0.0 to P0.7 (Pins 21-28): Port 0 pins are bidirectional I/O pins and can also be used for addressing external memory or peripherals.
RST (Pin 9): Reset input. It is used to reset the microcontroller.
RXD and TXD (Pins 10 and 11): These pins are used for serial communication (UART) for receiving and transmitting data.
INT0 and INT1 (Pins 12 and 13): External interrupt inputs.
T0 and T1 (Pins 14 and 15): Timer inputs for Timer 0 and Timer 1.
WR and RD (Pins 16 and 17): Control pins for writing to and reading from external memory.
XTAL2 and XTAL1 (Pins 18 and 19): Crystal oscillator connections for the microcontroller's clock source.
GND (Pin 20): Ground connection.
P1.0 to P1.7 (Pins 29-36): Port 1 pins are bidirectional I/O pins.
P3.0 to P3.3 (Pins 37-40): Port 3 pins are bidirectional I/O pins, and some of them are used for serial communication and external interrupts.