Documente Academic
Documente Profesional
Documente Cultură
COLLECTOR
Electronics -- USB-FX2 Interface Board (USB-2.0)
This is a USB (universal serial bus) interface board
supporting USB-2.0 high speed mode (480Mbit/s).
Features:
It is angle through which motor shaft rotates in one step. step angle is
different for different motor . selection of motor according to step
angle depends on the application , simply if you require small
increments in rottion choose motor having smaller step angle.
Steps/second
INTERFACING TO 8051.
Driving current for each coil is then needed about 60mA at +5V
supply. A Darlington transistor array, ULN2003 is used to increase
driving capacity of the 2051 chip. Four 4.7k resistors help the 2051 to
provide more sourcing current from the +5V supply.
CODE EXAMPLE
Reset - RST
Crystal - XTAL[1,2]
I/O Port
– P0[7;0], P1[7:0], P2[7:0], P3
Reset Circuit
RESET is an active High input When RESET is set to High, 8051 goes
back to the power on state.
The 8051 is reset by holding the RST high for at least two machine
cycles and then returning it low.
Power-On Reset
Manual reset
Oscillator Circuit
The oscillator can also be a TTL clock source connected with a NOT
gate asshown
11,059,000 / 12 = 921,583
Power Supply
C1-1000 mf ,C2-100 mf
8051 is TTL logic device. TTL logic has two levels: Logic "High" (1) and
logic "Low" (0). The voltage and current involved for the two levels are
as follows:
P0 is open drain.
– Has to be pulled high by external 10K resistors.
– Not needed if P0 is used for address lines
Writing to a port pin loads data into a port latch that drives a FET
connected to the port pin.
P0: Note that the pull-up is absent on Port 0 except when functioning
as the external address/data bus. When a "0" is written to a bit in port
0, the pin is pulled low. But when a "1" is written to it, it is in high
impedance (disconnected) state. So when using port 0 for output, an
external pull-up resistor is needed, depending on the input
characteristics of the device driven by the port pin
You can used a port for output any time. But for input, the FET must
be off. Otherwise, you will be reading your own latch rather than the
signal coming from the outside. Therefore, a "1" should be written to
the pin if you want to use it as input, especially when you have used it
for output before. If you don't do this input high voltage will get
grounded through FET so you will read pin as low and not as high. An
external device cannot easily drive it high
so, you should not tide a port high directly without any resistor.
Otherwise, the FET would burn.
Be Careful :
MACHINE CONTROL:
Three IR sensors are placed in the front of the machine. So the inputs can be considered
as a three bit word with the following possibilities of output
0 0 1 (01h) the machine has encountered an obstacle in the left and hence has to move
right.
1 0 0(04h) the machine has encountered an obstacle in the right and hence has to move
left.
0 1 1(03h) the machine must move left twice and continue moving forward.
1 1 0(03h) the machine must move right twice and continue moving forward.
1 1 1(07h) the machine must move back and turn left or right
PROGRAM CODING FOR 8051:
mov b,#00;
mov a,#00;
initial:mov a,p1;
cmp a,#00;
jnz l1;
jmp drive;
l1: cmp a,#01;
jnz l2;
jmp back;
jmp right;
l2:cmp a,#04;
jnz l3;
jmp back;
jmp left;
l3:cmp a,#03;
jnz l4;
jmp back;
jmp left;
jmp left;
l4:cmp a,#06;
jnz l5;
jmp back;
jmp right;
jmp right;
l5:cmp a,#02;
jnz l6;
jmp arm;
l6:cmp a,#07;
jnz l7;
jmp back;
jmp right;
l7:jmp initial
hlt
drive:
mov ro,a;
mov a,#ffh ;Load step sequence
back:
mov ro,a;
mov a,#66h ;Load step sequence
right:
mov ro,a;
mov a,#66h ;Load step sequence
setb p3.2;
ret;
left:
mov ro,a;
mov a,#66h ;Load step sequence
setb p3.3;
ret;
arm:
mov ro,a;
mov a,#ffh ;Load step sequence
mov r1,#50
repeat:mov p2,a ;issue sequence to motor
rr a ;rotate step sequence right clockwise=Next sequence
acall DELAY ;~ 20 msec.
dec r1;
jnz repeat;
mov a,ro;
ret;
PROJECT ESTIMATION:
OBJECTS-COST:
8051 microcontroller
Uln2038
Lm7235
Battery
Stepper motor
Usb 8051 driver
Body plate
Bread board
Connecting wires