I am using the LPC1768 MCU, currently in the encoder unit, using the Build-in three COMPOS registers for my application all working great. Now I require two more resisters for compare positioning information (Total 5 registers required now) to generate trigger on a conveyor. I have gone through the Data sheet and am trying different way to reuse few other registers and wanted your guidance as to how to go about it. I believe its not a new thing but could not find an alternative solution to suite my application.
Option 1: Using Index register
The catch, the INXCNT register increments only when the index count increases. Index count increments only after a complete rotation of the wheel. As a result this cannot be used for precision measurement that needs to be done in-between a complete rotation of the wheel. Further with this option, will be to make a customized encoder wheel which meet my exact conveyor distance to increment the exact Index count to provide position information. As a result this option was dropped.
Option 2: Using Velocity registers
As these register capture pulses for a fixed interval of time. I can set a time large enough time to cover the conveyor length as the number of pulse get reset after the time overflows. This option does not compare registers value or generate any interrupt, I need to work on the pulse compare part to generate an Interrupt.
My concern is will this switching take time that I miss further pulses as we also have to consider the error in the encoder phase? Precision required for my application is 1 to 2 mm. If I miss pulse, the output will not be generated at the required position.
Is there any other way we can have functionality similar to COMPOS register?