Sie sind auf Seite 1von 5

13.

STEPPER MOTOR INTERFACING WITH 8051 AIM: To interface a stepper motor with 8051 microcontroller and operate it.

THEORY: A motor in which the rotor is able to assume only discrete stationary angular position is a stepper motor. The rotary motion occurs in a step-wise manner from one equilibrium position to the next. Stepper Motors are used very wisely in position control systems like printers, disk drives, process control machine tools, etc. The basic two-phase stepper motor consists of two pairs of stator poles. Each of the four poles has its own winding. The excitation of any one winding generates a North Pole. A South Pole gets induced at the diametrically opposite side. The rotor magnetic system has two end faces. It is a permanent magnet with one face as South Pole and the other as North Pole. The Stepper Motor windings A1, A2, B1, B2 are cyclically excited with a DC current to run the motor in clockwise direction. By reversing the phase sequence as A1, B2, A2, B1, anticlockwise stepping can be obtained. 2-PHASE SWITCHING SCHEME: In this scheme, any two adjacent stator windings are energized. The switching scheme is shown in the table given below. This scheme produces more torque. ANTICLOCKWISE STE A A2 B B2 P 1 1 1 1 0 0 1 2 0 1 0 1 3 0 1 1 0 4 1 0 1 0 CLOCKWISE DATA STE A A P 1 2 9h 1 1 0 5h 2 0 1 6h 3 0 1 Ah 4 1 0

B 1 1 1 0 0

B2 0 0 1 1

DATA Ah 6h 5h 9h

ADDRESS DECODING LOGIC: The 74138 chip is used for generating the address decoding logic to generate the device select pulses, CS1 & CS2 for selecting the IC 74175.The 74175 latches the data bus to the stepper motor driving circuitry.

Stepper Motor requires logic signals of relatively high power. Therefore, the interface circuitry that generates the driving pulses use silicon darlington pair transistors. The inputs for the interface circuit are TTL pulses generated under software control using the Microcontroller Kit. The TTL levels of pulse sequence from the data bus is translated to high voltage output pulses using a buffer 7407 with open collector. ALGORITHM: 1.store the look up table address in dptr. 2.move the count value to one of the reg. 3.load the control word for motor rotation in accumulator. 4.push the address in dptr into the stack. 5.load ffco into dptr. 6. call the delay program. 7.send the control word for motor rotation to the external device. 8. pop up the values in stack and inc it. 9. decrement the count in R0.if zero go to next step else proceed to step 3. 10.perform step 1 to 9 repeatedly. PROGGRAM. DATA. RESULT: Thus speed and direction of motor were controlled using 8051 trainer kit.

INTERFACING DAC WITH 8051 AIM: to interface the adc with 8051 parallel port to demonstrate the generation of square, sawtooth and triangular wave. APP REQ: 8051 trainer kit DAC interface board. THEORY: -------ALGORITHM: SQUARE WAVE GENERATION: 1. Move the port address of DAC to dptr.

2. 3. 4. 5. 6.

Load the initial value to dptr(00) to acc and move it to DAC. Call the delay program. Load the final value to dptr(ff) to acc and move it to DAC. Call the delay program. Repeat steps 2 to 5 . SAWTOOTH TOOTH WAVE GENERATION: 1. Move the port address of DAC to dptr. 2.Load the initial value to dptr(00) to acc and move it to DAC. 3.Move the acc content to DAC. 4.Inc the acc content by 1 5.Repeat steps 3 and 4. TRIANGULAR WAVE GENERATION: 1. Move the port address of DAC to dptr. 2.Load the initial value to dptr(00) to acc and move it to DAC. 3.Move the acc content to DAC. 4.Inc the acc content by 1 5.if acc content is 0. proceed to next step.else go to step 3. 6.Load the final value to dptr(ff) to acc 7.Move the acc content to DAC. 8.Dec the acc content by 1 9.if acc content is 0 go to step 2..else go to step 7. PROGRAM: RESULT: Thus the square . sawtooth and triangular wave were generated by interfacing DAC with 8051 trainer kit.

INTERFACING OF LCD DISPLAY To interface the LCD display with 89C51 microcontroller and to verify data on LCD display. Objectives: Display Alphabet character in the LCD using micro controller. Apparatus Required: No Name Quantity 1 Microcontroller kit 1

2 LCD display 1 Procedure: 1. Connect the LCD display interface board as required. 2. Enter the program and execute it. 3. The output will be displayed on two LCD display. Program: Result: Thus an assembly language program was written to interface LCD display with 89 C 51 micro controller and to verify data on LCD display and it was executed.

SERIAL COMMUNICATION Aim: To transfer the data serially between two microcontroller kit using RS232C. Objective: To Transfer data from one microcontroller kit to another microcontroller kit serially. Apparatus Required: No Name Quantity 1 Microcontroller kit 2 2 RS232C Interface wire 1 Procedure: 1. Connect the two microcontroller kit using RS232 cable 2. Enter the transmitter program in 1ST microcontroller kit & receiver program in 2nd microcontroller kit. 3. First run the receiver program in kit2 and then run the transmitter program in kit1. 4. After executing the transmitter program, reset the kit and go to location 8400h 5. The transferred datas yes (ASCII) value are stored from 8400h onwards in the kit2. Programming the 8051 to transfer data serially

In programming the 8051 to transfer character bytes serially, the following steps must be taken. 1. The TMOD register is loaded with the value 20H, indicating the use of timer I in mode 2 (8-bit auto-reload) to set the baud rate. 2. The THI is loaded with one of the values in Table to set the baud rate for serial data transfer 3. The SCON register is loaded with the value 50 H, indicating serial mode 1, where an 8bit data is framed with start and stop bits. 4. TRI is set to l to start timer l. 5. TI is cleared by the CLR TI instruction. 6. The character byte to be transferred serially is written into the SBUF register. 7. The TI flag bit is monitored with the use of the instruction JNB TI, xx to see if the character has been transferred completely. 7. Tc transfer the next character, go to Step 5. Programming the 8051 to receive date serially In the programming of the 8051 to received character bytes serially, the following steps must be taken. 1. The TMOD register is loaded with the value 201-1, indicating the use of timer I in mode 2 (8b1t auto-reload) to set the baud rate. 2. THI is loaded with one of the values in Table to set the baud rate 3. The SCON register is loaded with the value 5011, indicating serial mode I, where 8-bit data is & framed with start and stop bits. 4. TR1 Is set to I to start timer 1. 5. RI is cleared with the CLR RI Instruction. 6. The RI flag bit is monitored with the use of the Instruction JNC RI, XX to see if an entire character has been received yet. 7. When RI is raised, SBUF has the byte. Its contents are moved into a safe place. 8. To receive the next character, go to Step 5. Result:

Das könnte Ihnen auch gefallen