Cnc and pic controlled alternately by same processor, using timer