Casa Step motor
9/10/96

Hardware: as in the IPS
	The main program and the operators program to both be in Fash memory
	There is no battery back up of the CMOS RAM.

Inputs:
Port	Function
	Start				Starts the current program but only from stop condition
	Continue			Continue the current program from a program “remain” position
	Stop				
	Forward limit switch		Optional
	Reverse limit switch		Optional (zero)
	Shaft Ecoder phase 1		IRQ?
	Shaft Ecoder phase 2

Outputs
Port	Function
	SM Phase 1
	SM Phase 2
	SM Phase 3
	SM Phase 4
	Light 1		For future expansion (mayby another stepmotor)
	Light 2
	Light 3		
	Light 4

Software:
There is three modes:
1/	Immediate	ie any command is actioned immediately and status can be read
2/	Programme	In this mode, commands are actioned immediately and the steps recorded
for latter replay in run mode.
3/	Run mode	Runs through program until start or stop button pressed.

Commands:
Commands consist of a command letter and can be followed by a parameter.
F	Fullstep mode
H	Half step mode
A	Acceleration rate	0 to 32000 steps /sec /sec
D	Decelleration rate	0 to 32000 steps /sec /sec	(auto calculation of when to slow down)
S	Step rate max		0 to 32000 steps /sec /sec
C	Step C/W		0 to 1 000 000 000 steps	(or until forward limit switch is reached)
A 	Step AC/W		0 to 1 000 000 000 steps	(or until reverse limit switch is reached)
w	Wait			0 to 32 000 milliseconds
R	Remain		Until start button is pressed	(can be anywhere in program)
P	Program entry		Record programe commands	)		
E	End program entry 	
X	execute the program	0 to 1000 (the program number)

Example program
P 1		;to record program 1
H		;Set half step mode
R		;Remain until contine button pressed
A 400		;Accn set
D 100		;Dccn set
C 1000	00	; move 1 meter at 100 step/mm
A 100000	; move back
E		; end entry mode