Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
50 views

Unit 3 - Microcontroller

The document discusses the 8051 microcontroller, including its features, applications, pin diagram, and interfacing with external memory. Key features include 4KB program memory, 128B data memory, 8-bit data bus, two timers, and four I/O ports. Common applications include automation, medical devices, and energy management. External memory can be interfaced to extend memory capacity.

Uploaded by

senthil
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views

Unit 3 - Microcontroller

The document discusses the 8051 microcontroller, including its features, applications, pin diagram, and interfacing with external memory. Key features include 4KB program memory, 128B data memory, 8-bit data bus, two timers, and four I/O ports. Common applications include automation, medical devices, and energy management. External memory can be interfaced to extend memory capacity.

Uploaded by

senthil
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

MICROPROCESSOR 8085 &

MICROCONTROLLER 8051
8051 Microcontroller
• Intel introduced it in the year 1981
• N-type metal-oxide-semiconductor (NMOS) based microcontroller
• Complementary metal-oxide-semiconductor(CMOS) technology
• System on a Chip (SoC) microcontroller

Feature 8051 8052 8031


ROM(bytes) 4K 8K 0K
RAM(bytes) 128 256 128
Timers 2 3 2
I/O pins 32 32 32
Serial port 1 1 1
Interrupt
6 8 6
sources
The Key features of the 8051 Microcontroller –
• 4 KB on-chip ROM (Program memory).
• 128 bytes on-chip RAM (Data memory).
• The 8-bit data bus (bidirectional).
• 16-bit address bus (unidirectional).
• Two 16-bit timers.
• Instruction cycle of 1 microsecond with 12 MHz crystal.
• Four 8-bit input/output ports.
• 128 user-defined flags.
• Four register banks of 8 bit each.
• 16-byte bit-addressable RAM.
• The general purpose registers are 32 each is 8-bit.
• 8051 has two external and three internal interrupts.
• 8051 microcontroller specifies some special function features like UARTs,
ADC, Op-amp, etc.
• It has a 16-bit program counter and data pointer.
Block Diagram
Applications
• Automation
• Medical Devices
• Energy management
• Touch Screen

Issues
• Limited Memory: The program memory is typically 4 KB or 8 KB, and the data memory is typically 128 bytes or 256 bytes
• Limited Processing Power: clock speed is typically between 12 MHz and 24 MHz
• Limited Development Tools: compilers, debuggers, and simulators are not as advanced
• Limited Peripheral Support: limited number of input/output pins
• Limited Security Features: does not have hardware security features, such as memory protection and encryption
PIN Diagram
• 40 pin Dual Inline Package (DIP)
• 4 I/O ports – each port has 8 pins
– 32 out of these 40 pins are dedicated to I/O ports
• Rest of the pins are dedicated to VCC, GND, XTAL1, XTAL2, RST, ALE,
EA’ and PSEN’.
1. VCC: This pin is connected to the power supply and provides a voltage of +5V to the microcontroller.
2. GND: This pin is connected to the ground and serves as the reference voltage for the microcontroller.
3. XTAL1 and XTAL2: These pins are used for connecting an external crystal oscillator that provides the clock signal for the
microcontroller.
4. Reset: This pin is used for resetting the microcontroller. A high pulse on this pin resets the microcontroller to its initial state.
5. Port 1: This is an 8-bit bidirectional input/output port that can be used for interfacing with external devices.
6. Port 2: This is an 8-bit bidirectional input/output port that can be used for interfacing with external devices.
7. Port 3: This is an 8-bit bidirectional input/output port that can be used for interfacing with external devices.
8. Port 4: This is an 8-bit bidirectional input/output port that can be used for interfacing with external devices.
9. INT0: This is an external interrupt 0 input pin.
10. INT1: This is an external interrupt 1 input pin.
11. T0: This is an external timer 0 input pin.
12. T1: This is an external timer 1 input pin.
13. WR: This is the write signal for external memory.
14. RD: This is the read signal for external memory.
15. ALE: This is the address latch enable signal that is used to latch the address for external memory.
16. PSEN: This is the program store enable signal that is used for accessing the program memory.
17. 17-24. Address bus: These pins are used for transmitting the address information to the external memory.
18. 25-32. Data bus: These pins are used for transmitting the data between the microcontroller and external memory.
19. RST: This is the output signal that indicates the microcontroller is being reset.
20. EA: This is the external access enable signal that is used for selecting the program memory.
21. VPP: This pin is used for programming the microcontroller.
22. 36-39. XTAL: These pins are used for connecting an external crystal oscillator.
23. P1.0 (AD0) – P1.7 (AD7): These pins are used for interfacing with external analog devices.
External Memory Interfacing
• Possible to extend the memory capacity by interfacing it with RAM and ROM
• Execute larger and more complex programs, store more data, and perform more complex operations
• Connecting the memory devices to the microcontroller through a data bus and an address bus
• Data bus is used to transfer data between the microcontroller and the memory device
• Address bus is used to select a specific memory location in the memory device
• Dedicated pins such as ALE (Address Latch Enable), PSEN (Program Store Enable), and RD (Read) and WR (Write)
signals - used to control the flow of data between the microcontroller and the external memory device
• ROM serves as program memory and RAM serves as data memory

• NECESSITY of INTERFACING
 Limited internal memory
 Larger programs
 Data storage
 Flexibility
 Cost-effective
External Program Memory

• The program fetches to addresses 0000H through OFFFH are directed to the internal ROM in the 8051 when the
EA pin is attached to Vcc, and
• The program fetches to addresses 1000H through FFFFH are directed to the external ROM/EPROM. When the EA
pin is grounded,
• All addresses fetched by the program (0000H to FFFFH) are led to it.
• ROM/EPROM that is external to the device. As seen in Fig. the PSEN signal is used to trigger output e external
ROM/EPROM.
• Port 0 is used as a multiplexed address/bus, as seen in Fig. In the initial T-cycle, it provides a lower order 8-bit
address, and later it is used as a data bus. The external latch and the ALE signal provided by the 8051 are used to
latch the 8-bit address.
• 1External Interrupt 0 is 0003H, Timer 0 is 000BH, External Interrupt 1 is 0013H, Timer 1 is 001BH, and so on.

• If an interrupt is to be used, the operation routine for it must be in the same place as the interrupt.

• If the interrupt isn’t used, the service location may be used as general-purpose program memory.
Instructions to Access External ROM / Program Memory

Mnemonic Operation

Copy the contents of the external ROM address formed by adding A


MOVC A, @ A+DPTR
and the DPTR, to A

This operation will do copy This operation contents of the external


MOVC A, @ A + PC
ROM address formed by adding A and the PC, to A.

External Memory Interfacing

• Up to 64 k-bytes of additional data memory can be addressed by the 8051. The external data memory is accessed
using the “MOVX” instruction.
• The 8051’s internal data memory is split into three sections: Lower 128 bytes, Upper 128 bytes, and SFRs.
While they are physically distinct bodies, the upper addresses and SFRs share the same block of address
space, 80H by FFH.
• The upper address space is only accessible via indirect addressing, and SFRs are only accessible via direct
addressing, as seen in Higher address space, on the other hand, can be reached using either direct or indirect
addressing.
Instructions to Access External Data Memory

Mnemonic Operation

MOVX A, @Rp In this operation, it will copy the contents of the external address in Rp to A.

MOVX A. @DPTR Copy the contents of the external address in DPTR to A.

MOVX @Rp. A Copy data from A to the external address in Rp

MOVX DPTR, A Copy data from A to the external address in DPTR.

Instructions to Access External Data Memory

• In the Case of accessing external memory, All external data moves with external RAM or ROM involve the A
register.
• While accessing external memory, R can address 256 bytes and DPTR can address 64 k-bytes
• MOV X instruction is used to access external RAM or 1/O addresses.

You might also like