Eoin Ross wrote: > > It crashes occasionally - or every run? > > Occaisonally... > Perhaps the home_sensor signal is not there for long and misses the window > in the program where it is read. > (Hard to imagine with that tight loop on the btfss) > > Every run... > Are you testing the right pin? > Is home_sensor on a pin or a shadow register? > > Only occasionally, and once the motor trips the home sensor it stays tripped until it is backed off of it. And home_sensor is a port pin. -- View this message in context: http://www.nabble.com/Simple-control-problem-tp19845670p19902470.html Sent from the PIC - [PIC] mailing list archive at Nabble.com. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist