Sei sulla pagina 1di 19

EXPERIMENT NO.

AIM: To Study about the software and development board of 8051 microcontroller with
introduction of Embedded System. SOFTWARE USED: KEIL VISION.

HARDWARE: PC, Development Board, Microcontroller IC and Data Cables. THEORY:


INTRODUCTION OF EMBEDDED SYSTEM
Embedded systems are computers which are part of special-purpose devices. Due to the limited duties this systems can be highly optimized to the particular needs. Traditionally most of these systems are used for control and process measurement, as a side effect of higher integration of integrated circuits more complex applications can be solved by embedded systems. To be able to solve these problems embedded systems are commonly equipped with various kinds of peripherals. Nowadays embedded systems can be found in devices from digital watches to traffic-control systems. The broad range of applications with totally different requirements leads to various implementation approaches. The range of hardware used in embedded systems reaches from FPGAs to full blown desktop CPUs which are accompanied by special purpose ICs such as DSPs. On the software side, depending on the needs, everything, from logic fully implemented in hardware, to systems with own operating system and different applications running on it, can be found.

TYPES OF MICROCONTROLLERS
Microcontrollers can be classified on the basis of internal bus width, architecture, memory and instruction set.

The 8-bit microcontroller When the ALU performs arithmetic and logical operations on a byte (8-bits) at an instruction, the microcontroller is an 8-bit microcontroller. The internal bus width of 8-bit microcontroller is of 8-bit. Examples of 8-bit microcontrollers are Intel 8051 family and Motorola MC68HC11 family. The 16-bit microcontroller When the ALU performs arithmetic and logical operations on a word (16-bits) at an instruction, the microcontroller is a 16-bit microcontroller. The internal bus width of 16-bit microcontroller is of 16-bit. Examples of 16-bit microcontrollers are Intel 8096 family and Motorola MC68HC12
Ashutosh 1 2363014

and MC68332 families. The performance and computing capability of 16 bit microcontrollers are enhanced with greater precision as compared to the 8-bit microcontrollers. The 32-bit microcontroller When the ALU performs arithmetic and logical operations on a double word (32-bits) at an instruction, the microcontroller is a 32-bit microcontroller. The internal bus width of 32-bit microcontroller is of 32-bit. Examples of 32-bit microcontrollers are Intel 80960 family and Motorola M683xx and Intel/Atmel 251 family. The performance and computing capability of 32 bit microcontrollers are enhanced with greater precision as compared to the 16-bit microcontrollers. Embedded microcontroller When an embedded system has a microcontroller unit that has all the functional blocks (including program as well as data memory) available on a chip is called an embedded microcontroller. For example, 8051 having Program & Data Memory, I/O Ports, Serial Communication, Counters and Timers and Interrupt Control logic on the chip is an embedded microcontroller. External memory microcontroller When an embedded system has a microcontroller unit that has not all the functional blocks available on a chip is called an external memory microcontroller. In external memory microcontroller, all or part of the memory units are externally interfaced using an interfacing circuit called the glue circuit. For example, 8031 has no program memory on the chip is an external memory microcontroller.

BLOCK DIAGRAM OF 8051 IC

Ashutosh

2363014

MICROCONTROLLER ARCHITECTURE
There are mainly two categories of processors, namely, Von-Neumann (or Princeton) architecture and Harvard Architecture. These two architecture differ in the way data and programs are stored and accessed. Von-Neumann architecture Microcontrollers based on the Von-Neumann architecture have a single _data_ bus that is used to fetch both instructions and data. Program instructions and data are stored in a common main memory. When such a controller addresses main memory, it first fetches an instruction, and then it fetches the data to support the instruction. The two separate fetches slows up the controllers operation. The Von-Neumann architectures main advantage is that it simplifies the microcontroller design because only one memory is accessed. In microcontrollers, the contents of RAM can be used for data storage and program instruction storage. For example, the Motorola 68HC11 microcontroller Von- Neumann architecture. Example: An Instruction Read a byte from memory and store it in the accumulator as follows: Cycle 1:- Read instruction Cycle 2 - Read data out of RAM and put into Accumulator

Harvard Architecture Microcontrollers based on the Harvard Architecture have separate data bus and an instruction bus. This allows execution to occur in parallel. As an instruction is being pre-fetched, the current instruction is executing on the data bus. Once the current instruction is complete, the next instruction is ready to go. This pre-fetch theoretically allows for much faster execution than VonNeumann architecture, on the expense of complexity. The Harvard Architecture executes instructions in fewer instruction cycles than the Von-Neumann architecture. For example, the Intel MCS-51 family of microcontrollers and PIC microcontrollers uses Harvard Architecture. The same instruction (as shown under Von-Newman architecture) would be executed as follows: Cycle 1: - Complete previous instruction - Read the Move Data to Accumulator instruction Cycle 2: - Execute Move Data to Accumulator instruction
Ashutosh 3 2363014

- Read next instruction Hence, each instruction is effectively executed in one instruction cycle.

PIN DIAGRAM OF 8051 MICROCONTROLLER

Ashutosh

2363014

PIN DESCRIPTION OF 8051 MICROCONTROLLER


ALE/PROG: Address Latch Enable output pulse for latching the low byte of the address during accesses to external memory. ALE is emitted at a constant rate of 1/6 of the oscillator frequency, for external timing or clocking purposes, even when there are no accesses to external memory. (However, one ALE pulse is skipped during each access to external Data Memory.) This pin is also the program pulse input (PROG) during EPROM programming. PSEN: Program Store Enable is the read strobe to external Program Memory. When the device is executing out of external Program Memory, PSEN is activated twice each machine cycle (except that two PSEN activations are skipped during accesses to external Data Memory). PSEN is not activated when the device is executing out of internal Program Memory. EA/VPP: When EA is held high the CPU executes out of internal Program Memory (unless the Program Counter exceeds 0FFFH in the 80C51). Holding EA low forces the CPU to execute out of external memory regardless of the Program Counter value. In the 80C31, EA must be externally wired low. In the EPROM devices, this pin also receives the programming supply voltage (VPP) during EPROM programming. XTAL1: Input to the inverting oscillator amplifier. XTAL2: Output from the inverting oscillator amplifier. Port 0: Port 0 is an 8-bit open drain bidirectional port. As an open drain output port, it can sink eight LS TTL loads. Port 0 pins that have 1s written to them float, and in that state will function as high impedance inputs. Port 0 is also the multiplexed low-order address and data bus during accesses to external memory. In this application it uses strong internal pullups when emitting 1s. Port 0 emits code bytes during program verification. In this application, external pullups are required. Port 1: Port 1 is an 8-bit bidirectional I/O port with internal pullups. Port 1 pins that have 1s written to them are pulled high by the internal pullups, and in that state can be used as inputs. As inputs, port 1 pins that are externally being pulled low will source current because of the internal pullups. Port 2: Port 2 is an 8-bit bidirectional I/O port with internal pullups. Port 2 emits the high-order address byte during accesses to external memory that use 16-bit addresses. In this application, it uses the strong internal pullups when emitting 1s. Port 3: Port 3 is an 8-bit bidirectional I/O port with internal pullups. It also serves the functions of various special features of the 80C51 Family as follows: Port Pin Alternate Function P3.0 RxD (serial input port) P3.1 TxD (serial output port) P3.2 INT0 (external interrupt 0) P3.3 INT1 (external interrupt 1) P3.4 T0 (timer 0 external input) P3.5 T1 (timer 1 external input)
Ashutosh 5 2363014

P3.6 WR (external data memory write strobe) P3.7 RD (external data memory read strobe) VCC: Supply voltage VSS: Circuit ground potential

DEVELOPMENT BOARD OF 8051


Introduction With this board we can develop and prototype with any of 8051 40 pin microcontrollers. The RS232 driver on board allows easy connection with PC or other embedded hardware. The board have user buttons and status LEDs. The bridge rectifier allows this board to be powered with both AC & DC power supply adapters. Main Features RS232 Tx, Rx interface with MAX232 IC on socket DIL40 ZIF Socket microcontroller socket To reduce Microcontroller Damages Reset button. Power plug-in jack. GND bus. Vcc bus. Extension slot on every C pin.

FRONT VIEW OF DEVELOPMENT BOARD OF 8051

Ashutosh

2363014

APPLICATIONS OF MICROCONTROLLERS
Microcontrollers have innumerable applications. Some applications of their simple applications are in 1. biomedical instruments like an ECG LCD display cum recorder, patient monitor system. 2. communication systems like numeric pagers, cellular phones, cable TV terminals and so on. 3. peripheral controllers of a computer such as the keyboard controller, printer controller, LAN controller. 4. a CNC machine controller. 5. electronic data acquisition and supervisory control system etc.

RESULT
Software and Development Board of 8051 C have been studied.

Ashutosh

2363014

EXPERIMENT NO. 2
AIM: Write an assembly language program to add, subtract, multiply and divide two 8 bit
numbers using 8051 microcontroller. SOFTWARE USED: KEIL VISION.

HARDWARE: PC, Development Board, Microcontroller IC and Data Cables. PROGRAM

1. Addition: ORG 000H MOV A, #08H MOV R1, #04H ADD A, R1 MOV P0, A END Output:

Ashutosh

2363014

2. Subtraction: ORG 000H MOV A, #08H MOV R1, #04H SUBB A, R1 MOV P0, A END Output:

Ashutosh

2363014

3. Multiplication: ORG 000H MOV A, #04H MOV B, #02H MUL AB MOV P0, A END Output:

Ashutosh

10

2363014

4. Division: ORG 000H MOV A,#08H MOV B,#04H DIV AB MOV P0,A END Output:
Ashutosh 11 2363014

CONCLUSION
The study and verification of addition, subtraction, multiplication and division parameters of 8051 and development board have been done in lab.

EXPERIMENT NO. 3

AIM: Write an assembly language program to toggle the LED on Port 1 using 8051
microcontroller.

SOFTWARE USED: KEIL VISION. HARDWARE: PC, Development Board, Microcontroller IC and Data Cables.
Ashutosh 12 2363014

PROGRAM
ORG 000H START:MOV P1, #00H ACALL DELAY MOV P1, #0FFH ACALL DELAY SJMP START DELAY:MOV R3, #55H HERE:DJNZ R3, HERE RET END

OUTPUT

Ashutosh

13

2363014

CONCLUSION
The study and verification of toggle parameters of 8051 and development board have been done in lab.

Ashutosh

14

2363014

EXPERIMENT NO. 4
AIM: Write an assembly language program to generate 10kHz square wave using 8051
microcontroller.

SOFTWARE USED: KEIL VISION. HARDWARE: PC, Development Board, Microcontroller IC and Data Cables. PROGRAM
ORG 000H AGAIN:MOV TMOD, #01H MOV TL0, #0D2H MOV TH0, #0FFH SETB TR0 BACK:JNB TF0, BACK CLR TR0 CPL P1.0 CLR TF0 SJMP AGAIN END

OUTPUT

Ashutosh

15

2363014

CONCLUSION
The study and verification of timers of 8051 and development board have been done in lab.

Ashutosh

16

2363014

EXPERIMENT NO. 5
AIM: Write an assembly language program to generate 10kHz square wave using interrupts in
8051 microcontroller.

SOFTWARE USED: KEIL VISION. HARDWARE: PC, Development Board, Microcontroller IC and Data Cables. PROGRAM
ORG 000H LJMP MAIN ORG 000BH CPL P2.1 RETI ORG 0030H MAIN:MOV TMOD, #01H MOV TL0, #0D2H MOV TH0, #0FFH MOV IE, #82H SETB TR0 HERE:MOV A, P0 MOV P1, A SJMP HERE END

OUTPUT

Ashutosh

17

2363014

CONCLUSION
The study and verification of interrupt parameters of 8051 and development board have been done in lab.

Ashutosh

18

2363014

EXPERIMENT NO. 6
AIM: Write an assembly language program to find sum of first ten numbers from 1 to 10 using
8051 microcontroller. SOFTWARE USED: KEIL VISION.

HARDWARE: PC, Development Board, Microcontroller IC and Data Cables. PROGRAM


ORG 000H MOV A, #0 MOV R2, #10 MOV R0, #0 AGAIN:INC R0 ADD A, R0 DJNZ R2, AGAIN MOV P0, A END

OUTPUT

Ashutosh

19

2363014

Potrebbero piacerti anche