thanks mister_e I am gonna try your first thing, this is for a motorized shade application so the next step is to have the position constantly store the absolute position in the PICs eeprom incase the main power is cut it won't be confused when power is applied again. Thats aways off, first thing is first, I shall try your solution!