Motion Tracking 
Author: Jeroen Vreeken
  Tracking 
A while ago I and several others made a serial port controlled stepper motor system. I also added the capability to motion to use this system to track
movement. The system is based on a 8051 derivative from atmel the 
AT89C2051. The other major components are a MAX232 serial driver and a driver IC for driving the coils of the motor.
Motion will work without modifications with any system that uses the same 
Motion Tracker API. You can also use your own system but you will have to add it to track.c
  Hardware 
Controller and RS232 interface 
Driver using the L298 
Driver using 2n6659 
Pin numbers
	
		
			|  Name  | 
			 89c2051  | 
			 'standard' 8051  | 
		
	
	
		
			|  Vcc  | 
			 20  | 
			 40  | 
		
		
			|  Gnd  | 
			 10  | 
			 20  | 
		
		
			|  RST  | 
			 1  | 
			 9  | 
		
		
			|  X1  | 
			 4  | 
			 19  | 
		
		
			|  X2  | 
			 5  | 
			 18  | 
		
		
			|  RxD  | 
			 2  | 
			 10  | 
		
		
			|  TxD  | 
			 3  | 
			 11  | 
		
		
			|  P1.0  | 
			 12  | 
			 1  | 
		
		
			|  P1.1  | 
			 13  | 
			 2  | 
		
		
			|  P1.2  | 
			 14  | 
			 3  | 
		
		
			|  P1.3  | 
			 15  | 
			 4  | 
		
		
			|  P1.4  | 
			 16  | 
			 5  | 
		
		
			|  P1.5  | 
			 17  | 
			 6  | 
		
		
			|  P1.6  | 
			 18  | 
			 7  | 
		
		
			|  P1.7  | 
			 19  | 
			 8  | 
		
	
  Software 
The software was written in C for the sdcc compiler. It is covered under the 
GNU General Public License and you are encouraged to use it in your own projects. 
 
The software will probably work with any 8051 derivative.
It asumes the stepper motor has four leads connected via a driver on P1.0 to P1.3. The left and right safety switches (in our case reedcontacts) are connected to P1.4 and P1.5.
In our case the driver IC had an Output_enable pin which was connected to P1.6, however this signal was first inverted with a transistor. The reason for this is that on power-up P1.6 is on by default. This pin is used to power down the motor completly when not in use.
The following images are of our system in action:
  
-- 
KennethLavrsen - 10 Oct 2004