This action might not be possible to undo. Are you sure you want to continue?
pins PIN1-8: Port 1 each of these pins can be configured as input or output PIN 9: Rs logical one on this pin stop microcontroller’s operating and erases the contents of most registers. By applying the logical zero to the pin, the program starts execution from the beginning. In other words, a positive voltage pulse on this pin resets the microcontroller. PINS 10-17: Port3 similar to port 1, each of these pins can serve as universal input or output. Besides, all of them have alternative functions PIN 10: Rxd serial asynchronous communication input or serial synchronous communication input PIN 11: txd serial asynchronous communication output or serial synchronous communication output PIN 12: PIN13: PIN14: PIN15: PIN16: int0 interrupt 0 input int1 interrupt 1 input t0 counter 0 clock input t1 counter 1 clock input wr signal for writing to external (additional) ram
RD signal for reading from external RAM
Block Diagram of 8051
PIN 18, 19: X2, X1 internal oscillator input and output. A quartz crystal is connected to these pins to generate operating frequency PIN 20: PIN 21-28: Port 2 configured as inputs and outputs. In the case of external memory being used these offer the address A8-A15. PIN 29: Ground
PSEN if external ROM is used for storing program then it has logic 0 value every time the microcontroller reads from memory.
Pin diagram of 8051 PIN 30: ALE prior to each reading from external memory, the controller will set the low address on P0 and after that activates the output ALE. In the second part of the microcontroller machine cycles, a signal stops and P0 is used for data transmission. PIN 31: EA by applying logic zero to this pin ,P2 and P3 are used for data and address transmission with no regard to whether there is internal memory or not. That means even if program is there on the controller it will not be executed. Applying logic one to EA the controller will use both the memories. PIN 32: Port 0 is similar to port 2, if external memory is accessed.P0 provides the lower address byte (A0-A7).
Vcc Power supply +5v.
SPECIAL FUNCTION REGISTER: These registers are a kind of control table used for running and monitoring the microcontroller operation. There are only 21 registers of this type. Accumulator: A general purpose register for storing immediate values during operation. Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
B register: It is used during multiplication and division along with the A register. R Register (R0-R7): Common general purpose registers used during any operation of the microcontroller. PSW Registers: The Program Status Register contain several bits that reflect the current state of the CPU. CY AC F0 RS1 RS0 OV P
CY-carry AC-Auxillary carry RS1,RS0 –Register Bank Select OV –Over flag P-Parity.
They are divided into DPH (Data Pointer High) and DPL (Data Pointer Low). If the timer register contains a value of then accordingly its value is either used for counting or for timing. their main purpose is for counting occurrences of external events and measuring the time.It is 8-bit wide.DATA POINTER REGISTER (DPTR): These are 16-bits wide for external memory addressing. T0: when timer 0 is equal to 0 then both registers will include 0 value. TM1 0 0 1 1 TM0 0 1 0 1 Mode 0 1 2 3 description 13-bit timer 16-bit timer 8-bit reload auto Split mode Gate: starts the timer 1 using a signal provided to the pin INTO (P3. Stack Pointer(SP): It points to the RAM and permits the stack availability . TMOD Register: Gate1 C/T TM1 TM0 Gate0 C/T TM1 TM0 Writing into these will select the timer and their mode of operation. After reset it points to address of 7 of the memory. each 16-bit wide. Counter and Timers: The 8051 has 2 timer.2) 5 .
SM2 –For mode selection REN-receive enable TI-set during transmission RI-set during reception SM0 0 0 1 SM1 0 1 0 MODE 0 1 2 Description Baud Rate 8-bit shift 1/12 quartz register frequency 8-bit uart 9-bit uart From timer 1 1/32 quartz 6 . SBUF is an 8-bit register.C/T0 =1. timer operation else counter operation TCON REGISTER: TF1 TR1 TF0 TR0 IE1 IT1 IE0 IT0 TF1-automatically set when timer1 overflows TR1=1. SM0 SM1 SM2 REN TB8 RB8 TI RI SMO. All bits used for controlling the serial communication is done with the help of the SCON register.SM1. Serial data is sent by writing into SBUF register. timer1 on else timer off TF0-automatically set when timer0 overflows TR0=1. timer1 on else timer0 off UART: It’s a duplex port for serial communication which means it can receive and transmit data serially.
Keil µ Vision2 IDE: Keil tools can be used to generate embedded applications for all 8051 family.Here all internal registers are reset by the microcontroller Keil µ VISION2 SOFTWARE EXP.frequency 1 1 3 9-bit uart From timer 1 RESET: Reset occurs when RS=1. This software can be used for functions like • Compiling codes • Assembling the assembly source file • Linking and locating objects modules and libraries • Creating hex files • Debugging the target program It is a combined tool for project management source code editing and program debugging in single environment 7 .NO:2 DATE: AIM: To study about the Keil software and its features.
source –level debugger is ideally suited for fast. This id full ANSI implementation of C programming in addition to numerous features LIB51 Library Manager: Allows you to create object library from object files created by compiler and assembler. BL51 linker/locator combines the relocatable object modules LIB51 library manager combines the object modules. All code and data are reside at fixed memory location. C51 Compiler & A51 Assembler : Source files are created by the µ Vision2 IDE and are passed to the C51Compiler or A51 Assembler . µ Vision2 Debugger: The µVision2 symbolic.The compiler and assembler process source files and create relocatable object files. BL51 Linker/Locator: It creates an absolute object module using the object module extracted from libraries and those created by compiler and assembler. Libraries are specially formatted. The debugger includes a high-speed simulator that 8 . reliable program debugging. ordered program collections of object modules that may be the linker at later time. OH51 object Hex creates the Intel hex files FTX51 RTOS simplifies the design of complex time critical software project.C51 ANSI and A51 macro assembler creates the relocatable object modules from 8051 ASM code.
Provides several ways for you to test programs on real target hardware. 9 . It simplifies the system design. RTX51 RTOS: The RTX51 RTOS is multitasking kernel for the 8051 microcontroller family. PK51 Professional Development Kit: Includes everything the developer needs. The kit has everything you need to create an embedded application.let you simulate 8051 system including on-chip peripherals and external hardware. Task description tables and operating system consistency are automatically controlled by BL51. Monitor51: The monitor program resides in memory of your target and communicates with µVision2 debugger using the serial port of 8051 and COM port of your PC. programming and debugging of complex application where fast reaction to time critical events are essentials. A51 Assembler Kit: A51 assembler Kit includes an assembler and all the utilities you need to create embedded applications. It can be configured for all 8051 members CA51 Comiler Kit: It is the best choice for developers who need a C compiler but not a debugging system.
NO.3 DATE: AIM: To simulate the following program by writing AlP or C program. • Search the number X in the given set of numbers • Sort the numbers • To design a simple calculator COMPONENTS REQUIRED: PC installed with Keil software 10 .SIMULATION PROGRAM EXP.
1kΩ • Crystal Oscillator 11. • Resistors 8. • Switch & power supply. COMPONENTS REQUIRED: • Microcontroller IC P89C51RD2 • Max 232 IC & 9 –pin RS232 female connector.TOGGLING OF THE INPUT AND OUTPUT PORT PINS EX NO:4 DATE: AIM: To design a C51 Program for toggling input and output pins.0592 MHz. • Capacitor 10µf.1µf. 0. 33pf.2KΩ. 11 . • Bread board & connecting wires.
• Port 1 (P1. 12 . The software program has been written by using Keil microvision-2 software.• LED PROCEDURE: • • The hardware connections are done as per the circuit diagram. • Toggling has been observed.4) is connected to LED through 1kΩ resistor.
Basic circuitry using 8051 and its verification by toggling the LED 13 .
SEVEN SEGMENT DISPLAY 14 .
The +5V supply is connected to the common anode of the seven segment display. The program is downloaded to the microcontroller with the help of Flash magic and the output is displayed in the seven segment.5 DATE: AIM: To write a assembly language program for seven segment display. COMPONENTS REQUIRED: • 8051 microcontroller • RS232 • Seven segment display • Bread board • Regulated power supply • Connectors • Reset switch • Capacitor • Resistors • Crystal oscillator • Connecting wires DESCRIPTION: Connections are given as per the circuit diagram. 15 .EXP. The pins of the seven segment are connected to the ports of the 8051 Microcontroller.NO.
SEVEN DISPLAY: SEGMENT RESISTOR VALUE: 4.7 KILO Ω 16 .
0592 MHz.NO:6 DATE: AIM: To design a C51 program for LCD interface. • Max 232 IC & 9 –pin RS232 female connector. • Bread board & connecting wires.1µf.LCD INTERFACE EX. PROCEDURE: • The hardware connections are done as per the circuit diagram shown. 0. 33pf. • Switch & power supply. R/W. • Capacitor 10µf.7) is connected to lcd data pins and port 2(p2. • Resistors 1KΩ • 10KΩ potentiometer. E). 18 .4 to p2. COMPONENTS REQUIRED: • LCD (JMD 162A) • Microcontroller IC P89C51RD2. • The software program has been written by using Keil microvision-2.0 to p0. • Port 0(p0.6) is connected to control pins (RS. • Crystal Oscillator 11.
• The corresponding given data has been displayed in the lcd. 19 .
LCD DISPLAY 20 .
(4*4 matrics).0592 MHz. (8-pin female single row). • Capacitor 10µf. • Microcontroller Ic P89C51RD2.KEYPAD INTERFACE EX. 21 . 0. COMPONENTS REQUIRED: • Keypad. 33pf.2KΩ • Crystal Oscillator 11. • Resistors 8.NO:7 Date: AIM: To design a C51 program for (4*4) matrix keypad interface with IC P89C51RD2. • Max 232 Ic & 9 –pin RS232 female connector • Bread board & connecting wires. • Interface card.1µf. • Switch & power supply.
0 to p1.3) is connected to rows and port 2(p2. • To avoid the Key debouncing we have give the delay for the program For different key press. 22 .PROCEDURE: • The hardware connections are done as per the circuit diagram shown in figure. • The software program has been written by using Keil microvision-2 software. • Port 1(p1. different ASCII values are determined.0 to p2.3) is connected to columns.
8 DATE: AIM: To write a Program to interface a stepper motor with 8051µc using keil software.NO.KEYPAD INTERFACE PROGRAM TO INTERFACE A STEPPER MOTOR EXP. ULN2003 is used to convert digital data to analog data to control stepper motor. 23 . Separate power supply is needed for both microcontroller & stepper motor.7k • Max232 IC • Power Supply (0-5v) DESCRIPTION: Here we interface stepper motor with 8051 microcontroller using ULN2003. COMPONENTS REQUIRED: • 8051 µC • Stepper motor • Resistor 4.
NO:9 DATE: AIM: To write a C program for serial communication using 8051 microcontroller COMPONENTS REQUIRED: • 8051 µC • Max232 IC • Power Supply (0-5v) • Bread Board and Connecting wires 25 .STEPPER MOTOR INTERFACE SERIAL COMMUNICATION EXP.
DIAGRAM Serial Communication 26 .
No:10 Date : AIM: To design a C51 program to interface the SRAM.SRAM INTERFACE Ex. COMPONENTS REQUIRED: • MicroContoller-P89C51RD2xx • 32 Kb RAMHY62256 (15-address lines) • Latch74LS373 • Bread Board and Connecting Wires • RS232 PROCEDURE: 27 .
0 to p2.• The hardware connections are done as per the circuit The software program has been written by using Keil Port0 (p0. pins of SRAM.7) is connected to SRAM through the latch Port2 (p2. 28 . • The corresponding outputs have been observed.7) is connected to the remaining 7 Address diagram shown. • • • microvision-3 software. 74Ls373.1 to po.
SRAM INTERFACING 29 .
11 DATE: AIM: To design a program for ADC 0804 using 8051 Microcontroller COMPONENTS REQUIRED: • MicroController-P89C51RD2xx • ADC 0804 • Bread Board and Connecting Wires • RS232 DIAGRAM: 30 .NO.ANALOG-DIGITAL CONVERSION USING 8051 EXP.
12 DATE: AIM: To establish parallel connection between two DTE’s. EXPERIMENTAL SETUP: • Connect the power supply and switch on • Connect the parallel cable to both parallel ports on DTE’s and lock the connectors PROCEDURE: 31 .NO.ADC 0804 PPI INTERFACE TO MCS51 FOR PARALLEL COMMUNICATION EXP.
2. • After successfully downloading the code. • Transmitting Node-1 accepts the data from the keyboard and transmits to the receiver through 8255 port configured as output.the byte is displayed on LCD • The program gets executed in an infinite loop for transmission and reception till controller is reset OBSERVATIONS: We learn from this 1. • On the reception of a byte on the receiver node . 32 . • Download the rx_pp.• Download the tx_pp. transmission of the data through parallel port. Acquiring the data from keyboard.hex file to Node-2 NVRAM as explained in configuration of hardware section. execute the code in both the nodes as explained in configuration of hardware section.hex file to Node-1 NVRAM as explained in configuration of hardware section. The initialization of 8255 PPI for input and output modes.
RS 485 EXPERIMENTS EXP. EXPERIMENTAL SETUP: • Make the connection as shown in figure 33 . set up two 8051 controller boards as nodes of RS-485 network. Transmit the data from one board and receive the same on the other row boards.NO:13 DATE: AIM: To understand how to use RS485 physical layer.
• Insert the EEPROM labelled as “BOOT LOADER” to 8051 main controller cards • Connect RS485 cable to RS485 ports of microcontroller boards.hex” to node2 and node3. • Make the jumper connections for JP6 as shown below for RS232 communication to download the hex file to NVRAM • Connect RS232 download the cable between the main controller RS232 port and PC comport for all three nodes • Switch ON the power supply to the main controller card • Now download “485tx. remove the jumpers and now execute the code on all three nodes as explained • After the execution of the code place jumpers forRS485 communication • Now key in data on transmitter node-1 and this data is transmitted in RS485 mode • On the receiver Node-2 and Node-3 the received data is displayed 34 .hex” to node1 • Now download “485rx. PROCEDURE: • After successfully downloading the code.
35 . then collision occurs thereby receiving junk data.RS485 COMMUNICATION OBSERVATION: The RS485 is physical layer implementation with a common bus running between all nodes .if more than one node transmits at the same time.
CAN AUTOMATION Exp. No:14 DATE AIM: To Design of SJA1000 Standalone interface with micro controller for CAN interface. 36 .
software.COMPONENTS REQUIRED: • Microcontroller -P80C31RD2xx • SJA1000 • PCA82C250\251 • Bread Board and Connecting Wires • CAN bus PROCEDURE: • The hardware connections are done as per the circuit diagram. • The software program has been written by using Keil microvision-3 • Data has been transmitted between the two controller through the CAN bus. • The Received data has been observed in the microcontroller 37 .
as allowed for the PCA82C200. The default state is divide by 12 for Motorola mode and divide by 2 for Intel mode. Therefore one of the reserved bits within the PCA82C200 is used. Writing a value between 0 and 7. 38 . will enter the Basic CAN mode.REGISTERS IN CAN CONTROLLER: CONTROL REGISTER (CR) The contents of the control register are used to change the behaviour of the CAN controller. Bits may be set or reset by the attached microcontroller which uses the control register as a read/write memory. CLOCK DIVIDER REGISTER (CDR) The clock divider register is used to select the CAN mode of operation (Basic CAN/ Peli-CAN).
all bits are reset what results in a floating level at INT. W hen one or more bits of this register are set the INT pin is activated (LOW). MODE REGISTER (MOD) The contents of the mode register are used to change the behaviour of the CAN controller.INTERRUPT REGISTER (IR) The interrupt register allows the identification of an interrupt source. ACCEPTANCE CODE REGISTER (ACR) This register can be accessed (read/write). all bits will return a logic 0 when being read. 39 .3) must be equal to those bit positions which are marked relevant by the acceptance mask bits (AM.0) and the eight most significant bits of the message’s identifier (ID. The acceptance code bits (AC.7 to AM. This register is write only. Bits may be set or reset by the CPU which uses the control register as a read/write memory.0). STATUS REGISTER (SR) The content of the status register reflects the status of the CAN controller. After this register is read by the microcontroller. COMMAND REGISTER (CMR) A command bit initiates an action within the transfer layer of the CAN controller. The status register appears to the CPU as a read only memory.10 to ID. The interrupt register appears to the microcontroller as a read only memory. Between two commands at least one internal clock cycle is needed in order to proceed. Reserved bits are read as logic 0. if the reset request bit is set HIGH (present).7 to AC. The internal clock is half of the external oscillator frequency.
40 . ERROR CODE CAPTURE REGISTER (ECC) This register contains information about the type and location of errors on the bus. ARBITRATION LOST CAPTURE REGISTER (ALC) This register contains information about the bit position of losing arbitration. Reserved bits are read as logic 0. The error code capture register appears to the CPU as a read only memory. The interrupt enable register appears to the CPU as a read/write memory. The arbitration lost capture register appears to the CPU as a read only memory.INTERRUPT ENABLE REGISTER (IER) The register allows us to enable different types of interrupt sources which are indicated to the CPU.
This action might not be possible to undo. Are you sure you want to continue?
We've moved you to where you read on your other device.
Get the full title to continue reading from where you left off, or restart the preview.