8051 Microcontroller
[
attachment=34014]
Microprocessor
Microprocessor, by-itself, completely useless .
It does not have RAM,ROM and no I/O ports on the chip itself.
Must have external peripherals to Interact with outside world.
Makes system bulkier and expensive.
A Microcontroller has a CPU along with fixed amount of RAM, ROM ,and I/O ports and timer on a single chip.
Choosing a Microcontroller
There are four major 8 bit microcontrollers.
Freescale-68111
Intel's -8051
PIC 16x
Each one has its own instruction set and register set so not compatible with each other.
Criteria to select a microcontroller
Meeting the computing needs of the task
Speed, Packaging, Power consumption,
Amount of RAM,ROM, I/O pins
Cost per unit
Availability of development tools
Assembler , Debugger , C-compiler,
Availability of reliable sources
Features Of Microcontroller
8051 is an 40 pin IC.
8051 is an 8-bit Microcontroller.
128 byes of RAM
4KBytes of inbuilt ROM.
It have one serial port i.e. UART
Four parallel ports i.e. P0,P1,P2&P3.
It have two 16-bit Timers i.e. Timer0 ,Timer1.
It have five sources and six Interrupts.
It have four Register Banks (Bank0-3) .
16-bit Program Counter.
DPTR(16-bit).
8-bit stack pointer (sp).
External code and data memory up to 64KB.
8-bit PSW (program status word).
On chip Oscillator.
General Purpose RAM
Byte location from 30h to 7Fh (80 bytes) are reserved for general purpose use
Location 20h to 2Fh can also be us be used for general purpose but care must be taken when using these locations for general purpose.
Can be accessed using direct and Indirect addressing mode.
Register Banks
There are four banks (0-3) from 00h to 1fh.
Each bank has eight registers R0 to R7.
At a time only one bank is used.
By default we can access Bank 0.
Idle Mode
In the Idle mode, the internal clock signal is gated off to the CPU, but not to the Interrupt, Timer, and Serial Port functions.
Stack Pointer, Program Counter ,PSW, Accumulator, and all other registers maintain their data during Idle.
The port pins hold the logical status they had at the time Idle was activated.
ALE and PSEN hold at logic high levels.
There are two ways to terminate the Idle.
Activation of any enabled interrupt will cause PCON.O to be cleared by hardware terminated the Idle mode.
After Servicing the interrupt and following RETI the next instruction to be executed will be the one following the instruction that put the device into Idle.
The other way of terminating the Idle mode is with hardware reset.