Is it possible to set an interrupt procedure within another interrupt procedure? For example, I am reading data from one sensor, and want to read data from a second sensor simultaneously.
You can normally read as many sensors as you wish during an interrupt routine. Are you asking about re-entrant interrupts? Multiple interrupt sources? A timed interrupt that poles sensors?
I'm working with an incremental encoder and a contact sensor, and need to keep count of both (I need to know the duration of contact until a critical angle is reached) I'm working with a PIC16F87XA. Apologies for my imprecisions. I remain available to supply you with what further information I can.
How fast, in pulses per second, could your encoder run at maximum speed?
Is your encoder 2 phase - can you tell which way it turns?
What time range can your contact sensor produce?
What speed are you running your 87X?
The reason I ask is that most mechanical systems are sooo slow compared to a pic that timed polling is normally sufficient.
I'm not sure what polled timing is, but we decided to use a potentiometer instead. It is easier to work with absolute angular position, and it offers enough precision for my application.