7161361 8051 Micro Controller

download 7161361 8051 Micro Controller

of 9

Transcript of 7161361 8051 Micro Controller

  • 7/27/2019 7161361 8051 Micro Controller

    1/9

    8051 Microcontroller

    The 8051 Microcontroller

    Architecture

    8051c is a 8bit microcontroller introduced by Intel Corporation in 1981 which comes in 40 pindual inline package (DIP).

    It has 4KB of inbuilt ROM i.e onchip program space.

    It has 128bytes of inbuilt RAM space and if required external memory of 64KB can be interfacedto the microcontroller.

    There are 4 parallel 8bit ports namely port 0, port 1, port 2 and port 3 which are addressable aswell as programmable.

    It has an onchip crystal oscillator with crystal frequency 11.0592MHz (~12MHz).

    It has full duplex serial I/O port having two pins namely TxD, RxD.

    It has two 16bit timers namely Timer 0 and Timer 1 which can be used either as timer for internaloperation or as counter for external operation.

    It has five interrupt sources. All of them are maskable as well as vector interrupts. They areExternal Interrupt 0, Timer Interrupt 0, External Interrupt 1, Timer Interrupt 1, Serial Port Interrupt.

    The programming mode of this microcontroller consists of general purpose registers (GPRs),Special Purpose Registers (SPRs) and Special Function Registers (SFRs).

    The instruction set of 8051 c consists of more number of bit manipulations or boolean variablemanipulation group of instructions. The instructions are very much useful to manipulate SFR bitsand also port pins.

    1

  • 7/27/2019 7161361 8051 Micro Controller

    2/9

    8051 Microcontroller

    Register and Internal RAM organization

    8051 c provides two 8bit general purpose registers A (Accumulatr) and B.

    It provides 4 special purpose registers 16bit Program Counter (PC), 8bit Stack Pointer (SP),

    16bit Data Pointer and 8bit Program Status Word (PSW).

    It also provides few Special Function Registers. They are TMOD, TCON, IE, IP, SBUF, SCON,

    PCON.

    The 128bytes onchip RAM of 8051 c is divided into three portions as given below.

    o 00H 1FH : These 32bytes are arranged as 4 register banks namely Bank 0, Bank 1,Bank 2, Bank 3 where each bank consists of 8 registers namely R0 through R7.

    2

  • 7/27/2019 7161361 8051 Micro Controller

    3/9

    8051 Microcontroller

    o 20H 2FH : These 16bytes (128bits) are made available as bit-addressible.bytes.

    o 30H 7FH : These 80 bytes are available as scratch-pad RAM bytes.

    Pin diagram

    Power Supply pins8051 c works with +5V DC source applied to Vcc and 0V to Gnd input pin. It has an onchip

    crystal clock generator. As such it must be supported externally by connecting a crystal across crystalinput XTAL1, XTAL2. It has active hign reset input pin. As such the controller is said to be reset uponapplication of active hign pulse.

    I/O port pinsA total number of 32 I/O pins are provided as port pins divided into 4 ports port 0,

    port 1, port 2 and port 3. All ports are both byte and bit addressable. All ports are programmable. Allthe ports act as simple input/output ports. All the ports except port 1 offer alternate functions. They areas follows.

    Port 0 and Port 2: If input pin is grounded then port 0 acts as lower order 8bit address databus where as port 2 acts as higher order 8 bit address bus.

    Port 3: Each and every pin in this port offer some separate functionality irrespective of level at

    input pin.

    Pin Special Function

    P3.0 RxD (Serial Input pin)

    P3.1 TxD (Serial Output pin)

    P3.2 (Interrupt 0 input pin)

    P3.3 (Interrupt 1 input pin)

    P3.4 (Timer 0 input if timer is counter)

    P3.5 (Timer 1 input if timer is counter)

    P3.6 (RAM write control signal output)

    3

  • 7/27/2019 7161361 8051 Micro Controller

    4/9

    8051 Microcontroller

    P3.7 (RAM read control signal output)

    4

  • 7/27/2019 7161361 8051 Micro Controller

    5/9

    8051 Microcontroller

    External Access Control pins

    (External Access): If is connected to +5V then the microcontroller fetches codefrom internal or inbuilt program memory. If it is cnneected to 0V then the microcontroller fetches codefrom external program memory.

    (Address Latch Enable): It is an active high output pin. It is used fordemultiplexing the address and data by connecting to the G pin of the 74LS373 chip.

    (Program Store Enable) This is an output pin. For opcode fetch operation,microcontroller asserts output pin as low which can be used for selecting the external programmemory chip. This can also be used as ROM read control signal.

    5

  • 7/27/2019 7161361 8051 Micro Controller

    6/9

    8051 Microcontroller

    Instruction Set

    6

  • 7/27/2019 7161361 8051 Micro Controller

    7/9

    8051 Microcontroller

    7

  • 7/27/2019 7161361 8051 Micro Controller

    8/9

    8051 Microcontroller

    8

  • 7/27/2019 7161361 8051 Micro Controller

    9/9

    8051 Microcontroller

    9