Hi guys:

Well finally SUCCES, with the new encoder disc and using the polling routine that I have, which is similar to the one Aratti suggested (thank you for that).

I all ways get the inputted length + 18mm exactly and I figured that it is due to the inertia of the motor before the brake applies and doesn’t matter which method I use still have to deal with it, so I made a compensation routine modifiable by the user that it is subtracted to the inputted length before the motor is started and then added to de counter before its value is displayed on the lcd and orale!!! It works like a charm, never de less I started to study assembly language and to begin with I found an eBook named Designing Embedded Systems with Pic Microcontrollers Principles and Applications by Tim Wilmshurst, so I thank you all for your help with this project and hope count with you on the next one.